bots-garden/mini-mepublic Fork
⑂ d2942fd
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/mini-me.git
git clone ssh://git@rickub.com/bots-garden/mini-me.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

Merge feature/llamacpp-port-9931 into main

rickub committed 2026-11-18T06:50:30+01:00 Browse files
d2942fd parents: c11395f 8524aa7
modified .tickets/issues/0211-check-if-llamacpp-1-0-0-is-working.yaml +13 -4
@@ -1,15 +1,24 @@
11 # Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
22 id: 211
33 title: Check if llamacpp 1.0.0 is working
4-state: open
4+state: closed
55 author:
66 name: k33g
77 email: ph.charriere@gmail.com
88 createdAt: 2026-11-14T05:56:02.153Z
9-updatedAt: 2026-11-14T18:45:26.000Z
9+updatedAt: 2026-11-18T05:43:24.000Z
1010 labels: []
11-milestone: v2.0.0
11+milestone: v1.1.1
1212 epic: Providers (LLM Engine)
1313 body: ""
1414 tasks: []
15-comments: []
15+comments:
16+ - id: 1
17+ author:
18+ name: k33g
19+ email: ph.charriere@gmail.com
20+ createdAt: 2026-11-18T05:43:24.000Z
21+ body: |
22+ Closed at the user's request (2026-11-18). llama.cpp v1.0.0 listens on
23+ 9931 by default; mm's llamacpp provider uses 9931 (then 8080) since
24+ #218, and the Llama app (#219) works through it.
@@ -1,15 +1,24 @@
1 # Managed by IssueSpec. Hand edits are welcome; keep the schema valid.1 # Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2 id: 2112 id: 211
3 title: Check if llamacpp 1.0.0 is working3 title: Check if llamacpp 1.0.0 is working
4-state: open4+state: closed
5 author:5 author:
6 name: k33g6 name: k33g
7 email: ph.charriere@gmail.com7 email: ph.charriere@gmail.com
8 createdAt: 2026-11-14T05:56:02.153Z8 createdAt: 2026-11-14T05:56:02.153Z
9-updatedAt: 2026-11-14T18:45:26.000Z9+updatedAt: 2026-11-18T05:43:24.000Z
10 labels: []10 labels: []
11-milestone: v2.0.011+milestone: v1.1.1
12 epic: Providers (LLM Engine)12 epic: Providers (LLM Engine)
13 body: ""13 body: ""
14 tasks: []14 tasks: []
15-comments: []15+comments:
16+ - id: 1
17+ author:
18+ name: k33g
19+ email: ph.charriere@gmail.com
20+ createdAt: 2026-11-18T05:43:24.000Z
21+ body: |
22+ Closed at the user's request (2026-11-18). llama.cpp v1.0.0 listens on
23+ 9931 by default; mm's llamacpp provider uses 9931 (then 8080) since
24+ #218, and the Llama app (#219) works through it.
modified .tickets/issues/0218-llamacpp-llama-server-s-default-port-will-change.yaml +91 -9
@@ -1,15 +1,15 @@
11 # Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
22 id: 218
33 title: "llamacpp: llama-server's default port will change from 8080 to 9931"
4-state: open
4+state: closed
55 author:
66 name: k33g
77 email: ph.charriere@gmail.com
88 createdAt: 2026-11-14T18:37:23.000Z
9-updatedAt: 2026-11-14T18:37:23.000Z
9+updatedAt: 2026-11-18T05:43:17.000Z
1010 labels:
1111 - kind::chore
12-milestone: v2.0.0
12+milestone: v1.1.1
1313 epic: Providers (LLM Engine)
1414 related:
1515 - 217
@@ -65,44 +65,54 @@ body: |
6565 tasks:
6666 - id: 1
6767 title: Find the llama.cpp release that changes the default port, and whether it is already out
68- state: open
68+ state: closed
6969 priority: high
7070 author:
7171 name: k33g
7272 email: ph.charriere@gmail.com
7373 createdAt: 2026-11-14T18:37:23.000Z
74+ updatedAt: 2026-11-18T05:14:30.000Z
75+ closedAt: 2026-11-18T05:14:30.000Z
7476 - id: 2
7577 title: Decide - follow the new default (9931), keep 8080, or try both during a transition
76- state: open
78+ state: closed
7779 priority: high
7880 author:
7981 name: k33g
8082 email: ph.charriere@gmail.com
8183 createdAt: 2026-11-14T18:37:23.000Z
84+ updatedAt: 2026-11-18T05:19:32.000Z
85+ closedAt: 2026-11-18T05:19:32.000Z
8286 - id: 3
8387 title: Engine - default address, fallback and start hint of llamacpp
84- state: open
88+ state: closed
8589 priority: medium
8690 author:
8791 name: k33g
8892 email: ph.charriere@gmail.com
8993 createdAt: 2026-11-14T18:37:23.000Z
94+ updatedAt: 2026-11-18T05:19:32.000Z
95+ closedAt: 2026-11-18T05:19:32.000Z
9096 - id: 4
9197 title: Shipped files - agent.llamacpp.yaml, config.samples/agent.llamacpp.*, demos using llamacpp
92- state: open
98+ state: closed
9399 priority: medium
94100 author:
95101 name: k33g
96102 email: ph.charriere@gmail.com
97103 createdAt: 2026-11-14T18:37:23.000Z
104+ updatedAt: 2026-11-18T05:19:32.000Z
105+ closedAt: 2026-11-18T05:19:32.000Z
98106 - id: 5
99107 title: Docs EN+FR - run-with-llama-cpp, configuration (providers table), cli (warning example), container and sandbox guides
100- state: open
108+ state: closed
101109 priority: medium
102110 author:
103111 name: k33g
104112 email: ph.charriere@gmail.com
105113 createdAt: 2026-11-14T18:37:23.000Z
114+ updatedAt: 2026-11-18T05:19:32.000Z
115+ closedAt: 2026-11-18T05:19:32.000Z
106116 - id: 6
107117 title: Docker Sandbox - the port in the mini-me kit's network policy, if 8080 is ever added there (mini-me-kit repository)
108118 state: open
@@ -111,4 +121,76 @@ tasks:
111121 name: k33g
112122 email: ph.charriere@gmail.com
113123 createdAt: 2026-11-14T18:37:23.000Z
114-comments: []
124+comments:
125+ - id: 1
126+ author:
127+ name: k33g
128+ email: ph.charriere@gmail.com
129+ createdAt: 2026-11-18T05:14:30.000Z
130+ body: |
131+ Moved to v1.1.1 (user, 2026-11-18). Task 1 — the change is **out**
132+ (read on GitHub, 2026-11-18):
133+
134+ - Notice added 2026-08-03 (ggml-org/llama.cpp#26508, "add notice for
135+ upcoming default port change 8080 --> 9931").
136+ - Default changed 2026-10-09 (#30159, commit b42b7e6d30,
137+ `common/common.h`: `port = 9931`). First release with it:
138+ **b11521** (2026-10-09); b11518 and earlier still use 8080. In
139+ **v1.0.0** (2026-11-13, the latest release) too. The server README
140+ now says it listens on `127.0.0.1:9931` by default.
141+ - The official **Docker images keep 8080**: the same commit adds
142+ `ENV LLAMA_ARG_PORT=8080` to every `.devops/*.Dockerfile`.
143+ - `--port` and `LLAMA_ARG_PORT` still override it.
144+ - The user's llama-server that printed the notice (2026-11-14) was
145+ thus a build between 2026-08-03 and b11521 — older than the change.
146+
147+ Also: the Llama app (#219) serves llama-server at `localhost:9931`
148+ too, so a `llamacpp` provider on 9931 would reach it.
149+ - id: 2
150+ author:
151+ name: k33g
152+ email: ph.charriere@gmail.com
153+ createdAt: 2026-11-18T05:19:32.000Z
154+ body: |
155+ Decision (user, 2026-11-18): **9931, then 8080**. Implemented on
156+ `feature/llamacpp-port-9931` (uncommitted).
157+
158+ - Engine: llamacpp's default `http://127.0.0.1:9931/v1`, a new
159+ `alternates` field with `http://127.0.0.1:8080/v1` (tried, in
160+ order, when the address in use is the provider's default and does
161+ not answer — before the fallback; a baseUrl of the file's own skips
162+ them), fallback `http://host.docker.internal:9931/v1`, start hint
163+ `--port 9931`. `engine.LocalURLs(provider)`.
164+ - mm init / acp-create: the wizard lists the models from the first
165+ local address that answers among the default and its alternates
166+ (each with its 127.0.0.1 variant), then the fallback. The written
167+ file's comment names the alternate.
168+ - Shipped files: `agent.llamacpp.yaml` and
169+ `config.samples/agent.llamacpp.{ornith,qwen3.8}.yaml` → baseUrl
170+ 9931 (8080 still tried). No demo used llamacpp on 8080.
171+ - Docs EN+FR: run-with-llama-cpp (no `--port` in the start line, a
172+ "llama-server on 8080" variant), configuration + mcp-configuration
173+ (EN) providers table and note, cli (warning, `--base-url`), sandbox
174+ guide (port 9931), verify-tool-order.
175+
176+ Tests: `TestPickBaseTriesTheAlternates` (real HTTP servers),
177+ `TestChooseBaseTriesTheAlternates`, updated defaults/render tests;
178+ whole suite green, gofmt and go vet clean. End to end with the built
179+ binary: a fake llama-server on 127.0.0.1:8080 only → `mm init
180+ --provider llamacpp` says `Model? (listed from
181+ http://127.0.0.1:8080/v1)`.
182+
183+ Not done: from a container, a llama-server on the host's 8080 is not
184+ found without a baseUrl (one fallback address, 9931). Task 6 (the
185+ sandbox kit's network policy, other repository) left open. Not tried
186+ with a real llama-server.
187+ - id: 3
188+ author:
189+ name: k33g
190+ email: ph.charriere@gmail.com
191+ createdAt: 2026-11-18T05:43:17.000Z
192+ body: |
193+ Closed at the user's request (2026-11-18), after the Llama app (#219)
194+ was found to work through llamacpp on 9931. Task 6 (port 9931 in the
195+ mini-me kit's network policy, other repository) is left open: not
196+ done here.
@@ -1,15 +1,15 @@
1 # Managed by IssueSpec. Hand edits are welcome; keep the schema valid.1 # Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2 id: 2182 id: 218
3 title: "llamacpp: llama-server's default port will change from 8080 to 9931"3 title: "llamacpp: llama-server's default port will change from 8080 to 9931"
4-state: open4+state: closed
5 author:5 author:
6 name: k33g6 name: k33g
7 email: ph.charriere@gmail.com7 email: ph.charriere@gmail.com
8 createdAt: 2026-11-14T18:37:23.000Z8 createdAt: 2026-11-14T18:37:23.000Z
9-updatedAt: 2026-11-14T18:37:23.000Z9+updatedAt: 2026-11-18T05:43:17.000Z
10 labels:10 labels:
11 - kind::chore11 - kind::chore
12-milestone: v2.0.012+milestone: v1.1.1
13 epic: Providers (LLM Engine)13 epic: Providers (LLM Engine)
14 related:14 related:
15 - 21715 - 217
@@ -65,44 +65,54 @@ body: |
65 tasks:65 tasks:
66 - id: 166 - id: 1
67 title: Find the llama.cpp release that changes the default port, and whether it is already out67 title: Find the llama.cpp release that changes the default port, and whether it is already out
68- state: open68+ state: closed
69 priority: high69 priority: high
70 author:70 author:
71 name: k33g71 name: k33g
72 email: ph.charriere@gmail.com72 email: ph.charriere@gmail.com
73 createdAt: 2026-11-14T18:37:23.000Z73 createdAt: 2026-11-14T18:37:23.000Z
74+ updatedAt: 2026-11-18T05:14:30.000Z
75+ closedAt: 2026-11-18T05:14:30.000Z
74 - id: 276 - id: 2
75 title: Decide - follow the new default (9931), keep 8080, or try both during a transition77 title: Decide - follow the new default (9931), keep 8080, or try both during a transition
76- state: open78+ state: closed
77 priority: high79 priority: high
78 author:80 author:
79 name: k33g81 name: k33g
80 email: ph.charriere@gmail.com82 email: ph.charriere@gmail.com
81 createdAt: 2026-11-14T18:37:23.000Z83 createdAt: 2026-11-14T18:37:23.000Z
84+ updatedAt: 2026-11-18T05:19:32.000Z
85+ closedAt: 2026-11-18T05:19:32.000Z
82 - id: 386 - id: 3
83 title: Engine - default address, fallback and start hint of llamacpp87 title: Engine - default address, fallback and start hint of llamacpp
84- state: open88+ state: closed
85 priority: medium89 priority: medium
86 author:90 author:
87 name: k33g91 name: k33g
88 email: ph.charriere@gmail.com92 email: ph.charriere@gmail.com
89 createdAt: 2026-11-14T18:37:23.000Z93 createdAt: 2026-11-14T18:37:23.000Z
94+ updatedAt: 2026-11-18T05:19:32.000Z
95+ closedAt: 2026-11-18T05:19:32.000Z
90 - id: 496 - id: 4
91 title: Shipped files - agent.llamacpp.yaml, config.samples/agent.llamacpp.*, demos using llamacpp97 title: Shipped files - agent.llamacpp.yaml, config.samples/agent.llamacpp.*, demos using llamacpp
92- state: open98+ state: closed
93 priority: medium99 priority: medium
94 author:100 author:
95 name: k33g101 name: k33g
96 email: ph.charriere@gmail.com102 email: ph.charriere@gmail.com
97 createdAt: 2026-11-14T18:37:23.000Z103 createdAt: 2026-11-14T18:37:23.000Z
104+ updatedAt: 2026-11-18T05:19:32.000Z
105+ closedAt: 2026-11-18T05:19:32.000Z
98 - id: 5106 - id: 5
99 title: Docs EN+FR - run-with-llama-cpp, configuration (providers table), cli (warning example), container and sandbox guides107 title: Docs EN+FR - run-with-llama-cpp, configuration (providers table), cli (warning example), container and sandbox guides
100- state: open108+ state: closed
101 priority: medium109 priority: medium
102 author:110 author:
103 name: k33g111 name: k33g
104 email: ph.charriere@gmail.com112 email: ph.charriere@gmail.com
105 createdAt: 2026-11-14T18:37:23.000Z113 createdAt: 2026-11-14T18:37:23.000Z
114+ updatedAt: 2026-11-18T05:19:32.000Z
115+ closedAt: 2026-11-18T05:19:32.000Z
106 - id: 6116 - id: 6
107 title: Docker Sandbox - the port in the mini-me kit's network policy, if 8080 is ever added there (mini-me-kit repository)117 title: Docker Sandbox - the port in the mini-me kit's network policy, if 8080 is ever added there (mini-me-kit repository)
108 state: open118 state: open
@@ -111,4 +121,76 @@ tasks:
111 name: k33g121 name: k33g
112 email: ph.charriere@gmail.com122 email: ph.charriere@gmail.com
113 createdAt: 2026-11-14T18:37:23.000Z123 createdAt: 2026-11-14T18:37:23.000Z
114-comments: []124+comments:
125+ - id: 1
126+ author:
127+ name: k33g
128+ email: ph.charriere@gmail.com
129+ createdAt: 2026-11-18T05:14:30.000Z
130+ body: |
131+ Moved to v1.1.1 (user, 2026-11-18). Task 1 — the change is **out**
132+ (read on GitHub, 2026-11-18):
133+
134+ - Notice added 2026-08-03 (ggml-org/llama.cpp#26508, "add notice for
135+ upcoming default port change 8080 --> 9931").
136+ - Default changed 2026-10-09 (#30159, commit b42b7e6d30,
137+ `common/common.h`: `port = 9931`). First release with it:
138+ **b11521** (2026-10-09); b11518 and earlier still use 8080. In
139+ **v1.0.0** (2026-11-13, the latest release) too. The server README
140+ now says it listens on `127.0.0.1:9931` by default.
141+ - The official **Docker images keep 8080**: the same commit adds
142+ `ENV LLAMA_ARG_PORT=8080` to every `.devops/*.Dockerfile`.
143+ - `--port` and `LLAMA_ARG_PORT` still override it.
144+ - The user's llama-server that printed the notice (2026-11-14) was
145+ thus a build between 2026-08-03 and b11521 — older than the change.
146+
147+ Also: the Llama app (#219) serves llama-server at `localhost:9931`
148+ too, so a `llamacpp` provider on 9931 would reach it.
149+ - id: 2
150+ author:
151+ name: k33g
152+ email: ph.charriere@gmail.com
153+ createdAt: 2026-11-18T05:19:32.000Z
154+ body: |
155+ Decision (user, 2026-11-18): **9931, then 8080**. Implemented on
156+ `feature/llamacpp-port-9931` (uncommitted).
157+
158+ - Engine: llamacpp's default `http://127.0.0.1:9931/v1`, a new
159+ `alternates` field with `http://127.0.0.1:8080/v1` (tried, in
160+ order, when the address in use is the provider's default and does
161+ not answer — before the fallback; a baseUrl of the file's own skips
162+ them), fallback `http://host.docker.internal:9931/v1`, start hint
163+ `--port 9931`. `engine.LocalURLs(provider)`.
164+ - mm init / acp-create: the wizard lists the models from the first
165+ local address that answers among the default and its alternates
166+ (each with its 127.0.0.1 variant), then the fallback. The written
167+ file's comment names the alternate.
168+ - Shipped files: `agent.llamacpp.yaml` and
169+ `config.samples/agent.llamacpp.{ornith,qwen3.8}.yaml` → baseUrl
170+ 9931 (8080 still tried). No demo used llamacpp on 8080.
171+ - Docs EN+FR: run-with-llama-cpp (no `--port` in the start line, a
172+ "llama-server on 8080" variant), configuration + mcp-configuration
173+ (EN) providers table and note, cli (warning, `--base-url`), sandbox
174+ guide (port 9931), verify-tool-order.
175+
176+ Tests: `TestPickBaseTriesTheAlternates` (real HTTP servers),
177+ `TestChooseBaseTriesTheAlternates`, updated defaults/render tests;
178+ whole suite green, gofmt and go vet clean. End to end with the built
179+ binary: a fake llama-server on 127.0.0.1:8080 only → `mm init
180+ --provider llamacpp` says `Model? (listed from
181+ http://127.0.0.1:8080/v1)`.
182+
183+ Not done: from a container, a llama-server on the host's 8080 is not
184+ found without a baseUrl (one fallback address, 9931). Task 6 (the
185+ sandbox kit's network policy, other repository) left open. Not tried
186+ with a real llama-server.
187+ - id: 3
188+ author:
189+ name: k33g
190+ email: ph.charriere@gmail.com
191+ createdAt: 2026-11-18T05:43:17.000Z
192+ body: |
193+ Closed at the user's request (2026-11-18), after the Llama app (#219)
194+ was found to work through llamacpp on 9931. Task 6 (port 9931 in the
195+ mini-me kit's network policy, other repository) is left open: not
196+ done here.
added .tickets/issues/0219-add-the-llama-app-provider-llama-app-ggml-org.yaml +162 -0
new file mode 100644
@@ -0,0 +1,162 @@
1+# Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2+id: 219
3+title: "Add the Llama app provider (llama.app, ggml-org/Llama-macOS)"
4+state: closed
5+author:
6+ name: k33g
7+ email: ph.charriere@gmail.com
8+createdAt: 2026-11-18T05:04:40.000Z
9+updatedAt: 2026-11-18T05:42:46.000Z
10+labels:
11+ - kind::feature
12+ - priority::medium
13+milestone: v1.1.1
14+epic: Providers (LLM Engine)
15+related:
16+ - 218
17+ - 217
18+ - 75
19+body: |
20+ Asked by the user (2026-11-18): add a provider for **Llama**,
21+ <https://llama.app/>, source <https://github.com/ggml-org/Llama-macOS>.
22+
23+ ## What Llama is (read 2026-11-18 from the site and the README, not tried)
24+
25+ - A free, MIT-licensed app by ggml-org, "built on llama.cpp": a menu bar
26+ app on macOS, also on Windows 11, command line only on Linux.
27+ `brew install --cask llama-app`.
28+ - It runs llama.cpp's server (the README speaks of a `llama serve`
29+ command and links to the llama.cpp server docs); it uses an installed
30+ llama.cpp, else installs a prebuilt binary.
31+ - **API at `http://localhost:9931/v1`**, no API key: `GET /v1/models`
32+ lists the installed models, `POST /v1/chat/completions`; the site also
33+ mentions Anthropic-compatible endpoints.
34+ - Several models: any GGUF from Hugging Face (the HF cache, shared with
35+ llama.cpp), loaded on request, **unloaded after 5 minutes idle**.
36+ Config `models.ini` (generated) + `~/.config/llama/models.user.ini`
37+ (`[org/repo:QUANT]` sections) — this looks like llama-server's
38+ **router mode** with a presets file, to confirm.
39+ - Reachable from the Mac only by default; *Allow network access* binds
40+ to Tailscale or `0.0.0.0`. `--api-key` only through the
41+ `extraServerArgs` default (`defaults write`).
42+ - No version or release in the repository yet.
43+
44+ ## Proposal
45+
46+ A provider `llama` (name to decide: `llama`, `llamaapp`) in
47+ [internal/engine/openai_compat.go](internal/engine/openai_compat.go),
48+ built like `llamacpp` since the server behind it is llama-server:
49+
50+ - `baseURL: http://localhost:9931/v1`, fallback
51+ `http://host.docker.internal:9931/v1` (works only with *Allow network
52+ access* on — say so in the start hint and the docs).
53+ - Key: `LLAMA_API_KEY` like llamacpp, or none.
54+ - Probe, progress, thinking off, unload: llamacpp's
55+ (`probeLlamaCpp`, `unloadRouter` if it is the router) — to check
56+ against the real app. Facts for `mm init`: `propsFacts` (in router
57+ mode `/props` may need `?model=`).
58+ - `autoPull`: unknown whether the app downloads a model over its API;
59+ otherwise `noPull` advice (install from the app, or the one-click
60+ link).
61+ - `mm init` / `mm acp-create`: add it to `providers` and `local`
62+ ([internal/agentinit/wizard.go](internal/agentinit/wizard.go)) and to
63+ `ModelFacts` ([internal/agentinit/facts.go](internal/agentinit/facts.go)).
64+
65+ ## Link with #218
66+
67+ 9931 is also the port llama-server announces as its future default
68+ (#218). Once that release is out, `llamacpp` and the Llama app may
69+ answer on the same address: the two providers must not fight over it,
70+ and #218's decision should be taken knowing this one.
71+
72+ ## Open questions
73+
74+ - The exact name of the provider.
75+ - Router mode or not; what `/props`, `/models` and the unload look
76+ like on the real app.
77+ - Does it pass `return_progress` and `chat_template_kwargs` through
78+ (llama-server does)?
79+ - The Anthropic-compatible endpoints: out of scope (mm speaks OpenAI).
80+
81+ ## Acceptance criteria
82+
83+ - With the Llama app running on a Mac, an agent file with
84+ `provider: <name>` and no `baseUrl` talks to it; `mm init` and
85+ `mm acp-create` list its models and read the model's facts.
86+ - From a container, the fallback works with *Allow network access* on.
87+ - Tests (engine registry, default URLs, wizard lists); a shipped
88+ `agent.<name>.yaml`; docs EN+FR (a how-to "run mini-me with the Llama
89+ app", the providers table in configuration, cli, container and sandbox
90+ guides — port 9931 in the sandbox's network policy).
91+tasks:
92+ - id: 1
93+ title: Try the real app on a Mac - /v1/models, /props, router mode, unload, progress, thinking off, network access
94+ state: closed
95+ priority: high
96+ author:
97+ name: k33g
98+ email: ph.charriere@gmail.com
99+ createdAt: 2026-11-18T05:04:40.000Z
100+ updatedAt: 2026-11-18T05:42:46.000Z
101+ closedAt: 2026-11-18T05:42:46.000Z
102+ - id: 2
103+ title: Choose the provider's name and settings (address, fallback, key, probe, unload, pull)
104+ state: closed
105+ priority: high
106+ author:
107+ name: k33g
108+ email: ph.charriere@gmail.com
109+ createdAt: 2026-11-18T05:04:40.000Z
110+ updatedAt: 2026-11-18T05:42:46.000Z
111+ closedAt: 2026-11-18T05:42:46.000Z
112+ - id: 3
113+ title: Engine - register the provider, tests
114+ state: closed
115+ priority: medium
116+ author:
117+ name: k33g
118+ email: ph.charriere@gmail.com
119+ createdAt: 2026-11-18T05:04:40.000Z
120+ updatedAt: 2026-11-18T05:42:46.000Z
121+ closedAt: 2026-11-18T05:42:46.000Z
122+ - id: 4
123+ title: mm init / mm acp-create - provider list, local servers, model facts
124+ state: closed
125+ priority: medium
126+ author:
127+ name: k33g
128+ email: ph.charriere@gmail.com
129+ createdAt: 2026-11-18T05:04:40.000Z
130+ updatedAt: 2026-11-18T05:42:46.000Z
131+ closedAt: 2026-11-18T05:42:46.000Z
132+ - id: 5
133+ title: Shipped agent file and a demo
134+ state: closed
135+ priority: low
136+ author:
137+ name: k33g
138+ email: ph.charriere@gmail.com
139+ createdAt: 2026-11-18T05:04:40.000Z
140+ updatedAt: 2026-11-18T05:42:46.000Z
141+ closedAt: 2026-11-18T05:42:46.000Z
142+ - id: 6
143+ title: Docs EN+FR - how-to, configuration providers table, cli, container and sandbox guides, README
144+ state: closed
145+ priority: medium
146+ author:
147+ name: k33g
148+ email: ph.charriere@gmail.com
149+ createdAt: 2026-11-18T05:04:40.000Z
150+ updatedAt: 2026-11-18T05:42:46.000Z
151+ closedAt: 2026-11-18T05:42:46.000Z
152+comments:
153+ - id: 1
154+ author:
155+ name: k33g
156+ email: ph.charriere@gmail.com
157+ createdAt: 2026-11-18T05:42:46.000Z
158+ body: |
159+ Closed at the user's request (2026-11-18): the Llama app works with
160+ the existing `llamacpp` provider — since #218 its default address is
161+ `http://127.0.0.1:9931/v1`, the app's port. No separate provider
162+ needed; tasks closed without code of their own.
new file mode 100644
@@ -0,0 +1,162 @@
1+# Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2+id: 219
3+title: "Add the Llama app provider (llama.app, ggml-org/Llama-macOS)"
4+state: closed
5+author:
6+ name: k33g
7+ email: ph.charriere@gmail.com
8+createdAt: 2026-11-18T05:04:40.000Z
9+updatedAt: 2026-11-18T05:42:46.000Z
10+labels:
11+ - kind::feature
12+ - priority::medium
13+milestone: v1.1.1
14+epic: Providers (LLM Engine)
15+related:
16+ - 218
17+ - 217
18+ - 75
19+body: |
20+ Asked by the user (2026-11-18): add a provider for **Llama**,
21+ <https://llama.app/>, source <https://github.com/ggml-org/Llama-macOS>.
22+
23+ ## What Llama is (read 2026-11-18 from the site and the README, not tried)
24+
25+ - A free, MIT-licensed app by ggml-org, "built on llama.cpp": a menu bar
26+ app on macOS, also on Windows 11, command line only on Linux.
27+ `brew install --cask llama-app`.
28+ - It runs llama.cpp's server (the README speaks of a `llama serve`
29+ command and links to the llama.cpp server docs); it uses an installed
30+ llama.cpp, else installs a prebuilt binary.
31+ - **API at `http://localhost:9931/v1`**, no API key: `GET /v1/models`
32+ lists the installed models, `POST /v1/chat/completions`; the site also
33+ mentions Anthropic-compatible endpoints.
34+ - Several models: any GGUF from Hugging Face (the HF cache, shared with
35+ llama.cpp), loaded on request, **unloaded after 5 minutes idle**.
36+ Config `models.ini` (generated) + `~/.config/llama/models.user.ini`
37+ (`[org/repo:QUANT]` sections) — this looks like llama-server's
38+ **router mode** with a presets file, to confirm.
39+ - Reachable from the Mac only by default; *Allow network access* binds
40+ to Tailscale or `0.0.0.0`. `--api-key` only through the
41+ `extraServerArgs` default (`defaults write`).
42+ - No version or release in the repository yet.
43+
44+ ## Proposal
45+
46+ A provider `llama` (name to decide: `llama`, `llamaapp`) in
47+ [internal/engine/openai_compat.go](internal/engine/openai_compat.go),
48+ built like `llamacpp` since the server behind it is llama-server:
49+
50+ - `baseURL: http://localhost:9931/v1`, fallback
51+ `http://host.docker.internal:9931/v1` (works only with *Allow network
52+ access* on — say so in the start hint and the docs).
53+ - Key: `LLAMA_API_KEY` like llamacpp, or none.
54+ - Probe, progress, thinking off, unload: llamacpp's
55+ (`probeLlamaCpp`, `unloadRouter` if it is the router) — to check
56+ against the real app. Facts for `mm init`: `propsFacts` (in router
57+ mode `/props` may need `?model=`).
58+ - `autoPull`: unknown whether the app downloads a model over its API;
59+ otherwise `noPull` advice (install from the app, or the one-click
60+ link).
61+ - `mm init` / `mm acp-create`: add it to `providers` and `local`
62+ ([internal/agentinit/wizard.go](internal/agentinit/wizard.go)) and to
63+ `ModelFacts` ([internal/agentinit/facts.go](internal/agentinit/facts.go)).
64+
65+ ## Link with #218
66+
67+ 9931 is also the port llama-server announces as its future default
68+ (#218). Once that release is out, `llamacpp` and the Llama app may
69+ answer on the same address: the two providers must not fight over it,
70+ and #218's decision should be taken knowing this one.
71+
72+ ## Open questions
73+
74+ - The exact name of the provider.
75+ - Router mode or not; what `/props`, `/models` and the unload look
76+ like on the real app.
77+ - Does it pass `return_progress` and `chat_template_kwargs` through
78+ (llama-server does)?
79+ - The Anthropic-compatible endpoints: out of scope (mm speaks OpenAI).
80+
81+ ## Acceptance criteria
82+
83+ - With the Llama app running on a Mac, an agent file with
84+ `provider: <name>` and no `baseUrl` talks to it; `mm init` and
85+ `mm acp-create` list its models and read the model's facts.
86+ - From a container, the fallback works with *Allow network access* on.
87+ - Tests (engine registry, default URLs, wizard lists); a shipped
88+ `agent.<name>.yaml`; docs EN+FR (a how-to "run mini-me with the Llama
89+ app", the providers table in configuration, cli, container and sandbox
90+ guides — port 9931 in the sandbox's network policy).
91+tasks:
92+ - id: 1
93+ title: Try the real app on a Mac - /v1/models, /props, router mode, unload, progress, thinking off, network access
94+ state: closed
95+ priority: high
96+ author:
97+ name: k33g
98+ email: ph.charriere@gmail.com
99+ createdAt: 2026-11-18T05:04:40.000Z
100+ updatedAt: 2026-11-18T05:42:46.000Z
101+ closedAt: 2026-11-18T05:42:46.000Z
102+ - id: 2
103+ title: Choose the provider's name and settings (address, fallback, key, probe, unload, pull)
104+ state: closed
105+ priority: high
106+ author:
107+ name: k33g
108+ email: ph.charriere@gmail.com
109+ createdAt: 2026-11-18T05:04:40.000Z
110+ updatedAt: 2026-11-18T05:42:46.000Z
111+ closedAt: 2026-11-18T05:42:46.000Z
112+ - id: 3
113+ title: Engine - register the provider, tests
114+ state: closed
115+ priority: medium
116+ author:
117+ name: k33g
118+ email: ph.charriere@gmail.com
119+ createdAt: 2026-11-18T05:04:40.000Z
120+ updatedAt: 2026-11-18T05:42:46.000Z
121+ closedAt: 2026-11-18T05:42:46.000Z
122+ - id: 4
123+ title: mm init / mm acp-create - provider list, local servers, model facts
124+ state: closed
125+ priority: medium
126+ author:
127+ name: k33g
128+ email: ph.charriere@gmail.com
129+ createdAt: 2026-11-18T05:04:40.000Z
130+ updatedAt: 2026-11-18T05:42:46.000Z
131+ closedAt: 2026-11-18T05:42:46.000Z
132+ - id: 5
133+ title: Shipped agent file and a demo
134+ state: closed
135+ priority: low
136+ author:
137+ name: k33g
138+ email: ph.charriere@gmail.com
139+ createdAt: 2026-11-18T05:04:40.000Z
140+ updatedAt: 2026-11-18T05:42:46.000Z
141+ closedAt: 2026-11-18T05:42:46.000Z
142+ - id: 6
143+ title: Docs EN+FR - how-to, configuration providers table, cli, container and sandbox guides, README
144+ state: closed
145+ priority: medium
146+ author:
147+ name: k33g
148+ email: ph.charriere@gmail.com
149+ createdAt: 2026-11-18T05:04:40.000Z
150+ updatedAt: 2026-11-18T05:42:46.000Z
151+ closedAt: 2026-11-18T05:42:46.000Z
152+comments:
153+ - id: 1
154+ author:
155+ name: k33g
156+ email: ph.charriere@gmail.com
157+ createdAt: 2026-11-18T05:42:46.000Z
158+ body: |
159+ Closed at the user's request (2026-11-18): the Llama app works with
160+ the existing `llamacpp` provider — since #218 its default address is
161+ `http://127.0.0.1:9931/v1`, the app's port. No separate provider
162+ needed; tasks closed without code of their own.
added .tickets/issues/0220-mm-and-mm-tui-without-an-agent-file-an-error-in.yaml +181 -0
new file mode 100644
@@ -0,0 +1,181 @@
1+# Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2+id: 220
3+title: "mm / mm tui without an agent file: an error instead of the built-in model and engine"
4+state: closed
5+author:
6+ name: k33g
7+ email: ph.charriere@gmail.com
8+createdAt: 2026-11-18T05:33:12.000Z
9+updatedAt: 2026-11-18T05:49:53.000Z
10+labels:
11+ - kind::feature
12+ - priority::medium
13+milestone: v1.1.1
14+epic: CLI
15+body: |
16+ ## Seen (user, 2026-11-18)
17+
18+ `mm` or `mm tui` started in a directory with no agent file runs
19+ anyway, with a built-in model on a built-in engine. It should stop with
20+ an error message instead.
21+
22+ ## Today (code read 2026-11-18)
23+
24+ - `config.Load` ([internal/config/config.go](internal/config/config.go))
25+ tries the command line, then `AGENT_CONFIG`, then `./agent.yaml`,
26+ then `./.mm/agent.yaml`. A file **named** (command line or
27+ `AGENT_CONFIG`) that does not exist is already an error. When none of
28+ the default places has a file, it returns `""` and no error: "the
29+ built-in defaults are enough to run" (comment in `Load`).
30+ - The defaults are `config.Cfg`: `provider: dmr`, `model:
31+ huggingface.co/jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M`.
32+ So a user without Docker Model Runner, or without that model, gets a
33+ start-up warning or a failing first turn, far from the real cause.
34+ - The banner says `config: built-in defaults`, and the CLI reference
35+ documents it ("Not an error: built-in defaults are used",
36+ [docs/en/reference/cli.md](docs/en/reference/cli.md), lookup table).
37+ - `main.go` calls `config.Load(*configPath)` once for every mode.
38+
39+ ## Expected
40+
41+ With no agent file found, `mm` (line mode) and `mm tui` print an
42+ error and exit with a non-zero code, saying where mm looked and how to
43+ get a file, e.g.:
44+
45+ ```text
46+ [config error: no agent file — looked for ./agent.yaml and ./.mm/agent.yaml (AGENT_CONFIG is not set).
47+ Create one with: mm init (or name one: mm <file>, AGENT_CONFIG=<file>)]
48+ ```
49+
50+ ## Scope to decide
51+
52+ - **`-p` (one prompt) and `--ask`**: same error? (Proposal: yes —
53+ a script should fail loudly too.)
54+ - **`mm acp`**: the editor starts it in the project directory; with no
55+ file, the error goes to the ACP log only and the editor shows a
56+ failed agent. Same rule, or keep a clearer message over ACP
57+ (e.g. answer `initialize` then say "no agent file — use
58+ `mm acp-create`" in the thread)? `mm acp-create` itself needs no
59+ file and must keep working.
60+ - **`AGENT_PROVIDER` + `AGENT_MODEL` set without a file**: still an
61+ error, or enough to run?
62+ - Commands that need no agent file must stay unaffected: `mm init`,
63+ `mm acp-create`, `mm skillcreate`, `mm dockerinit`, `mm sbxinit`,
64+ `--version`, `--help`.
65+ - Whether `config.Load` itself changes (it is also used by tests and
66+ by `agentinit.WriteFile`, which reloads the file it wrote) or only
67+ `main.go` refuses `path == ""` for the run modes. Proposal: keep
68+ `Load` as is, refuse in `main.go`.
69+
70+ ## To check before changing
71+
72+ - Docs that rely on running without a file: cli.md (lookup table, banner
73+ `config: built-in defaults`), architecture explanation, sandbox and
74+ skill-routing guides, the create-an-agent-from-an-editor guide (grep
75+ "built-in defaults" / "no config file" in docs/).
76+ - Demos, `testing/` benches and sandbox kits that start `mm`
77+ without a file (the kits' empty `config` argument falls back on
78+ `./agent.yaml`).
79+
80+ ## Acceptance criteria
81+
82+ - `mm` and `mm tui` in an empty directory: the error above on stderr,
83+ exit code 1, no model call, no window opened.
84+ - A named file that does not exist: unchanged (already an error).
85+ - The commands that need no file still work.
86+ - Tests (main-level or a helper), docs EN+FR (cli reference, upgrading
87+ note in the release notes: a breaking change for anyone who ran mm
88+ without a file).
89+tasks:
90+ - id: 1
91+ title: Decide the scope - -p, --ask, mm acp, AGENT_PROVIDER/AGENT_MODEL without a file
92+ state: closed
93+ priority: high
94+ author:
95+ name: k33g
96+ email: ph.charriere@gmail.com
97+ createdAt: 2026-11-18T05:33:12.000Z
98+ updatedAt: 2026-11-18T05:37:17.000Z
99+ closedAt: 2026-11-18T05:37:17.000Z
100+ - id: 2
101+ title: Refuse a missing agent file for the run modes, with where mm looked and how to get one (mm init)
102+ state: closed
103+ priority: high
104+ author:
105+ name: k33g
106+ email: ph.charriere@gmail.com
107+ createdAt: 2026-11-18T05:33:12.000Z
108+ updatedAt: 2026-11-18T05:37:17.000Z
109+ closedAt: 2026-11-18T05:37:17.000Z
110+ - id: 3
111+ title: Check demos, testing benches and sandbox kits that start mm without a file
112+ state: closed
113+ priority: medium
114+ author:
115+ name: k33g
116+ email: ph.charriere@gmail.com
117+ createdAt: 2026-11-18T05:33:12.000Z
118+ updatedAt: 2026-11-18T05:37:17.000Z
119+ closedAt: 2026-11-18T05:37:17.000Z
120+ - id: 4
121+ title: Tests - empty directory fails with exit 1; named missing file unchanged; init/acp-create/skillcreate/dockerinit/sbxinit unaffected
122+ state: closed
123+ priority: medium
124+ author:
125+ name: k33g
126+ email: ph.charriere@gmail.com
127+ createdAt: 2026-11-18T05:33:12.000Z
128+ updatedAt: 2026-11-18T05:37:17.000Z
129+ closedAt: 2026-11-18T05:37:17.000Z
130+ - id: 5
131+ title: Docs EN+FR - cli reference (lookup table, banner), explanation, guides that mention the built-in defaults
132+ state: closed
133+ priority: medium
134+ author:
135+ name: k33g
136+ email: ph.charriere@gmail.com
137+ createdAt: 2026-11-18T05:33:12.000Z
138+ updatedAt: 2026-11-18T05:37:17.000Z
139+ closedAt: 2026-11-18T05:37:17.000Z
140+comments:
141+ - id: 1
142+ author:
143+ name: k33g
144+ email: ph.charriere@gmail.com
145+ createdAt: 2026-11-18T05:37:17.000Z
146+ body: |
147+ User (2026-11-18): "ok vas y" — the proposals taken: the same error
148+ for every mode that talks to a model (line, tui, -p, --ask, acp),
149+ also when AGENT_PROVIDER / AGENT_MODEL are set; refused in main.go,
150+ `config.Load` unchanged (still returns "" with the defaults: tests
151+ and the wizards rely on it). Done on `feature/llamacpp-port-9931`
152+ (with #218, uncommitted).
153+
154+ - `main.go`: after `config.Load`, `path == ""` → `noAgentFile()` on
155+ stderr, exit 1. The "built-in defaults" banner label is gone.
156+ init, acp-create, skillcreate, dockerinit, sbxinit, --version,
157+ --about are answered before and still work.
158+ - Message: `[config error: no agent file in <dir> — looked for
159+ agent.yaml and .mm/agent.yaml (AGENT_CONFIG is not set).` then
160+ ` Create one with: mm init (or mm acp-create from an editor). Or
161+ name one: mm <file>, AGENT_CONFIG=<file> ]`.
162+ - Tests: `TestNoAgentFileStopsMM` runs the real main in a child
163+ process in an empty dir for `mm`, `mm tui`, `mm -p hello`,
164+ `mm acp` → exit 1, the error on stderr, nothing on stdout.
165+ Whole suite green, gofmt + vet clean. Built binary checked in an
166+ empty directory (exit 1) and `--version` (exit 0).
167+ - Scripts: none in the repo starts mm without a file. A sandbox kit
168+ started with no AGENT_CONFIG outside the project now stops with
169+ this error instead of running Mellum2 on dmr.
170+ - Docs EN+FR: cli reference (lookup table, row 4), sandbox guide.
171+
172+ Not checked: how Zed shows an `mm acp` that exits at start-up (the
173+ message is in the ACP log). Release notes must call it a breaking
174+ change.
175+ - id: 2
176+ author:
177+ name: k33g
178+ email: ph.charriere@gmail.com
179+ createdAt: 2026-11-18T05:49:53.000Z
180+ body: |
181+ Closed at the user's request (2026-11-18).
new file mode 100644
@@ -0,0 +1,181 @@
1+# Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2+id: 220
3+title: "mm / mm tui without an agent file: an error instead of the built-in model and engine"
4+state: closed
5+author:
6+ name: k33g
7+ email: ph.charriere@gmail.com
8+createdAt: 2026-11-18T05:33:12.000Z
9+updatedAt: 2026-11-18T05:49:53.000Z
10+labels:
11+ - kind::feature
12+ - priority::medium
13+milestone: v1.1.1
14+epic: CLI
15+body: |
16+ ## Seen (user, 2026-11-18)
17+
18+ `mm` or `mm tui` started in a directory with no agent file runs
19+ anyway, with a built-in model on a built-in engine. It should stop with
20+ an error message instead.
21+
22+ ## Today (code read 2026-11-18)
23+
24+ - `config.Load` ([internal/config/config.go](internal/config/config.go))
25+ tries the command line, then `AGENT_CONFIG`, then `./agent.yaml`,
26+ then `./.mm/agent.yaml`. A file **named** (command line or
27+ `AGENT_CONFIG`) that does not exist is already an error. When none of
28+ the default places has a file, it returns `""` and no error: "the
29+ built-in defaults are enough to run" (comment in `Load`).
30+ - The defaults are `config.Cfg`: `provider: dmr`, `model:
31+ huggingface.co/jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M`.
32+ So a user without Docker Model Runner, or without that model, gets a
33+ start-up warning or a failing first turn, far from the real cause.
34+ - The banner says `config: built-in defaults`, and the CLI reference
35+ documents it ("Not an error: built-in defaults are used",
36+ [docs/en/reference/cli.md](docs/en/reference/cli.md), lookup table).
37+ - `main.go` calls `config.Load(*configPath)` once for every mode.
38+
39+ ## Expected
40+
41+ With no agent file found, `mm` (line mode) and `mm tui` print an
42+ error and exit with a non-zero code, saying where mm looked and how to
43+ get a file, e.g.:
44+
45+ ```text
46+ [config error: no agent file — looked for ./agent.yaml and ./.mm/agent.yaml (AGENT_CONFIG is not set).
47+ Create one with: mm init (or name one: mm <file>, AGENT_CONFIG=<file>)]
48+ ```
49+
50+ ## Scope to decide
51+
52+ - **`-p` (one prompt) and `--ask`**: same error? (Proposal: yes —
53+ a script should fail loudly too.)
54+ - **`mm acp`**: the editor starts it in the project directory; with no
55+ file, the error goes to the ACP log only and the editor shows a
56+ failed agent. Same rule, or keep a clearer message over ACP
57+ (e.g. answer `initialize` then say "no agent file — use
58+ `mm acp-create`" in the thread)? `mm acp-create` itself needs no
59+ file and must keep working.
60+ - **`AGENT_PROVIDER` + `AGENT_MODEL` set without a file**: still an
61+ error, or enough to run?
62+ - Commands that need no agent file must stay unaffected: `mm init`,
63+ `mm acp-create`, `mm skillcreate`, `mm dockerinit`, `mm sbxinit`,
64+ `--version`, `--help`.
65+ - Whether `config.Load` itself changes (it is also used by tests and
66+ by `agentinit.WriteFile`, which reloads the file it wrote) or only
67+ `main.go` refuses `path == ""` for the run modes. Proposal: keep
68+ `Load` as is, refuse in `main.go`.
69+
70+ ## To check before changing
71+
72+ - Docs that rely on running without a file: cli.md (lookup table, banner
73+ `config: built-in defaults`), architecture explanation, sandbox and
74+ skill-routing guides, the create-an-agent-from-an-editor guide (grep
75+ "built-in defaults" / "no config file" in docs/).
76+ - Demos, `testing/` benches and sandbox kits that start `mm`
77+ without a file (the kits' empty `config` argument falls back on
78+ `./agent.yaml`).
79+
80+ ## Acceptance criteria
81+
82+ - `mm` and `mm tui` in an empty directory: the error above on stderr,
83+ exit code 1, no model call, no window opened.
84+ - A named file that does not exist: unchanged (already an error).
85+ - The commands that need no file still work.
86+ - Tests (main-level or a helper), docs EN+FR (cli reference, upgrading
87+ note in the release notes: a breaking change for anyone who ran mm
88+ without a file).
89+tasks:
90+ - id: 1
91+ title: Decide the scope - -p, --ask, mm acp, AGENT_PROVIDER/AGENT_MODEL without a file
92+ state: closed
93+ priority: high
94+ author:
95+ name: k33g
96+ email: ph.charriere@gmail.com
97+ createdAt: 2026-11-18T05:33:12.000Z
98+ updatedAt: 2026-11-18T05:37:17.000Z
99+ closedAt: 2026-11-18T05:37:17.000Z
100+ - id: 2
101+ title: Refuse a missing agent file for the run modes, with where mm looked and how to get one (mm init)
102+ state: closed
103+ priority: high
104+ author:
105+ name: k33g
106+ email: ph.charriere@gmail.com
107+ createdAt: 2026-11-18T05:33:12.000Z
108+ updatedAt: 2026-11-18T05:37:17.000Z
109+ closedAt: 2026-11-18T05:37:17.000Z
110+ - id: 3
111+ title: Check demos, testing benches and sandbox kits that start mm without a file
112+ state: closed
113+ priority: medium
114+ author:
115+ name: k33g
116+ email: ph.charriere@gmail.com
117+ createdAt: 2026-11-18T05:33:12.000Z
118+ updatedAt: 2026-11-18T05:37:17.000Z
119+ closedAt: 2026-11-18T05:37:17.000Z
120+ - id: 4
121+ title: Tests - empty directory fails with exit 1; named missing file unchanged; init/acp-create/skillcreate/dockerinit/sbxinit unaffected
122+ state: closed
123+ priority: medium
124+ author:
125+ name: k33g
126+ email: ph.charriere@gmail.com
127+ createdAt: 2026-11-18T05:33:12.000Z
128+ updatedAt: 2026-11-18T05:37:17.000Z
129+ closedAt: 2026-11-18T05:37:17.000Z
130+ - id: 5
131+ title: Docs EN+FR - cli reference (lookup table, banner), explanation, guides that mention the built-in defaults
132+ state: closed
133+ priority: medium
134+ author:
135+ name: k33g
136+ email: ph.charriere@gmail.com
137+ createdAt: 2026-11-18T05:33:12.000Z
138+ updatedAt: 2026-11-18T05:37:17.000Z
139+ closedAt: 2026-11-18T05:37:17.000Z
140+comments:
141+ - id: 1
142+ author:
143+ name: k33g
144+ email: ph.charriere@gmail.com
145+ createdAt: 2026-11-18T05:37:17.000Z
146+ body: |
147+ User (2026-11-18): "ok vas y" — the proposals taken: the same error
148+ for every mode that talks to a model (line, tui, -p, --ask, acp),
149+ also when AGENT_PROVIDER / AGENT_MODEL are set; refused in main.go,
150+ `config.Load` unchanged (still returns "" with the defaults: tests
151+ and the wizards rely on it). Done on `feature/llamacpp-port-9931`
152+ (with #218, uncommitted).
153+
154+ - `main.go`: after `config.Load`, `path == ""` → `noAgentFile()` on
155+ stderr, exit 1. The "built-in defaults" banner label is gone.
156+ init, acp-create, skillcreate, dockerinit, sbxinit, --version,
157+ --about are answered before and still work.
158+ - Message: `[config error: no agent file in <dir> — looked for
159+ agent.yaml and .mm/agent.yaml (AGENT_CONFIG is not set).` then
160+ ` Create one with: mm init (or mm acp-create from an editor). Or
161+ name one: mm <file>, AGENT_CONFIG=<file> ]`.
162+ - Tests: `TestNoAgentFileStopsMM` runs the real main in a child
163+ process in an empty dir for `mm`, `mm tui`, `mm -p hello`,
164+ `mm acp` → exit 1, the error on stderr, nothing on stdout.
165+ Whole suite green, gofmt + vet clean. Built binary checked in an
166+ empty directory (exit 1) and `--version` (exit 0).
167+ - Scripts: none in the repo starts mm without a file. A sandbox kit
168+ started with no AGENT_CONFIG outside the project now stops with
169+ this error instead of running Mellum2 on dmr.
170+ - Docs EN+FR: cli reference (lookup table, row 4), sandbox guide.
171+
172+ Not checked: how Zed shows an `mm acp` that exits at start-up (the
173+ message is in the ACP log). Release notes must call it a breaking
174+ change.
175+ - id: 2
176+ author:
177+ name: k33g
178+ email: ph.charriere@gmail.com
179+ createdAt: 2026-11-18T05:49:53.000Z
180+ body: |
181+ Closed at the user's request (2026-11-18).
added .tickets/issues/0221-mm-init-llamacpp-as-the-default-server-instead-of.yaml +110 -0
new file mode 100644
@@ -0,0 +1,110 @@
1+# Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2+id: 221
3+title: "mm init: llamacpp as the default server instead of llmman"
4+state: closed
5+author:
6+ name: k33g
7+ email: ph.charriere@gmail.com
8+createdAt: 2026-11-18T05:36:03.000Z
9+updatedAt: 2026-11-18T05:44:05.000Z
10+labels:
11+ - kind::feature
12+ - priority::medium
13+milestone: v1.1.1
14+epic: Scaffolding
15+related:
16+ - 218
17+body: |
18+ ## Asked (user, 2026-11-18)
19+
20+ In `mm init`, the server proposed by default is `llmman`; it should
21+ be `llamacpp`.
22+
23+ ## Today (code read 2026-11-18)
24+
25+ - [internal/agentinit/wizard.go](internal/agentinit/wizard.go):
26+ `providers = [llmman, ollama, dmr, llamacpp, kronk, openai]` (the
27+ order the choices are shown) and `local = [llmman, ollama, dmr,
28+ llamacpp, kronk]` (the servers probed for the default).
29+ - `Flow.firstAnswering`
30+ ([internal/agentinit/flow.go](internal/agentinit/flow.go)): the
31+ default of the first question is the **first server of `local` that
32+ answers**, else `providers[0]` — llmman.
33+ - Same flow in `mm init` (line and window) and `mm acp-create`.
34+
35+ ## To decide
36+
37+ - **llamacpp always the default**, or **llamacpp first among those that
38+ answer** (put it first in `local`; when nothing answers, llamacpp
39+ too)? Proposal: first in both lists — a running llmman/Ollama is still
40+ proposed when llama-server is not running.
41+ - Also move it first in the list shown (`providers`)?
42+ - Since #218, llamacpp's local addresses are 9931 then 8080: the probe
43+ must try both (it goes through the wizard's address choice).
44+
45+ ## Acceptance criteria
46+
47+ - `mm init` with llama-server running: `llamacpp` is the default.
48+ - Nothing running: `llamacpp` is the default.
49+ - `mm acp-create` the same; the `--provider` flag unchanged.
50+ - Tests updated (the default and the list order); docs EN+FR that show
51+ the first question or say llmman is the default (create-an-agent,
52+ create-an-agent-from-an-editor, cli reference).
53+tasks:
54+ - id: 1
55+ title: Decide - always llamacpp, or first among the servers that answer; list order
56+ state: closed
57+ priority: high
58+ author:
59+ name: k33g
60+ email: ph.charriere@gmail.com
61+ createdAt: 2026-11-18T05:36:03.000Z
62+ updatedAt: 2026-11-18T05:39:30.000Z
63+ closedAt: 2026-11-18T05:39:30.000Z
64+ - id: 2
65+ title: Wizard - providers / local order, firstAnswering fallback
66+ state: closed
67+ priority: medium
68+ author:
69+ name: k33g
70+ email: ph.charriere@gmail.com
71+ createdAt: 2026-11-18T05:36:03.000Z
72+ updatedAt: 2026-11-18T05:39:30.000Z
73+ closedAt: 2026-11-18T05:39:30.000Z
74+ - id: 3
75+ title: Tests and docs EN+FR (create-an-agent, create-an-agent-from-an-editor, cli)
76+ state: closed
77+ priority: medium
78+ author:
79+ name: k33g
80+ email: ph.charriere@gmail.com
81+ createdAt: 2026-11-18T05:36:03.000Z
82+ updatedAt: 2026-11-18T05:39:30.000Z
83+ closedAt: 2026-11-18T05:39:30.000Z
84+comments:
85+ - id: 1
86+ author:
87+ name: k33g
88+ email: ph.charriere@gmail.com
89+ createdAt: 2026-11-18T05:39:30.000Z
90+ body: |
91+ User (2026-11-18): "llamacpp en premier" — first in both lists.
92+ Done on `feature/llamacpp-port-9931` (with #218 and #220,
93+ uncommitted).
94+
95+ - `providers = [llamacpp, llmman, ollama, dmr, kronk, openai]`,
96+ `local = [llamacpp, llmman, ollama, dmr, kronk]`: llamacpp is the
97+ default when llama-server answers (9931, then 8080 — #218) or when
98+ nothing answers; a running llmman / Ollama… is proposed when
99+ llama-server is not running. Same in mm acp-create (same flow).
100+ - Test `TestFirstAnsweringPrefersLlamacpp`; whole suite green.
101+ Built binary: `mm init --line` shows `1. llamacpp (default)`.
102+ - Docs EN+FR: cli reference (`--provider` row). No other doc named
103+ llmman as the default.
104+ - id: 2
105+ author:
106+ name: k33g
107+ email: ph.charriere@gmail.com
108+ createdAt: 2026-11-18T05:44:05.000Z
109+ body: |
110+ Closed at the user's request (2026-11-18).
new file mode 100644
@@ -0,0 +1,110 @@
1+# Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2+id: 221
3+title: "mm init: llamacpp as the default server instead of llmman"
4+state: closed
5+author:
6+ name: k33g
7+ email: ph.charriere@gmail.com
8+createdAt: 2026-11-18T05:36:03.000Z
9+updatedAt: 2026-11-18T05:44:05.000Z
10+labels:
11+ - kind::feature
12+ - priority::medium
13+milestone: v1.1.1
14+epic: Scaffolding
15+related:
16+ - 218
17+body: |
18+ ## Asked (user, 2026-11-18)
19+
20+ In `mm init`, the server proposed by default is `llmman`; it should
21+ be `llamacpp`.
22+
23+ ## Today (code read 2026-11-18)
24+
25+ - [internal/agentinit/wizard.go](internal/agentinit/wizard.go):
26+ `providers = [llmman, ollama, dmr, llamacpp, kronk, openai]` (the
27+ order the choices are shown) and `local = [llmman, ollama, dmr,
28+ llamacpp, kronk]` (the servers probed for the default).
29+ - `Flow.firstAnswering`
30+ ([internal/agentinit/flow.go](internal/agentinit/flow.go)): the
31+ default of the first question is the **first server of `local` that
32+ answers**, else `providers[0]` — llmman.
33+ - Same flow in `mm init` (line and window) and `mm acp-create`.
34+
35+ ## To decide
36+
37+ - **llamacpp always the default**, or **llamacpp first among those that
38+ answer** (put it first in `local`; when nothing answers, llamacpp
39+ too)? Proposal: first in both lists — a running llmman/Ollama is still
40+ proposed when llama-server is not running.
41+ - Also move it first in the list shown (`providers`)?
42+ - Since #218, llamacpp's local addresses are 9931 then 8080: the probe
43+ must try both (it goes through the wizard's address choice).
44+
45+ ## Acceptance criteria
46+
47+ - `mm init` with llama-server running: `llamacpp` is the default.
48+ - Nothing running: `llamacpp` is the default.
49+ - `mm acp-create` the same; the `--provider` flag unchanged.
50+ - Tests updated (the default and the list order); docs EN+FR that show
51+ the first question or say llmman is the default (create-an-agent,
52+ create-an-agent-from-an-editor, cli reference).
53+tasks:
54+ - id: 1
55+ title: Decide - always llamacpp, or first among the servers that answer; list order
56+ state: closed
57+ priority: high
58+ author:
59+ name: k33g
60+ email: ph.charriere@gmail.com
61+ createdAt: 2026-11-18T05:36:03.000Z
62+ updatedAt: 2026-11-18T05:39:30.000Z
63+ closedAt: 2026-11-18T05:39:30.000Z
64+ - id: 2
65+ title: Wizard - providers / local order, firstAnswering fallback
66+ state: closed
67+ priority: medium
68+ author:
69+ name: k33g
70+ email: ph.charriere@gmail.com
71+ createdAt: 2026-11-18T05:36:03.000Z
72+ updatedAt: 2026-11-18T05:39:30.000Z
73+ closedAt: 2026-11-18T05:39:30.000Z
74+ - id: 3
75+ title: Tests and docs EN+FR (create-an-agent, create-an-agent-from-an-editor, cli)
76+ state: closed
77+ priority: medium
78+ author:
79+ name: k33g
80+ email: ph.charriere@gmail.com
81+ createdAt: 2026-11-18T05:36:03.000Z
82+ updatedAt: 2026-11-18T05:39:30.000Z
83+ closedAt: 2026-11-18T05:39:30.000Z
84+comments:
85+ - id: 1
86+ author:
87+ name: k33g
88+ email: ph.charriere@gmail.com
89+ createdAt: 2026-11-18T05:39:30.000Z
90+ body: |
91+ User (2026-11-18): "llamacpp en premier" — first in both lists.
92+ Done on `feature/llamacpp-port-9931` (with #218 and #220,
93+ uncommitted).
94+
95+ - `providers = [llamacpp, llmman, ollama, dmr, kronk, openai]`,
96+ `local = [llamacpp, llmman, ollama, dmr, kronk]`: llamacpp is the
97+ default when llama-server answers (9931, then 8080 — #218) or when
98+ nothing answers; a running llmman / Ollama… is proposed when
99+ llama-server is not running. Same in mm acp-create (same flow).
100+ - Test `TestFirstAnsweringPrefersLlamacpp`; whole suite green.
101+ Built binary: `mm init --line` shows `1. llamacpp (default)`.
102+ - Docs EN+FR: cli reference (`--provider` row). No other doc named
103+ llmman as the default.
104+ - id: 2
105+ author:
106+ name: k33g
107+ email: ph.charriere@gmail.com
108+ createdAt: 2026-11-18T05:44:05.000Z
109+ body: |
110+ Closed at the user's request (2026-11-18).
modified .tickets/milestones.yaml +3 -0
@@ -69,3 +69,6 @@ milestones:
6969 state: closed
7070 description: Between v1.0.9 and v2.0.0
7171 dueOn: 2026-11-25
72+ - title: v1.1.1
73+ state: open
74+ dueOn: 2026-11-25
@@ -69,3 +69,6 @@ milestones:
69 state: closed69 state: closed
70 description: Between v1.0.9 and v2.0.070 description: Between v1.0.9 and v2.0.0
71 dueOn: 2026-11-2571 dueOn: 2026-11-25
72+ - title: v1.1.1
73+ state: open
74+ dueOn: 2026-11-25
modified agent.llamacpp.yaml +6 -3
@@ -6,11 +6,14 @@ provider: llamacpp
66
77 model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M
88
9-# llama-server's default is 127.0.0.1:8080; the OpenAI routes sit under /v1.
10-baseUrl: http://127.0.0.1:8080/v1
9+# llama-server's default is 127.0.0.1:9931 since llama.cpp b11521 (8080 before);
10+# the OpenAI routes sit under /v1. With this address, mm also tries
11+# http://127.0.0.1:8080/v1 when 9931 does not answer (an older llama-server,
12+# or one started with --port 8080).
13+baseUrl: http://127.0.0.1:9931/v1
1114
1215 # No fallback line: when baseUrl does not answer, mm tries llama-server on the
13-# host, http://host.docker.internal:8080/v1 — what mm in a container or a
16+# host, http://host.docker.internal:9931/v1 — what mm in a container or a
1417 # sandbox needs (start llama-server with --host 0.0.0.0 there). fallback: ""
1518 # turns that off.
1619
@@ -6,11 +6,14 @@ provider: llamacpp
6 6
7 model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M7 model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M
8 8
9-# llama-server's default is 127.0.0.1:8080; the OpenAI routes sit under /v1.9+# llama-server's default is 127.0.0.1:9931 since llama.cpp b11521 (8080 before);
10-baseUrl: http://127.0.0.1:8080/v110+# the OpenAI routes sit under /v1. With this address, mm also tries
11+# http://127.0.0.1:8080/v1 when 9931 does not answer (an older llama-server,
12+# or one started with --port 8080).
13+baseUrl: http://127.0.0.1:9931/v1
11 14
12 # No fallback line: when baseUrl does not answer, mm tries llama-server on the15 # No fallback line: when baseUrl does not answer, mm tries llama-server on the
13-# host, http://host.docker.internal:8080/v1 — what mm in a container or a16+# host, http://host.docker.internal:9931/v1 — what mm in a container or a
14 # sandbox needs (start llama-server with --host 0.0.0.0 there). fallback: ""17 # sandbox needs (start llama-server with --host 0.0.0.0 there). fallback: ""
15 # turns that off.18 # turns that off.
16 19
modified config.samples/agent.llamacpp.ornith.yaml +5 -2
@@ -9,8 +9,11 @@ provider: llamacpp
99 #model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M
1010 model: ornith-ai/Ornith-1.5-35B-A3B-GGUF:Q4_K_M
1111
12-# llama-server's default is 127.0.0.1:8080; the OpenAI routes sit under /v1.
13-baseUrl: http://127.0.0.1:8080/v1
12+# llama-server's default is 127.0.0.1:9931 since llama.cpp b11521 (8080 before);
13+# the OpenAI routes sit under /v1. With this address, mm also tries
14+# http://127.0.0.1:8080/v1 when 9931 does not answer (an older llama-server,
15+# or one started with --port 8080).
16+baseUrl: http://127.0.0.1:9931/v1
1417
1518 # No fallback: llama-server is wherever you started it.
1619 fallback: ""
@@ -9,8 +9,11 @@ provider: llamacpp
9 #model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M9 #model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M
10 model: ornith-ai/Ornith-1.5-35B-A3B-GGUF:Q4_K_M10 model: ornith-ai/Ornith-1.5-35B-A3B-GGUF:Q4_K_M
11 11
12-# llama-server's default is 127.0.0.1:8080; the OpenAI routes sit under /v1.12+# llama-server's default is 127.0.0.1:9931 since llama.cpp b11521 (8080 before);
13-baseUrl: http://127.0.0.1:8080/v113+# the OpenAI routes sit under /v1. With this address, mm also tries
14+# http://127.0.0.1:8080/v1 when 9931 does not answer (an older llama-server,
15+# or one started with --port 8080).
16+baseUrl: http://127.0.0.1:9931/v1
14 17
15 # No fallback: llama-server is wherever you started it.18 # No fallback: llama-server is wherever you started it.
16 fallback: ""19 fallback: ""
modified config.samples/agent.llamacpp.qwen3.8.yaml +5 -2
@@ -9,8 +9,11 @@ provider: llamacpp
99 #model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M
1010 model: unsloth/Qwen3.8-27B-GGUF:UD-Q4_K_M
1111
12-# llama-server's default is 127.0.0.1:8080; the OpenAI routes sit under /v1.
13-baseUrl: http://127.0.0.1:8080/v1
12+# llama-server's default is 127.0.0.1:9931 since llama.cpp b11521 (8080 before);
13+# the OpenAI routes sit under /v1. With this address, mm also tries
14+# http://127.0.0.1:8080/v1 when 9931 does not answer (an older llama-server,
15+# or one started with --port 8080).
16+baseUrl: http://127.0.0.1:9931/v1
1417
1518 # No fallback: llama-server is wherever you started it.
1619 fallback: ""
@@ -9,8 +9,11 @@ provider: llamacpp
9 #model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M9 #model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M
10 model: unsloth/Qwen3.8-27B-GGUF:UD-Q4_K_M10 model: unsloth/Qwen3.8-27B-GGUF:UD-Q4_K_M
11 11
12-# llama-server's default is 127.0.0.1:8080; the OpenAI routes sit under /v1.12+# llama-server's default is 127.0.0.1:9931 since llama.cpp b11521 (8080 before);
13-baseUrl: http://127.0.0.1:8080/v113+# the OpenAI routes sit under /v1. With this address, mm also tries
14+# http://127.0.0.1:8080/v1 when 9931 does not answer (an older llama-server,
15+# or one started with --port 8080).
16+baseUrl: http://127.0.0.1:9931/v1
14 17
15 # No fallback: llama-server is wherever you started it.18 # No fallback: llama-server is wherever you started it.
16 fallback: ""19 fallback: ""
modified docs/en/how-to/run-in-a-docker-sandbox.md +3 -3
@@ -176,7 +176,7 @@ additionalWorkspaces:
176176
177177 - `.mm/` is read-only in the sandbox: the agent cannot change its settings, skills or hooks.
178178 - The folders mm writes in are writable again, read from the agent file: `sessions.dir` when the sessions are on, `trace.dir` when the trace is on. Their paths are the agent file's, so a mount and a setting cannot disagree.
179-- No `AGENT_CONFIG`: the file always names the latest kit, and from `mini-me-kit:0.1.5` on the kit ships mm 1.0.7 or later, which finds `.mm/agent.yaml` on its own when it starts in the workspace. The commands take no argument: `sbx env create --force`, `sbx env run --force`. If the banner says `config: built-in defaults`, the kit started mm elsewhere: add `env: {AGENT_CONFIG: <absolute path of .mm/agent.yaml>}` (the workspace is mounted at the same path as on your machine).
179+- No `AGENT_CONFIG`: the file always names the latest kit, and from `mini-me-kit:0.1.5` on the kit ships mm 1.0.7 or later, which finds `.mm/agent.yaml` on its own when it starts in the workspace. The commands take no argument: `sbx env create --force`, `sbx env run --force`. If mm stops with `no agent file` (before v1.1.1: the banner says `config: built-in defaults`), the kit started mm elsewhere: add `env: {AGENT_CONFIG: <absolute path of .mm/agent.yaml>}` (the workspace is mounted at the same path as on your machine).
180180 - Every path is relative to the folder of `sbxenv.yaml`, as sbx reads them: the file does not depend on where the project is, and can be committed.
181181
182182 Anything else written under `.mm/` needs a line of its own — a hook that keeps a log there, for instance: with `onError: ignore`, it would fail without a word. After changing the agent's sessions or trace, run `mm sbxinit` again (answer `yes` to replace the file), then re-create the sandbox: `sbx env rm --force`, then `sbx env create --force` — a sandbox keeps the mounts it was created with. A file written by `mm sbxinit` 1.0.7 sets `args.PROJECT_DIR` and `AGENT_CONFIG`: with a kit of 0.1.5 or later you can remove both, as the current version does.
@@ -203,10 +203,10 @@ Inside a sandbox `localhost` is the sandbox itself. Your model server keeps runn
203203
204204 - The `mini-me` kit's network policy allows **`host.docker.internal:12434`** (Docker Model Runner), **`:11434`** (Ollama) and **`:17434`** (llmman). `agent.dmr.yaml` already falls back to `http://host.docker.internal:12434/engines/v1`; the configurations shipped in `demos/use-with-sbx/` use llmman (`fallback: http://host.docker.internal:17434/v1`).
205205 - Kronk (`:11435`) is not in that list: allow `localhost:11435` in the policy, and start Kronk on the host with `--api-host 0.0.0.0:11435` — it listens on the loopback only otherwise. See [How to run mini-me on Kronk](run-with-kronk.md).
206-- For another port — llama-server's `8080`, for instance, which mm tries on its own (`http://host.docker.internal:8080/v1`) when started on the host with `--host 0.0.0.0` — add it to the kit's `network-policy` capability, or allow it for one sandbox:
206+- For another port — llama-server's `9931`, for instance, which mm tries on its own (`http://host.docker.internal:9931/v1`) when started on the host with `--host 0.0.0.0` — add it to the kit's `network-policy` capability, or allow it for one sandbox:
207207
208208 ```bash
209- sbx policy allow network host.docker.internal:8080
209+ sbx policy allow network host.docker.internal:9931
210210 ```
211211
212212 `sbx policy log` shows what was blocked.
@@ -176,7 +176,7 @@ additionalWorkspaces:
176 176
177 - `.mm/` is read-only in the sandbox: the agent cannot change its settings, skills or hooks.177 - `.mm/` is read-only in the sandbox: the agent cannot change its settings, skills or hooks.
178 - The folders mm writes in are writable again, read from the agent file: `sessions.dir` when the sessions are on, `trace.dir` when the trace is on. Their paths are the agent file's, so a mount and a setting cannot disagree.178 - The folders mm writes in are writable again, read from the agent file: `sessions.dir` when the sessions are on, `trace.dir` when the trace is on. Their paths are the agent file's, so a mount and a setting cannot disagree.
179-- No `AGENT_CONFIG`: the file always names the latest kit, and from `mini-me-kit:0.1.5` on the kit ships mm 1.0.7 or later, which finds `.mm/agent.yaml` on its own when it starts in the workspace. The commands take no argument: `sbx env create --force`, `sbx env run --force`. If the banner says `config: built-in defaults`, the kit started mm elsewhere: add `env: {AGENT_CONFIG: <absolute path of .mm/agent.yaml>}` (the workspace is mounted at the same path as on your machine).179+- No `AGENT_CONFIG`: the file always names the latest kit, and from `mini-me-kit:0.1.5` on the kit ships mm 1.0.7 or later, which finds `.mm/agent.yaml` on its own when it starts in the workspace. The commands take no argument: `sbx env create --force`, `sbx env run --force`. If mm stops with `no agent file` (before v1.1.1: the banner says `config: built-in defaults`), the kit started mm elsewhere: add `env: {AGENT_CONFIG: <absolute path of .mm/agent.yaml>}` (the workspace is mounted at the same path as on your machine).
180 - Every path is relative to the folder of `sbxenv.yaml`, as sbx reads them: the file does not depend on where the project is, and can be committed.180 - Every path is relative to the folder of `sbxenv.yaml`, as sbx reads them: the file does not depend on where the project is, and can be committed.
181 181
182 Anything else written under `.mm/` needs a line of its own — a hook that keeps a log there, for instance: with `onError: ignore`, it would fail without a word. After changing the agent's sessions or trace, run `mm sbxinit` again (answer `yes` to replace the file), then re-create the sandbox: `sbx env rm --force`, then `sbx env create --force` — a sandbox keeps the mounts it was created with. A file written by `mm sbxinit` 1.0.7 sets `args.PROJECT_DIR` and `AGENT_CONFIG`: with a kit of 0.1.5 or later you can remove both, as the current version does.182 Anything else written under `.mm/` needs a line of its own — a hook that keeps a log there, for instance: with `onError: ignore`, it would fail without a word. After changing the agent's sessions or trace, run `mm sbxinit` again (answer `yes` to replace the file), then re-create the sandbox: `sbx env rm --force`, then `sbx env create --force` — a sandbox keeps the mounts it was created with. A file written by `mm sbxinit` 1.0.7 sets `args.PROJECT_DIR` and `AGENT_CONFIG`: with a kit of 0.1.5 or later you can remove both, as the current version does.
@@ -203,10 +203,10 @@ Inside a sandbox `localhost` is the sandbox itself. Your model server keeps runn
203 203
204 - The `mini-me` kit's network policy allows **`host.docker.internal:12434`** (Docker Model Runner), **`:11434`** (Ollama) and **`:17434`** (llmman). `agent.dmr.yaml` already falls back to `http://host.docker.internal:12434/engines/v1`; the configurations shipped in `demos/use-with-sbx/` use llmman (`fallback: http://host.docker.internal:17434/v1`).204 - The `mini-me` kit's network policy allows **`host.docker.internal:12434`** (Docker Model Runner), **`:11434`** (Ollama) and **`:17434`** (llmman). `agent.dmr.yaml` already falls back to `http://host.docker.internal:12434/engines/v1`; the configurations shipped in `demos/use-with-sbx/` use llmman (`fallback: http://host.docker.internal:17434/v1`).
205 - Kronk (`:11435`) is not in that list: allow `localhost:11435` in the policy, and start Kronk on the host with `--api-host 0.0.0.0:11435` — it listens on the loopback only otherwise. See [How to run mini-me on Kronk](run-with-kronk.md).205 - Kronk (`:11435`) is not in that list: allow `localhost:11435` in the policy, and start Kronk on the host with `--api-host 0.0.0.0:11435` — it listens on the loopback only otherwise. See [How to run mini-me on Kronk](run-with-kronk.md).
206-- For another port — llama-server's `8080`, for instance, which mm tries on its own (`http://host.docker.internal:8080/v1`) when started on the host with `--host 0.0.0.0` — add it to the kit's `network-policy` capability, or allow it for one sandbox:206+- For another port — llama-server's `9931`, for instance, which mm tries on its own (`http://host.docker.internal:9931/v1`) when started on the host with `--host 0.0.0.0` — add it to the kit's `network-policy` capability, or allow it for one sandbox:
207 207
208 ```bash208 ```bash
209- sbx policy allow network host.docker.internal:8080209+ sbx policy allow network host.docker.internal:9931
210 ```210 ```
211 211
212 `sbx policy log` shows what was blocked.212 `sbx policy log` shows what was blocked.
modified docs/en/how-to/run-with-llama-cpp.md +5 -2
@@ -9,9 +9,11 @@ This guide shows how to point `mm` at a `llama-server` you start yourself. It as
99 ```bash
1010 llama-server -hf jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M \
1111 -a jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M \
12- --jinja -c 32768 --port 8080
12+ --jinja -c 32768
1313 ```
1414
15+ llama-server listens on `127.0.0.1:9931` since llama.cpp b11521 (2026-10-09); older builds and the official Docker images use `8080`. mm tries both: `9931` first, then `8080` (see Variants).
16+
1517 2. Use the shipped llama.cpp configuration file. Its `model:` key must match the `-a` alias above:
1618
1719 ```bash
@@ -22,8 +24,9 @@ This guide shows how to point `mm` at a `llama-server` you start yourself. It as
2224
2325 ## Variants
2426
27+- **llama-server on 8080.** An older build, the official Docker image or a server started with `--port 8080`: nothing to set. When `baseUrl` is llama-server's default (`http://127.0.0.1:9931/v1`, or no `baseUrl` at all) and does not answer, mm tries `http://127.0.0.1:8080/v1` before the container address. `mm init` and `mm acp-create` list the models from whichever answers.
2528 - **Different port or host.** Set `baseUrl` in the YAML to `http://<host>:<port>/v1`, or override it for one run with `AGENT_BASE_URL=http://<host>:<port>/v1 ./mm agent.llamacpp.yaml`. An environment override is taken as-is, without the fallback probe.
26-- **From a container or a Docker Sandbox.** When `baseUrl` does not answer, mm tries `http://host.docker.internal:8080/v1`, llama-server on the host. Start it there with `--host 0.0.0.0`: by default it listens on the loopback only, which a container on Linux or a sandbox cannot reach. In a sandbox, also allow the port: `sbx policy allow network host.docker.internal:8080`. `fallback: ""` turns the fallback off. See [run mini-me in a container](run-in-a-container.md) and [run mini-me in a Docker Sandbox](run-in-a-docker-sandbox.md).
29+- **From a container or a Docker Sandbox.** When `baseUrl` does not answer, mm tries `http://host.docker.internal:9931/v1`, llama-server on the host (a llama-server on `8080` there needs `baseUrl: http://host.docker.internal:8080/v1`). Start it there with `--host 0.0.0.0`: by default it listens on the loopback only, which a container on Linux or a sandbox cannot reach. In a sandbox, also allow the port: `sbx policy allow network host.docker.internal:9931`. `fallback: ""` turns the fallback off. See [run mini-me in a container](run-in-a-container.md) and [run mini-me in a Docker Sandbox](run-in-a-docker-sandbox.md).
2730 - **`autoPull: true`.** llama-server cannot download a model over its API: it serves the one it was started with. `-hf <repo>:<quant>` (step 1) is what downloads it. With `autoPull` on and a `model:` the server does not list, mm says so at start-up and goes on. See [`autoPull`](../reference/configuration.md).
2831 - **Server started with `--api-key`.** Export the key in `LLAMA_API_KEY` (the provider's default variable) or name another variable under `apiKeyEnv`. The key itself never goes in the YAML.
2932 - **Keep `agent.yaml` and switch provider for one run.** `AGENT_PROVIDER=llamacpp ./mm` works as long as `agent.yaml` leaves `baseUrl` empty; an explicit DMR URL in the file would still be honoured and point at port 12434.
@@ -9,9 +9,11 @@ This guide shows how to point `mm` at a `llama-server` you start yourself. It as
9 ```bash9 ```bash
10 llama-server -hf jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M \10 llama-server -hf jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M \
11 -a jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M \11 -a jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M \
12- --jinja -c 32768 --port 808012+ --jinja -c 32768
13 ```13 ```
14 14
15+ llama-server listens on `127.0.0.1:9931` since llama.cpp b11521 (2026-10-09); older builds and the official Docker images use `8080`. mm tries both: `9931` first, then `8080` (see Variants).
16+
15 2. Use the shipped llama.cpp configuration file. Its `model:` key must match the `-a` alias above:17 2. Use the shipped llama.cpp configuration file. Its `model:` key must match the `-a` alias above:
16 18
17 ```bash19 ```bash
@@ -22,8 +24,9 @@ This guide shows how to point `mm` at a `llama-server` you start yourself. It as
22 24
23 ## Variants25 ## Variants
24 26
27+- **llama-server on 8080.** An older build, the official Docker image or a server started with `--port 8080`: nothing to set. When `baseUrl` is llama-server's default (`http://127.0.0.1:9931/v1`, or no `baseUrl` at all) and does not answer, mm tries `http://127.0.0.1:8080/v1` before the container address. `mm init` and `mm acp-create` list the models from whichever answers.
25 - **Different port or host.** Set `baseUrl` in the YAML to `http://<host>:<port>/v1`, or override it for one run with `AGENT_BASE_URL=http://<host>:<port>/v1 ./mm agent.llamacpp.yaml`. An environment override is taken as-is, without the fallback probe.28 - **Different port or host.** Set `baseUrl` in the YAML to `http://<host>:<port>/v1`, or override it for one run with `AGENT_BASE_URL=http://<host>:<port>/v1 ./mm agent.llamacpp.yaml`. An environment override is taken as-is, without the fallback probe.
26-- **From a container or a Docker Sandbox.** When `baseUrl` does not answer, mm tries `http://host.docker.internal:8080/v1`, llama-server on the host. Start it there with `--host 0.0.0.0`: by default it listens on the loopback only, which a container on Linux or a sandbox cannot reach. In a sandbox, also allow the port: `sbx policy allow network host.docker.internal:8080`. `fallback: ""` turns the fallback off. See [run mini-me in a container](run-in-a-container.md) and [run mini-me in a Docker Sandbox](run-in-a-docker-sandbox.md).29+- **From a container or a Docker Sandbox.** When `baseUrl` does not answer, mm tries `http://host.docker.internal:9931/v1`, llama-server on the host (a llama-server on `8080` there needs `baseUrl: http://host.docker.internal:8080/v1`). Start it there with `--host 0.0.0.0`: by default it listens on the loopback only, which a container on Linux or a sandbox cannot reach. In a sandbox, also allow the port: `sbx policy allow network host.docker.internal:9931`. `fallback: ""` turns the fallback off. See [run mini-me in a container](run-in-a-container.md) and [run mini-me in a Docker Sandbox](run-in-a-docker-sandbox.md).
27 - **`autoPull: true`.** llama-server cannot download a model over its API: it serves the one it was started with. `-hf <repo>:<quant>` (step 1) is what downloads it. With `autoPull` on and a `model:` the server does not list, mm says so at start-up and goes on. See [`autoPull`](../reference/configuration.md).30 - **`autoPull: true`.** llama-server cannot download a model over its API: it serves the one it was started with. `-hf <repo>:<quant>` (step 1) is what downloads it. With `autoPull` on and a `model:` the server does not list, mm says so at start-up and goes on. See [`autoPull`](../reference/configuration.md).
28 - **Server started with `--api-key`.** Export the key in `LLAMA_API_KEY` (the provider's default variable) or name another variable under `apiKeyEnv`. The key itself never goes in the YAML.31 - **Server started with `--api-key`.** Export the key in `LLAMA_API_KEY` (the provider's default variable) or name another variable under `apiKeyEnv`. The key itself never goes in the YAML.
29 - **Keep `agent.yaml` and switch provider for one run.** `AGENT_PROVIDER=llamacpp ./mm` works as long as `agent.yaml` leaves `baseUrl` empty; an explicit DMR URL in the file would still be honoured and point at port 12434.32 - **Keep `agent.yaml` and switch provider for one run.** `AGENT_PROVIDER=llamacpp ./mm` works as long as `agent.yaml` leaves `baseUrl` empty; an explicit DMR URL in the file would still be honoured and point at port 12434.
modified docs/en/how-to/verify-tool-order.md +1 -1
@@ -120,7 +120,7 @@ The change touches every request, so check once that ordinary use still works wi
120120
121121 ## Variants
122122
123-- **llama-server**: start the proxy with `--upstream http://localhost:8080`, and build the configuration from `agent.llamacpp.yaml` with `baseUrl: http://127.0.0.1:18770/v1`.
123+- **llama-server**: start the proxy with `--upstream http://localhost:9931` (`8080` for a llama-server older than b11521), and build the configuration from `agent.llamacpp.yaml` with `baseUrl: http://127.0.0.1:18770/v1`.
124124 - **`mm` or the server in a container**: use `--upstream http://host.docker.internal:12434` for a Docker Model Runner on the host.
125125 - **Another model**: the prompt sizes change, the pattern should not. The numbers above are an example, not a target.
126126
@@ -120,7 +120,7 @@ The change touches every request, so check once that ordinary use still works wi
120 120
121 ## Variants121 ## Variants
122 122
123-- **llama-server**: start the proxy with `--upstream http://localhost:8080`, and build the configuration from `agent.llamacpp.yaml` with `baseUrl: http://127.0.0.1:18770/v1`.123+- **llama-server**: start the proxy with `--upstream http://localhost:9931` (`8080` for a llama-server older than b11521), and build the configuration from `agent.llamacpp.yaml` with `baseUrl: http://127.0.0.1:18770/v1`.
124 - **`mm` or the server in a container**: use `--upstream http://host.docker.internal:12434` for a Docker Model Runner on the host.124 - **`mm` or the server in a container**: use `--upstream http://host.docker.internal:12434` for a Docker Model Runner on the host.
125 - **Another model**: the prompt sizes change, the pattern should not. The numbers above are an example, not a target.125 - **Another model**: the prompt sizes change, the pattern should not. The numbers above are an example, not a target.
126 126
modified docs/en/reference/cli.md +4 -4
@@ -56,7 +56,7 @@ The first existing source wins.
5656 | 1 | `-config` flag or positional argument | Error, exit code 1 |
5757 | 2 | `AGENT_CONFIG` environment variable | Error, exit code 1 |
5858 | 3 | `./agent.yaml` | Next source |
59-| 4 | `./.mm/agent.yaml` | Not an error: built-in defaults are used, the banner shows `config: built-in defaults` |
59+| 4 | `./.mm/agent.yaml` | Error, exit code 1: `[config error: no agent file in <dir> — looked for agent.yaml and .mm/agent.yaml (AGENT_CONFIG is not set).` followed by how to create one (`mm init`, `mm acp-create`) or name one. In every mode that talks to a model (line, `tui`, `-p`, `--ask`, `acp`); `mm init`, `mm acp-create`, `mm skillcreate`, `mm dockerinit`, `mm sbxinit`, `--version` and `--about` need no agent file. Before v1.1.1, mm ran with built-in defaults (`dmr`, Mellum2) |
6060
6161 When both `./agent.yaml` and `./.mm/agent.yaml` exist, `./agent.yaml` is used.
6262
@@ -104,7 +104,7 @@ Printed on stdout in terminal mode, on stderr in ACP mode. Dimmed when stdout is
104104 ### Example
105105
106106 ```
107-[warning: llamacpp: nothing answers at http://host.docker.internal:8080/v1 — start it: llama-server -m <model.gguf> --jinja --port 8080 (add --host 0.0.0.0 when mm runs in a container or a sandbox)]
107+[warning: llamacpp: nothing answers at http://host.docker.internal:9931/v1 — start it: llama-server -m <model.gguf> --jinja --port 9931 (add --host 0.0.0.0 when mm runs in a container or a sandbox)]
108108 mm v0.1.7 | config: agent.llamacpp.yaml | provider: llamacpp | model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M | ctx: unknown | tools: bash, read_file, write_file, edit_file | skills: 0 | yolo: on
109109 ```
110110
@@ -239,8 +239,8 @@ An agent file outside the workspace only gives a warning: see [when the agent fi
239239 | Flag | Question when absent | Default |
240240 |------|----------------------|---------|
241241 | `--project yes\|no` | Keep everything in a `.mm` folder? — asked first. `yes`: the file is `.mm/agent.yaml` (the folder is created), its paths are written from the project root (`skillsDir: .mm/skills`), and `mm` / `mm tui` started there find it with no argument | `no` |
242-| `--provider` | Model server: `llmman`, `ollama`, `dmr`, `llamacpp`, `kronk`, `openai` | the first local one whose server answers, else `llmman` (`openai` is never probed: its default address is the OpenAI API) |
243-| `--base-url` | `openai` only: Endpoint — the service's OpenAI-compatible address (OpenAI, Cerebras, Hugging Face…); for the other providers, not asked | `https://api.openai.com/v1` for `openai`; otherwise `AGENT_BASE_URL` when set, else the first of the provider's local addresses whose model list answers — its default, then the same with `127.0.0.1` when the default names `localhost` — and its container fallback (`host.docker.internal`) only when none does. The model question names the address its list comes from (`Model? (listed from …)`). Written as `baseUrl` unless it is the default |
242+| `--provider` | Model server: `llamacpp`, `llmman`, `ollama`, `dmr`, `kronk`, `openai` | the first local one whose server answers, in that order (`llamacpp` on 9931, then 8080), else `llamacpp` (`openai` is never probed: its default address is the OpenAI API) |
243+| `--base-url` | `openai` only: Endpoint — the service's OpenAI-compatible address (OpenAI, Cerebras, Hugging Face…); for the other providers, not asked | `https://api.openai.com/v1` for `openai`; otherwise `AGENT_BASE_URL` when set, else the first of the provider's local addresses whose model list answers — its default, then the same with `127.0.0.1` when the default names `localhost`, then for `llamacpp` llama-server's former port, `http://127.0.0.1:8080/v1` — and its container fallback (`host.docker.internal`) only when none does. The model question names the address its list comes from (`Model? (listed from …)`). Written as `baseUrl` unless it is the default |
244244 | `--api-key-env` | `openai` only: Environment variable that holds the API key | `OPENAI_API_KEY`. Written as `apiKeyEnv` unless it is the default |
245245 | `--model` | Model: a list of the server's models (`/api/tags` for llmman and Ollama, `/models` for the others; 5 s for a local server, 20 s for `openai`), or a name to type when there is no list — the question says why (`<VARIABLE> is not set: no list`, or the server's error). For `openai` the list is asked with the key read from the variable named above, and not asked at all when that variable is empty | the first of the list |
246246 | `--family` | Model family | detected from the model's name, then from the server's family name |
@@ -56,7 +56,7 @@ The first existing source wins.
56 | 1 | `-config` flag or positional argument | Error, exit code 1 |56 | 1 | `-config` flag or positional argument | Error, exit code 1 |
57 | 2 | `AGENT_CONFIG` environment variable | Error, exit code 1 |57 | 2 | `AGENT_CONFIG` environment variable | Error, exit code 1 |
58 | 3 | `./agent.yaml` | Next source |58 | 3 | `./agent.yaml` | Next source |
59-| 4 | `./.mm/agent.yaml` | Not an error: built-in defaults are used, the banner shows `config: built-in defaults` |59+| 4 | `./.mm/agent.yaml` | Error, exit code 1: `[config error: no agent file in <dir> — looked for agent.yaml and .mm/agent.yaml (AGENT_CONFIG is not set).` followed by how to create one (`mm init`, `mm acp-create`) or name one. In every mode that talks to a model (line, `tui`, `-p`, `--ask`, `acp`); `mm init`, `mm acp-create`, `mm skillcreate`, `mm dockerinit`, `mm sbxinit`, `--version` and `--about` need no agent file. Before v1.1.1, mm ran with built-in defaults (`dmr`, Mellum2) |
60 60
61 When both `./agent.yaml` and `./.mm/agent.yaml` exist, `./agent.yaml` is used.61 When both `./agent.yaml` and `./.mm/agent.yaml` exist, `./agent.yaml` is used.
62 62
@@ -104,7 +104,7 @@ Printed on stdout in terminal mode, on stderr in ACP mode. Dimmed when stdout is
104 ### Example104 ### Example
105 105
106 ```106 ```
107-[warning: llamacpp: nothing answers at http://host.docker.internal:8080/v1 — start it: llama-server -m <model.gguf> --jinja --port 8080 (add --host 0.0.0.0 when mm runs in a container or a sandbox)]107+[warning: llamacpp: nothing answers at http://host.docker.internal:9931/v1 — start it: llama-server -m <model.gguf> --jinja --port 9931 (add --host 0.0.0.0 when mm runs in a container or a sandbox)]
108 mm v0.1.7 | config: agent.llamacpp.yaml | provider: llamacpp | model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M | ctx: unknown | tools: bash, read_file, write_file, edit_file | skills: 0 | yolo: on108 mm v0.1.7 | config: agent.llamacpp.yaml | provider: llamacpp | model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M | ctx: unknown | tools: bash, read_file, write_file, edit_file | skills: 0 | yolo: on
109 ```109 ```
110 110
@@ -239,8 +239,8 @@ An agent file outside the workspace only gives a warning: see [when the agent fi
239 | Flag | Question when absent | Default |239 | Flag | Question when absent | Default |
240 |------|----------------------|---------|240 |------|----------------------|---------|
241 | `--project yes\|no` | Keep everything in a `.mm` folder? — asked first. `yes`: the file is `.mm/agent.yaml` (the folder is created), its paths are written from the project root (`skillsDir: .mm/skills`), and `mm` / `mm tui` started there find it with no argument | `no` |241 | `--project yes\|no` | Keep everything in a `.mm` folder? — asked first. `yes`: the file is `.mm/agent.yaml` (the folder is created), its paths are written from the project root (`skillsDir: .mm/skills`), and `mm` / `mm tui` started there find it with no argument | `no` |
242-| `--provider` | Model server: `llmman`, `ollama`, `dmr`, `llamacpp`, `kronk`, `openai` | the first local one whose server answers, else `llmman` (`openai` is never probed: its default address is the OpenAI API) |242+| `--provider` | Model server: `llamacpp`, `llmman`, `ollama`, `dmr`, `kronk`, `openai` | the first local one whose server answers, in that order (`llamacpp` on 9931, then 8080), else `llamacpp` (`openai` is never probed: its default address is the OpenAI API) |
243-| `--base-url` | `openai` only: Endpoint — the service's OpenAI-compatible address (OpenAI, Cerebras, Hugging Face…); for the other providers, not asked | `https://api.openai.com/v1` for `openai`; otherwise `AGENT_BASE_URL` when set, else the first of the provider's local addresses whose model list answers — its default, then the same with `127.0.0.1` when the default names `localhost` — and its container fallback (`host.docker.internal`) only when none does. The model question names the address its list comes from (`Model? (listed from …)`). Written as `baseUrl` unless it is the default |243+| `--base-url` | `openai` only: Endpoint — the service's OpenAI-compatible address (OpenAI, Cerebras, Hugging Face…); for the other providers, not asked | `https://api.openai.com/v1` for `openai`; otherwise `AGENT_BASE_URL` when set, else the first of the provider's local addresses whose model list answers — its default, then the same with `127.0.0.1` when the default names `localhost`, then for `llamacpp` llama-server's former port, `http://127.0.0.1:8080/v1` — and its container fallback (`host.docker.internal`) only when none does. The model question names the address its list comes from (`Model? (listed from …)`). Written as `baseUrl` unless it is the default |
244 | `--api-key-env` | `openai` only: Environment variable that holds the API key | `OPENAI_API_KEY`. Written as `apiKeyEnv` unless it is the default |244 | `--api-key-env` | `openai` only: Environment variable that holds the API key | `OPENAI_API_KEY`. Written as `apiKeyEnv` unless it is the default |
245 | `--model` | Model: a list of the server's models (`/api/tags` for llmman and Ollama, `/models` for the others; 5 s for a local server, 20 s for `openai`), or a name to type when there is no list — the question says why (`<VARIABLE> is not set: no list`, or the server's error). For `openai` the list is asked with the key read from the variable named above, and not asked at all when that variable is empty | the first of the list |245 | `--model` | Model: a list of the server's models (`/api/tags` for llmman and Ollama, `/models` for the others; 5 s for a local server, 20 s for `openai`), or a name to type when there is no list — the question says why (`<VARIABLE> is not set: no list`, or the server's error). For `openai` the list is asked with the key read from the variable named above, and not asked at all when that variable is empty | the first of the list |
246 | `--family` | Model family | detected from the model's name, then from the server's family name |246 | `--family` | Model family | detected from the model's name, then from the server's family name |
modified docs/en/reference/configuration.md +5 -3
@@ -197,12 +197,14 @@ tools:
197197 | Provider | `baseUrl` | `fallback` | `apiKeyEnv` | Key required |
198198 |----------|-----------|------------|-------------|--------------|
199199 | `dmr` | `http://localhost:12434/engines/v1` | `http://host.docker.internal:12434/engines/v1` | none | no |
200-| `llamacpp` | `http://127.0.0.1:8080/v1` | `http://host.docker.internal:8080/v1` | `LLAMA_API_KEY` | no |
200+| `llamacpp` | `http://127.0.0.1:9931/v1` (then `http://127.0.0.1:8080/v1`) | `http://host.docker.internal:9931/v1` | `LLAMA_API_KEY` | no |
201201 | `llmman` | `http://127.0.0.1:17434/v1` | `http://host.docker.internal:17434/v1` | `LLMMAN_API_KEY` | no |
202202 | `ollama` | `http://localhost:11434/v1` | `http://host.docker.internal:11434/v1` | `OLLAMA_API_KEY` | no |
203203 | `kronk` | `http://127.0.0.1:11435/v1` | `http://host.docker.internal:11435/v1` | `KRONK_TOKEN` | no — only Kronk's `authenticated` and `full-protected` modes check it |
204204 | `openai` | `https://api.openai.com/v1` | none | `OPENAI_API_KEY` | no — a server that needs one answers 401, and the start-up warning names the variable |
205205
206+`llamacpp`: llama-server's default port is `9931` since llama.cpp b11521 (2026-10-09), `8080` before and in the official Docker images. When the address in use is `http://127.0.0.1:9931/v1` (no `baseUrl`, or that one) and it does not answer, mm tries `http://127.0.0.1:8080/v1`, then the `fallback`.
207+
206208 The `openai` provider sends only standard fields: no `return_progress` (so no prompt-reading progress while a long prompt is read), no reasoning switch on a summary request, no `/unload`. It cannot ask the server for its window: set `contextWindow`, or compression counts messages (`context.maxMessages`). Its start-up probe sends the key to `GET /models`; a 401 or 403 is reported as a refused key, not as a server that does not answer.
207209
208210 ## `structuredOutput`
@@ -477,14 +479,14 @@ A start-up warning, not an error, is printed when `context.enabled` is `true`, t
477479 | File | Purpose |
478480 |------|---------|
479481 | `agent.yaml` | Docker Model Runner set-up: `provider: dmr`, `maxTurns: 40`, `displayCommands: true`, compression off, a system prompt named "Bob" that describes the skills and file-editing rules. |
480-| `agent.llamacpp.yaml` | llama.cpp set-up: `provider: llamacpp`, `baseUrl: http://127.0.0.1:8080/v1`, compression on. |
482+| `agent.llamacpp.yaml` | llama.cpp set-up: `provider: llamacpp`, `baseUrl: http://127.0.0.1:9931/v1`, compression on. |
481483
482484 ### Example
483485
484486 ```yaml
485487 provider: llamacpp
486488 model: my-alias
487-baseUrl: http://127.0.0.1:8080/v1
489+baseUrl: http://127.0.0.1:9931/v1
488490 fallback: ""
489491 maxTurns: 40
490492 context:
@@ -197,12 +197,14 @@ tools:
197 | Provider | `baseUrl` | `fallback` | `apiKeyEnv` | Key required |197 | Provider | `baseUrl` | `fallback` | `apiKeyEnv` | Key required |
198 |----------|-----------|------------|-------------|--------------|198 |----------|-----------|------------|-------------|--------------|
199 | `dmr` | `http://localhost:12434/engines/v1` | `http://host.docker.internal:12434/engines/v1` | none | no |199 | `dmr` | `http://localhost:12434/engines/v1` | `http://host.docker.internal:12434/engines/v1` | none | no |
200-| `llamacpp` | `http://127.0.0.1:8080/v1` | `http://host.docker.internal:8080/v1` | `LLAMA_API_KEY` | no |200+| `llamacpp` | `http://127.0.0.1:9931/v1` (then `http://127.0.0.1:8080/v1`) | `http://host.docker.internal:9931/v1` | `LLAMA_API_KEY` | no |
201 | `llmman` | `http://127.0.0.1:17434/v1` | `http://host.docker.internal:17434/v1` | `LLMMAN_API_KEY` | no |201 | `llmman` | `http://127.0.0.1:17434/v1` | `http://host.docker.internal:17434/v1` | `LLMMAN_API_KEY` | no |
202 | `ollama` | `http://localhost:11434/v1` | `http://host.docker.internal:11434/v1` | `OLLAMA_API_KEY` | no |202 | `ollama` | `http://localhost:11434/v1` | `http://host.docker.internal:11434/v1` | `OLLAMA_API_KEY` | no |
203 | `kronk` | `http://127.0.0.1:11435/v1` | `http://host.docker.internal:11435/v1` | `KRONK_TOKEN` | no — only Kronk's `authenticated` and `full-protected` modes check it |203 | `kronk` | `http://127.0.0.1:11435/v1` | `http://host.docker.internal:11435/v1` | `KRONK_TOKEN` | no — only Kronk's `authenticated` and `full-protected` modes check it |
204 | `openai` | `https://api.openai.com/v1` | none | `OPENAI_API_KEY` | no — a server that needs one answers 401, and the start-up warning names the variable |204 | `openai` | `https://api.openai.com/v1` | none | `OPENAI_API_KEY` | no — a server that needs one answers 401, and the start-up warning names the variable |
205 205
206+`llamacpp`: llama-server's default port is `9931` since llama.cpp b11521 (2026-10-09), `8080` before and in the official Docker images. When the address in use is `http://127.0.0.1:9931/v1` (no `baseUrl`, or that one) and it does not answer, mm tries `http://127.0.0.1:8080/v1`, then the `fallback`.
207+
206 The `openai` provider sends only standard fields: no `return_progress` (so no prompt-reading progress while a long prompt is read), no reasoning switch on a summary request, no `/unload`. It cannot ask the server for its window: set `contextWindow`, or compression counts messages (`context.maxMessages`). Its start-up probe sends the key to `GET /models`; a 401 or 403 is reported as a refused key, not as a server that does not answer.208 The `openai` provider sends only standard fields: no `return_progress` (so no prompt-reading progress while a long prompt is read), no reasoning switch on a summary request, no `/unload`. It cannot ask the server for its window: set `contextWindow`, or compression counts messages (`context.maxMessages`). Its start-up probe sends the key to `GET /models`; a 401 or 403 is reported as a refused key, not as a server that does not answer.
207 209
208 ## `structuredOutput`210 ## `structuredOutput`
@@ -477,14 +479,14 @@ A start-up warning, not an error, is printed when `context.enabled` is `true`, t
477 | File | Purpose |479 | File | Purpose |
478 |------|---------|480 |------|---------|
479 | `agent.yaml` | Docker Model Runner set-up: `provider: dmr`, `maxTurns: 40`, `displayCommands: true`, compression off, a system prompt named "Bob" that describes the skills and file-editing rules. |481 | `agent.yaml` | Docker Model Runner set-up: `provider: dmr`, `maxTurns: 40`, `displayCommands: true`, compression off, a system prompt named "Bob" that describes the skills and file-editing rules. |
480-| `agent.llamacpp.yaml` | llama.cpp set-up: `provider: llamacpp`, `baseUrl: http://127.0.0.1:8080/v1`, compression on. |482+| `agent.llamacpp.yaml` | llama.cpp set-up: `provider: llamacpp`, `baseUrl: http://127.0.0.1:9931/v1`, compression on. |
481 483
482 ### Example484 ### Example
483 485
484 ```yaml486 ```yaml
485 provider: llamacpp487 provider: llamacpp
486 model: my-alias488 model: my-alias
487-baseUrl: http://127.0.0.1:8080/v1489+baseUrl: http://127.0.0.1:9931/v1
488 fallback: ""490 fallback: ""
489 maxTurns: 40491 maxTurns: 40
490 context:492 context:
modified docs/en/reference/mcp-configuration.md +5 -3
@@ -78,10 +78,12 @@ The shipped `agent.lsp.yaml` is `agent.dmr.yaml` with this block on (gopls activ
7878 | Provider | `baseUrl` | `fallback` | `apiKeyEnv` | Key required |
7979 |----------|-----------|------------|-------------|--------------|
8080 | `dmr` | `http://localhost:12434/engines/v1` | `http://host.docker.internal:12434/engines/v1` | none | no |
81-| `llamacpp` | `http://127.0.0.1:8080/v1` | `http://host.docker.internal:8080/v1` | `LLAMA_API_KEY` | no |
81+| `llamacpp` | `http://127.0.0.1:9931/v1` (then `http://127.0.0.1:8080/v1`) | `http://host.docker.internal:9931/v1` | `LLAMA_API_KEY` | no |
8282 | `llmman` | `http://127.0.0.1:17434/v1` | `http://host.docker.internal:17434/v1` | `LLMMAN_API_KEY` | no |
8383 | `ollama` | `http://localhost:11434/v1` | `http://host.docker.internal:11434/v1` | `OLLAMA_API_KEY` | no |
8484
85+`llamacpp`: llama-server's default port is `9931` since llama.cpp b11521 (2026-10-09), `8080` before and in the official Docker images. When the address in use is `http://127.0.0.1:9931/v1` (no `baseUrl`, or that one) and it does not answer, mm tries `http://127.0.0.1:8080/v1`, then the `fallback`.
86+
8587 ## Validation errors
8688
8789 Reported as `[config error: <path>: <message>]`, exit code 1.
@@ -114,14 +116,14 @@ A start-up warning, not an error, is printed when `context.enabled` is `true`, t
114116 | File | Purpose |
115117 |------|---------|
116118 | `agent.yaml` | Docker Model Runner set-up: `provider: dmr`, `maxTurns: 40`, `displayCommands: true`, compression off, a system prompt named "Bob" that describes the skills and file-editing rules. |
117-| `agent.llamacpp.yaml` | llama.cpp set-up: `provider: llamacpp`, `baseUrl: http://127.0.0.1:8080/v1`, compression on. |
119+| `agent.llamacpp.yaml` | llama.cpp set-up: `provider: llamacpp`, `baseUrl: http://127.0.0.1:9931/v1`, compression on. |
118120
119121 ### Example
120122
121123 ```yaml
122124 provider: llamacpp
123125 model: my-alias
124-baseUrl: http://127.0.0.1:8080/v1
126+baseUrl: http://127.0.0.1:9931/v1
125127 fallback: ""
126128 maxTurns: 40
127129 context:
@@ -78,10 +78,12 @@ The shipped `agent.lsp.yaml` is `agent.dmr.yaml` with this block on (gopls activ
78 | Provider | `baseUrl` | `fallback` | `apiKeyEnv` | Key required |78 | Provider | `baseUrl` | `fallback` | `apiKeyEnv` | Key required |
79 |----------|-----------|------------|-------------|--------------|79 |----------|-----------|------------|-------------|--------------|
80 | `dmr` | `http://localhost:12434/engines/v1` | `http://host.docker.internal:12434/engines/v1` | none | no |80 | `dmr` | `http://localhost:12434/engines/v1` | `http://host.docker.internal:12434/engines/v1` | none | no |
81-| `llamacpp` | `http://127.0.0.1:8080/v1` | `http://host.docker.internal:8080/v1` | `LLAMA_API_KEY` | no |81+| `llamacpp` | `http://127.0.0.1:9931/v1` (then `http://127.0.0.1:8080/v1`) | `http://host.docker.internal:9931/v1` | `LLAMA_API_KEY` | no |
82 | `llmman` | `http://127.0.0.1:17434/v1` | `http://host.docker.internal:17434/v1` | `LLMMAN_API_KEY` | no |82 | `llmman` | `http://127.0.0.1:17434/v1` | `http://host.docker.internal:17434/v1` | `LLMMAN_API_KEY` | no |
83 | `ollama` | `http://localhost:11434/v1` | `http://host.docker.internal:11434/v1` | `OLLAMA_API_KEY` | no |83 | `ollama` | `http://localhost:11434/v1` | `http://host.docker.internal:11434/v1` | `OLLAMA_API_KEY` | no |
84 84
85+`llamacpp`: llama-server's default port is `9931` since llama.cpp b11521 (2026-10-09), `8080` before and in the official Docker images. When the address in use is `http://127.0.0.1:9931/v1` (no `baseUrl`, or that one) and it does not answer, mm tries `http://127.0.0.1:8080/v1`, then the `fallback`.
86+
85 ## Validation errors87 ## Validation errors
86 88
87 Reported as `[config error: <path>: <message>]`, exit code 1.89 Reported as `[config error: <path>: <message>]`, exit code 1.
@@ -114,14 +116,14 @@ A start-up warning, not an error, is printed when `context.enabled` is `true`, t
114 | File | Purpose |116 | File | Purpose |
115 |------|---------|117 |------|---------|
116 | `agent.yaml` | Docker Model Runner set-up: `provider: dmr`, `maxTurns: 40`, `displayCommands: true`, compression off, a system prompt named "Bob" that describes the skills and file-editing rules. |118 | `agent.yaml` | Docker Model Runner set-up: `provider: dmr`, `maxTurns: 40`, `displayCommands: true`, compression off, a system prompt named "Bob" that describes the skills and file-editing rules. |
117-| `agent.llamacpp.yaml` | llama.cpp set-up: `provider: llamacpp`, `baseUrl: http://127.0.0.1:8080/v1`, compression on. |119+| `agent.llamacpp.yaml` | llama.cpp set-up: `provider: llamacpp`, `baseUrl: http://127.0.0.1:9931/v1`, compression on. |
118 120
119 ### Example121 ### Example
120 122
121 ```yaml123 ```yaml
122 provider: llamacpp124 provider: llamacpp
123 model: my-alias125 model: my-alias
124-baseUrl: http://127.0.0.1:8080/v1126+baseUrl: http://127.0.0.1:9931/v1
125 fallback: ""127 fallback: ""
126 maxTurns: 40128 maxTurns: 40
127 context:129 context:
modified docs/fr/how-to/run-in-a-docker-sandbox.md +3 -3
@@ -176,7 +176,7 @@ additionalWorkspaces:
176176
177177 - `.mm/` est en lecture seule dans la sandbox : l'agent ne peut modifier ni ses réglages, ni ses skills, ni ses hooks.
178178 - Les dossiers où mm écrit redeviennent inscriptibles, lus dans le fichier d'agent : `sessions.dir` quand les sessions sont activées, `trace.dir` quand la trace l'est. Leurs chemins sont ceux du fichier d'agent : un montage et un réglage ne peuvent pas diverger.
179-- Pas d'`AGENT_CONFIG` : le fichier désigne toujours le dernier kit, et à partir de `mini-me-kit:0.1.5` le kit embarque mm 1.0.7 ou plus récent, qui trouve `.mm/agent.yaml` tout seul quand il démarre dans le workspace. Les commandes ne prennent aucun argument : `sbx env create --force`, `sbx env run --force`. Si la bannière affiche `config: built-in defaults`, le kit a lancé mm ailleurs : ajoutez `env: {AGENT_CONFIG: <chemin absolu de .mm/agent.yaml>}` (le workspace est monté au même chemin que sur votre machine).
179+- Pas d'`AGENT_CONFIG` : le fichier désigne toujours le dernier kit, et à partir de `mini-me-kit:0.1.5` le kit embarque mm 1.0.7 ou plus récent, qui trouve `.mm/agent.yaml` tout seul quand il démarre dans le workspace. Les commandes ne prennent aucun argument : `sbx env create --force`, `sbx env run --force`. Si mm s'arrête sur `no agent file` (avant la v1.1.1 : la bannière affiche `config: built-in defaults`), le kit a lancé mm ailleurs : ajoutez `env: {AGENT_CONFIG: <chemin absolu de .mm/agent.yaml>}` (le workspace est monté au même chemin que sur votre machine).
180180 - Tous les chemins sont relatifs au dossier de `sbxenv.yaml`, comme sbx les lit : le fichier ne dépend pas de l'endroit où se trouve le projet, et peut être commité.
181181
182182 Tout ce qui est écrit d'autre sous `.mm/` demande sa propre ligne — un hook qui y tient un journal, par exemple : avec `onError: ignore`, il échouerait sans rien dire. Après avoir changé les sessions ou la trace de l'agent, relancez `mm sbxinit` (répondez `yes` pour remplacer le fichier), puis recréez la sandbox : `sbx env rm --force`, puis `sbx env create --force` — une sandbox garde les montages de sa création. Un fichier écrit par `mm sbxinit` 1.0.7 fixe `args.PROJECT_DIR` et `AGENT_CONFIG` : avec un kit 0.1.5 ou plus récent, vous pouvez retirer les deux, comme le fait la version actuelle.
@@ -203,10 +203,10 @@ Dans un sandbox, `localhost` est le sandbox lui-même. Votre serveur de modèles
203203
204204 - La politique réseau du kit `mini-me` autorise **`host.docker.internal:12434`** (Docker Model Runner), **`:11434`** (Ollama) et **`:17434`** (llmman). `agent.dmr.yaml` se replie déjà sur `http://host.docker.internal:12434/engines/v1` ; les configurations livrées dans `demos/use-with-sbx/` utilisent llmman (`fallback: http://host.docker.internal:17434/v1`).
205205 - Kronk (`:11435`) n'est pas dans cette liste : autorisez `localhost:11435` dans la politique, et lancez Kronk sur l'hôte avec `--api-host 0.0.0.0:11435` — sinon il n'écoute que sur la boucle locale. Voir [Faire tourner mini-me sur Kronk](run-with-kronk.md).
206-- Pour un autre port — le `8080` de llama-server, par exemple, que mm essaie de lui-même (`http://host.docker.internal:8080/v1`) quand il est lancé sur l'hôte avec `--host 0.0.0.0` — ajoutez-le à la capacité `network-policy` du kit, ou autorisez-le pour un seul sandbox :
206+- Pour un autre port — le `9931` de llama-server, par exemple, que mm essaie de lui-même (`http://host.docker.internal:9931/v1`) quand il est lancé sur l'hôte avec `--host 0.0.0.0` — ajoutez-le à la capacité `network-policy` du kit, ou autorisez-le pour un seul sandbox :
207207
208208 ```bash
209- sbx policy allow network host.docker.internal:8080
209+ sbx policy allow network host.docker.internal:9931
210210 ```
211211
212212 `sbx policy log` montre ce qui a été bloqué.
@@ -176,7 +176,7 @@ additionalWorkspaces:
176 176
177 - `.mm/` est en lecture seule dans la sandbox : l'agent ne peut modifier ni ses réglages, ni ses skills, ni ses hooks.177 - `.mm/` est en lecture seule dans la sandbox : l'agent ne peut modifier ni ses réglages, ni ses skills, ni ses hooks.
178 - Les dossiers où mm écrit redeviennent inscriptibles, lus dans le fichier d'agent : `sessions.dir` quand les sessions sont activées, `trace.dir` quand la trace l'est. Leurs chemins sont ceux du fichier d'agent : un montage et un réglage ne peuvent pas diverger.178 - Les dossiers où mm écrit redeviennent inscriptibles, lus dans le fichier d'agent : `sessions.dir` quand les sessions sont activées, `trace.dir` quand la trace l'est. Leurs chemins sont ceux du fichier d'agent : un montage et un réglage ne peuvent pas diverger.
179-- Pas d'`AGENT_CONFIG` : le fichier désigne toujours le dernier kit, et à partir de `mini-me-kit:0.1.5` le kit embarque mm 1.0.7 ou plus récent, qui trouve `.mm/agent.yaml` tout seul quand il démarre dans le workspace. Les commandes ne prennent aucun argument : `sbx env create --force`, `sbx env run --force`. Si la bannière affiche `config: built-in defaults`, le kit a lancé mm ailleurs : ajoutez `env: {AGENT_CONFIG: <chemin absolu de .mm/agent.yaml>}` (le workspace est monté au même chemin que sur votre machine).179+- Pas d'`AGENT_CONFIG` : le fichier désigne toujours le dernier kit, et à partir de `mini-me-kit:0.1.5` le kit embarque mm 1.0.7 ou plus récent, qui trouve `.mm/agent.yaml` tout seul quand il démarre dans le workspace. Les commandes ne prennent aucun argument : `sbx env create --force`, `sbx env run --force`. Si mm s'arrête sur `no agent file` (avant la v1.1.1 : la bannière affiche `config: built-in defaults`), le kit a lancé mm ailleurs : ajoutez `env: {AGENT_CONFIG: <chemin absolu de .mm/agent.yaml>}` (le workspace est monté au même chemin que sur votre machine).
180 - Tous les chemins sont relatifs au dossier de `sbxenv.yaml`, comme sbx les lit : le fichier ne dépend pas de l'endroit où se trouve le projet, et peut être commité.180 - Tous les chemins sont relatifs au dossier de `sbxenv.yaml`, comme sbx les lit : le fichier ne dépend pas de l'endroit où se trouve le projet, et peut être commité.
181 181
182 Tout ce qui est écrit d'autre sous `.mm/` demande sa propre ligne — un hook qui y tient un journal, par exemple : avec `onError: ignore`, il échouerait sans rien dire. Après avoir changé les sessions ou la trace de l'agent, relancez `mm sbxinit` (répondez `yes` pour remplacer le fichier), puis recréez la sandbox : `sbx env rm --force`, puis `sbx env create --force` — une sandbox garde les montages de sa création. Un fichier écrit par `mm sbxinit` 1.0.7 fixe `args.PROJECT_DIR` et `AGENT_CONFIG` : avec un kit 0.1.5 ou plus récent, vous pouvez retirer les deux, comme le fait la version actuelle.182 Tout ce qui est écrit d'autre sous `.mm/` demande sa propre ligne — un hook qui y tient un journal, par exemple : avec `onError: ignore`, il échouerait sans rien dire. Après avoir changé les sessions ou la trace de l'agent, relancez `mm sbxinit` (répondez `yes` pour remplacer le fichier), puis recréez la sandbox : `sbx env rm --force`, puis `sbx env create --force` — une sandbox garde les montages de sa création. Un fichier écrit par `mm sbxinit` 1.0.7 fixe `args.PROJECT_DIR` et `AGENT_CONFIG` : avec un kit 0.1.5 ou plus récent, vous pouvez retirer les deux, comme le fait la version actuelle.
@@ -203,10 +203,10 @@ Dans un sandbox, `localhost` est le sandbox lui-même. Votre serveur de modèles
203 203
204 - La politique réseau du kit `mini-me` autorise **`host.docker.internal:12434`** (Docker Model Runner), **`:11434`** (Ollama) et **`:17434`** (llmman). `agent.dmr.yaml` se replie déjà sur `http://host.docker.internal:12434/engines/v1` ; les configurations livrées dans `demos/use-with-sbx/` utilisent llmman (`fallback: http://host.docker.internal:17434/v1`).204 - La politique réseau du kit `mini-me` autorise **`host.docker.internal:12434`** (Docker Model Runner), **`:11434`** (Ollama) et **`:17434`** (llmman). `agent.dmr.yaml` se replie déjà sur `http://host.docker.internal:12434/engines/v1` ; les configurations livrées dans `demos/use-with-sbx/` utilisent llmman (`fallback: http://host.docker.internal:17434/v1`).
205 - Kronk (`:11435`) n'est pas dans cette liste : autorisez `localhost:11435` dans la politique, et lancez Kronk sur l'hôte avec `--api-host 0.0.0.0:11435` — sinon il n'écoute que sur la boucle locale. Voir [Faire tourner mini-me sur Kronk](run-with-kronk.md).205 - Kronk (`:11435`) n'est pas dans cette liste : autorisez `localhost:11435` dans la politique, et lancez Kronk sur l'hôte avec `--api-host 0.0.0.0:11435` — sinon il n'écoute que sur la boucle locale. Voir [Faire tourner mini-me sur Kronk](run-with-kronk.md).
206-- Pour un autre port — le `8080` de llama-server, par exemple, que mm essaie de lui-même (`http://host.docker.internal:8080/v1`) quand il est lancé sur l'hôte avec `--host 0.0.0.0` — ajoutez-le à la capacité `network-policy` du kit, ou autorisez-le pour un seul sandbox :206+- Pour un autre port — le `9931` de llama-server, par exemple, que mm essaie de lui-même (`http://host.docker.internal:9931/v1`) quand il est lancé sur l'hôte avec `--host 0.0.0.0` — ajoutez-le à la capacité `network-policy` du kit, ou autorisez-le pour un seul sandbox :
207 207
208 ```bash208 ```bash
209- sbx policy allow network host.docker.internal:8080209+ sbx policy allow network host.docker.internal:9931
210 ```210 ```
211 211
212 `sbx policy log` montre ce qui a été bloqué.212 `sbx policy log` montre ce qui a été bloqué.
modified docs/fr/how-to/run-with-llama-cpp.md +5 -2
@@ -9,9 +9,11 @@ Ce guide montre comment pointer `mm` vers un `llama-server` que vous démarrez v
99 ```bash
1010 llama-server -hf jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M \
1111 -a jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M \
12- --jinja -c 32768 --port 8080
12+ --jinja -c 32768
1313 ```
1414
15+ llama-server écoute sur `127.0.0.1:9931` depuis llama.cpp b11521 (2026-10-09) ; les builds plus anciennes et les images Docker officielles utilisent `8080`. mm essaie les deux : `9931` d'abord, puis `8080` (voir Variantes).
16+
1517 2. Utilisez le fichier de configuration llama.cpp livré. Sa clé `model:` doit correspondre à l'alias `-a` ci-dessus :
1618
1719 ```bash
@@ -22,8 +24,9 @@ Ce guide montre comment pointer `mm` vers un `llama-server` que vous démarrez v
2224
2325 ## Variantes
2426
27+- **llama-server sur 8080.** Une build plus ancienne, l'image Docker officielle ou un serveur lancé avec `--port 8080` : rien à régler. Quand `baseUrl` est l'adresse par défaut de llama-server (`http://127.0.0.1:9931/v1`, ou pas de `baseUrl` du tout) et ne répond pas, mm essaie `http://127.0.0.1:8080/v1` avant l'adresse du conteneur. `mm init` et `mm acp-create` listent les modèles depuis celle qui répond.
2528 - **Autre port ou autre hôte.** Mettez `baseUrl` à `http://<hôte>:<port>/v1` dans le YAML, ou surchargez pour une seule exécution avec `AGENT_BASE_URL=http://<hôte>:<port>/v1 ./mm agent.llamacpp.yaml`. Une surcharge par l'environnement est prise telle quelle, sans sonde de repli.
26-- **Depuis un conteneur ou un Docker Sandbox.** Quand `baseUrl` ne répond pas, mm essaie `http://host.docker.internal:8080/v1`, llama-server sur l'hôte. Lancez-le avec `--host 0.0.0.0` : par défaut il n'écoute que sur la boucle locale, qu'un conteneur sous Linux ou un sandbox ne peuvent pas joindre. Dans un sandbox, autorisez aussi le port : `sbx policy allow network host.docker.internal:8080`. `fallback: ""` coupe le repli. Voir [faire tourner mini-me dans un conteneur](run-in-a-container.md) et [faire tourner mini-me dans un Docker Sandbox](run-in-a-docker-sandbox.md).
29+- **Depuis un conteneur ou un Docker Sandbox.** Quand `baseUrl` ne répond pas, mm essaie `http://host.docker.internal:9931/v1`, llama-server sur l'hôte (un llama-server sur `8080` y demande `baseUrl: http://host.docker.internal:8080/v1`). Lancez-le avec `--host 0.0.0.0` : par défaut il n'écoute que sur la boucle locale, qu'un conteneur sous Linux ou un sandbox ne peuvent pas joindre. Dans un sandbox, autorisez aussi le port : `sbx policy allow network host.docker.internal:9931`. `fallback: ""` coupe le repli. Voir [faire tourner mini-me dans un conteneur](run-in-a-container.md) et [faire tourner mini-me dans un Docker Sandbox](run-in-a-docker-sandbox.md).
2730 - **`autoPull: true`.** llama-server ne sait pas télécharger un modèle par son API : il sert celui avec lequel il a été lancé. C'est `-hf <dépôt>:<quant>` (étape 1) qui le télécharge. Avec `autoPull` actif et un `model:` que le serveur ne liste pas, mm le dit au démarrage et continue. Voir [`autoPull`](../reference/configuration.md).
2831 - **Serveur démarré avec `--api-key`.** Exportez la clé dans `LLAMA_API_KEY` (la variable par défaut du fournisseur) ou nommez une autre variable dans `apiKeyEnv`. La clé elle-même ne va jamais dans le YAML.
2932 - **Garder `agent.yaml` et changer de fournisseur pour une exécution.** `AGENT_PROVIDER=llamacpp ./mm` fonctionne tant qu'`agent.yaml` laisse `baseUrl` vide ; une URL DMR explicite dans le fichier serait respectée et pointerait toujours sur le port 12434.
@@ -9,9 +9,11 @@ Ce guide montre comment pointer `mm` vers un `llama-server` que vous démarrez v
9 ```bash9 ```bash
10 llama-server -hf jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M \10 llama-server -hf jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M \
11 -a jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M \11 -a jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M \
12- --jinja -c 32768 --port 808012+ --jinja -c 32768
13 ```13 ```
14 14
15+ llama-server écoute sur `127.0.0.1:9931` depuis llama.cpp b11521 (2026-10-09) ; les builds plus anciennes et les images Docker officielles utilisent `8080`. mm essaie les deux : `9931` d'abord, puis `8080` (voir Variantes).
16+
15 2. Utilisez le fichier de configuration llama.cpp livré. Sa clé `model:` doit correspondre à l'alias `-a` ci-dessus :17 2. Utilisez le fichier de configuration llama.cpp livré. Sa clé `model:` doit correspondre à l'alias `-a` ci-dessus :
16 18
17 ```bash19 ```bash
@@ -22,8 +24,9 @@ Ce guide montre comment pointer `mm` vers un `llama-server` que vous démarrez v
22 24
23 ## Variantes25 ## Variantes
24 26
27+- **llama-server sur 8080.** Une build plus ancienne, l'image Docker officielle ou un serveur lancé avec `--port 8080` : rien à régler. Quand `baseUrl` est l'adresse par défaut de llama-server (`http://127.0.0.1:9931/v1`, ou pas de `baseUrl` du tout) et ne répond pas, mm essaie `http://127.0.0.1:8080/v1` avant l'adresse du conteneur. `mm init` et `mm acp-create` listent les modèles depuis celle qui répond.
25 - **Autre port ou autre hôte.** Mettez `baseUrl` à `http://<hôte>:<port>/v1` dans le YAML, ou surchargez pour une seule exécution avec `AGENT_BASE_URL=http://<hôte>:<port>/v1 ./mm agent.llamacpp.yaml`. Une surcharge par l'environnement est prise telle quelle, sans sonde de repli.28 - **Autre port ou autre hôte.** Mettez `baseUrl` à `http://<hôte>:<port>/v1` dans le YAML, ou surchargez pour une seule exécution avec `AGENT_BASE_URL=http://<hôte>:<port>/v1 ./mm agent.llamacpp.yaml`. Une surcharge par l'environnement est prise telle quelle, sans sonde de repli.
26-- **Depuis un conteneur ou un Docker Sandbox.** Quand `baseUrl` ne répond pas, mm essaie `http://host.docker.internal:8080/v1`, llama-server sur l'hôte. Lancez-le avec `--host 0.0.0.0` : par défaut il n'écoute que sur la boucle locale, qu'un conteneur sous Linux ou un sandbox ne peuvent pas joindre. Dans un sandbox, autorisez aussi le port : `sbx policy allow network host.docker.internal:8080`. `fallback: ""` coupe le repli. Voir [faire tourner mini-me dans un conteneur](run-in-a-container.md) et [faire tourner mini-me dans un Docker Sandbox](run-in-a-docker-sandbox.md).29+- **Depuis un conteneur ou un Docker Sandbox.** Quand `baseUrl` ne répond pas, mm essaie `http://host.docker.internal:9931/v1`, llama-server sur l'hôte (un llama-server sur `8080` y demande `baseUrl: http://host.docker.internal:8080/v1`). Lancez-le avec `--host 0.0.0.0` : par défaut il n'écoute que sur la boucle locale, qu'un conteneur sous Linux ou un sandbox ne peuvent pas joindre. Dans un sandbox, autorisez aussi le port : `sbx policy allow network host.docker.internal:9931`. `fallback: ""` coupe le repli. Voir [faire tourner mini-me dans un conteneur](run-in-a-container.md) et [faire tourner mini-me dans un Docker Sandbox](run-in-a-docker-sandbox.md).
27 - **`autoPull: true`.** llama-server ne sait pas télécharger un modèle par son API : il sert celui avec lequel il a été lancé. C'est `-hf <dépôt>:<quant>` (étape 1) qui le télécharge. Avec `autoPull` actif et un `model:` que le serveur ne liste pas, mm le dit au démarrage et continue. Voir [`autoPull`](../reference/configuration.md).30 - **`autoPull: true`.** llama-server ne sait pas télécharger un modèle par son API : il sert celui avec lequel il a été lancé. C'est `-hf <dépôt>:<quant>` (étape 1) qui le télécharge. Avec `autoPull` actif et un `model:` que le serveur ne liste pas, mm le dit au démarrage et continue. Voir [`autoPull`](../reference/configuration.md).
28 - **Serveur démarré avec `--api-key`.** Exportez la clé dans `LLAMA_API_KEY` (la variable par défaut du fournisseur) ou nommez une autre variable dans `apiKeyEnv`. La clé elle-même ne va jamais dans le YAML.31 - **Serveur démarré avec `--api-key`.** Exportez la clé dans `LLAMA_API_KEY` (la variable par défaut du fournisseur) ou nommez une autre variable dans `apiKeyEnv`. La clé elle-même ne va jamais dans le YAML.
29 - **Garder `agent.yaml` et changer de fournisseur pour une exécution.** `AGENT_PROVIDER=llamacpp ./mm` fonctionne tant qu'`agent.yaml` laisse `baseUrl` vide ; une URL DMR explicite dans le fichier serait respectée et pointerait toujours sur le port 12434.32 - **Garder `agent.yaml` et changer de fournisseur pour une exécution.** `AGENT_PROVIDER=llamacpp ./mm` fonctionne tant qu'`agent.yaml` laisse `baseUrl` vide ; une URL DMR explicite dans le fichier serait respectée et pointerait toujours sur le port 12434.
modified docs/fr/how-to/verify-tool-order.md +1 -1
@@ -120,7 +120,7 @@ La modification touche toutes les requêtes : vérifiez une fois que l'usage ord
120120
121121 ## Variantes
122122
123-- **llama-server** : lancez le proxy avec `--upstream http://localhost:8080`, et partez de `agent.llamacpp.yaml` avec `baseUrl: http://127.0.0.1:18770/v1`.
123+- **llama-server** : lancez le proxy avec `--upstream http://localhost:9931` (`8080` pour un llama-server antérieur à b11521), et partez de `agent.llamacpp.yaml` avec `baseUrl: http://127.0.0.1:18770/v1`.
124124 - **`mm` ou le serveur dans un conteneur** : utilisez `--upstream http://host.docker.internal:12434` pour un Docker Model Runner sur l'hôte.
125125 - **Un autre modèle** : la taille des prompts change, pas le schéma. Les chiffres ci-dessus sont un exemple, pas un objectif.
126126
@@ -120,7 +120,7 @@ La modification touche toutes les requêtes : vérifiez une fois que l'usage ord
120 120
121 ## Variantes121 ## Variantes
122 122
123-- **llama-server** : lancez le proxy avec `--upstream http://localhost:8080`, et partez de `agent.llamacpp.yaml` avec `baseUrl: http://127.0.0.1:18770/v1`.123+- **llama-server** : lancez le proxy avec `--upstream http://localhost:9931` (`8080` pour un llama-server antérieur à b11521), et partez de `agent.llamacpp.yaml` avec `baseUrl: http://127.0.0.1:18770/v1`.
124 - **`mm` ou le serveur dans un conteneur** : utilisez `--upstream http://host.docker.internal:12434` pour un Docker Model Runner sur l'hôte.124 - **`mm` ou le serveur dans un conteneur** : utilisez `--upstream http://host.docker.internal:12434` pour un Docker Model Runner sur l'hôte.
125 - **Un autre modèle** : la taille des prompts change, pas le schéma. Les chiffres ci-dessus sont un exemple, pas un objectif.125 - **Un autre modèle** : la taille des prompts change, pas le schéma. Les chiffres ci-dessus sont un exemple, pas un objectif.
126 126
modified docs/fr/reference/cli.md +4 -4
@@ -56,7 +56,7 @@ La première source existante gagne.
5656 | 1 | Option `-config` ou argument positionnel | Erreur, code de sortie 1 |
5757 | 2 | Variable d'environnement `AGENT_CONFIG` | Erreur, code de sortie 1 |
5858 | 3 | `./agent.yaml` | Source suivante |
59-| 4 | `./.mm/agent.yaml` | Pas une erreur : les valeurs par défaut intégrées sont utilisées, la bannière affiche `config: built-in defaults` |
59+| 4 | `./.mm/agent.yaml` | Erreur, code de sortie 1 : `[config error: no agent file in <dossier> — looked for agent.yaml and .mm/agent.yaml (AGENT_CONFIG is not set).` suivi de la façon d'en créer un (`mm init`, `mm acp-create`) ou d'en nommer un. Dans tous les modes qui parlent à un modèle (ligne, `tui`, `-p`, `--ask`, `acp`) ; `mm init`, `mm acp-create`, `mm skillcreate`, `mm dockerinit`, `mm sbxinit`, `--version` et `--about` n'ont pas besoin de fichier d'agent. Avant la v1.1.1, mm tournait avec des valeurs par défaut intégrées (`dmr`, Mellum2) |
6060
6161 Quand `./agent.yaml` et `./.mm/agent.yaml` existent tous les deux, c'est `./agent.yaml` qui est utilisé.
6262
@@ -104,7 +104,7 @@ Affichée sur stdout en mode terminal, sur stderr en mode ACP. Grisée quand std
104104 ### Exemple
105105
106106 ```
107-[warning: llamacpp: nothing answers at http://host.docker.internal:8080/v1 — start it: llama-server -m <model.gguf> --jinja --port 8080 (add --host 0.0.0.0 when mm runs in a container or a sandbox)]
107+[warning: llamacpp: nothing answers at http://host.docker.internal:9931/v1 — start it: llama-server -m <model.gguf> --jinja --port 9931 (add --host 0.0.0.0 when mm runs in a container or a sandbox)]
108108 mm v0.1.7 | config: agent.llamacpp.yaml | provider: llamacpp | model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M | ctx: unknown | tools: bash, read_file, write_file, edit_file | skills: 0 | yolo: on
109109 ```
110110
@@ -239,8 +239,8 @@ Un fichier d'agent hors du workspace ne donne qu'un avertissement : voir [quand
239239 | Option | Question quand elle est absente | Défaut |
240240 |--------|---------------------------------|--------|
241241 | `--project yes\|no` | Tout ranger dans un dossier `.mm` ? — posée en premier. `yes` : le fichier est `.mm/agent.yaml` (le dossier est créé), ses chemins sont écrits depuis la racine du projet (`skillsDir: .mm/skills`), et `mm` / `mm tui` lancés là le trouvent sans argument | `no` |
242-| `--provider` | Serveur de modèles : `llmman`, `ollama`, `dmr`, `llamacpp`, `kronk`, `openai` | le premier serveur local qui répond, sinon `llmman` (`openai` n'est jamais sondé : son adresse par défaut est l'API d'OpenAI) |
243-| `--base-url` | `openai` seulement : Endpoint — l'adresse compatible OpenAI du service (OpenAI, Cerebras, Hugging Face…) ; pour les autres fournisseurs, pas posée | `https://api.openai.com/v1` pour `openai` ; sinon `AGENT_BASE_URL` s'il est défini, sinon la première des adresses locales du fournisseur dont la liste de modèles répond — son adresse par défaut, puis la même avec `127.0.0.1` quand elle nomme `localhost` — et son adresse de secours pour conteneur (`host.docker.internal`) seulement quand aucune ne répond. La question du modèle nomme l'adresse d'où vient sa liste (`Model? (listed from …)`). Écrite comme `baseUrl` sauf si c'est la valeur par défaut |
242+| `--provider` | Serveur de modèles : `llamacpp`, `llmman`, `ollama`, `dmr`, `kronk`, `openai` | le premier serveur local qui répond, dans cet ordre (`llamacpp` sur 9931, puis 8080), sinon `llamacpp` (`openai` n'est jamais sondé : son adresse par défaut est l'API d'OpenAI) |
243+| `--base-url` | `openai` seulement : Endpoint — l'adresse compatible OpenAI du service (OpenAI, Cerebras, Hugging Face…) ; pour les autres fournisseurs, pas posée | `https://api.openai.com/v1` pour `openai` ; sinon `AGENT_BASE_URL` s'il est défini, sinon la première des adresses locales du fournisseur dont la liste de modèles répond — son adresse par défaut, puis la même avec `127.0.0.1` quand elle nomme `localhost`, puis pour `llamacpp` l'ancien port de llama-server, `http://127.0.0.1:8080/v1` — et son adresse de secours pour conteneur (`host.docker.internal`) seulement quand aucune ne répond. La question du modèle nomme l'adresse d'où vient sa liste (`Model? (listed from …)`). Écrite comme `baseUrl` sauf si c'est la valeur par défaut |
244244 | `--api-key-env` | `openai` seulement : variable d'environnement qui contient la clé d'API | `OPENAI_API_KEY`. Écrite comme `apiKeyEnv` sauf si c'est la valeur par défaut |
245245 | `--model` | Modèle : la liste des modèles du serveur (`/api/tags` pour llmman et Ollama, `/models` pour les autres ; 5 s pour un serveur local, 20 s pour `openai`), ou un nom à taper quand il n'y a pas de liste — la question dit pourquoi (`<VARIABLE> is not set: no list`, ou l'erreur du serveur). Pour `openai`, la liste est demandée avec la clé lue dans la variable nommée plus haut, et pas demandée du tout quand cette variable est vide | le premier de la liste |
246246 | `--family` | Famille du modèle | détectée d'après le nom du modèle, puis d'après le nom de famille donné par le serveur |
@@ -56,7 +56,7 @@ La première source existante gagne.
56 | 1 | Option `-config` ou argument positionnel | Erreur, code de sortie 1 |56 | 1 | Option `-config` ou argument positionnel | Erreur, code de sortie 1 |
57 | 2 | Variable d'environnement `AGENT_CONFIG` | Erreur, code de sortie 1 |57 | 2 | Variable d'environnement `AGENT_CONFIG` | Erreur, code de sortie 1 |
58 | 3 | `./agent.yaml` | Source suivante |58 | 3 | `./agent.yaml` | Source suivante |
59-| 4 | `./.mm/agent.yaml` | Pas une erreur : les valeurs par défaut intégrées sont utilisées, la bannière affiche `config: built-in defaults` |59+| 4 | `./.mm/agent.yaml` | Erreur, code de sortie 1 : `[config error: no agent file in <dossier> — looked for agent.yaml and .mm/agent.yaml (AGENT_CONFIG is not set).` suivi de la façon d'en créer un (`mm init`, `mm acp-create`) ou d'en nommer un. Dans tous les modes qui parlent à un modèle (ligne, `tui`, `-p`, `--ask`, `acp`) ; `mm init`, `mm acp-create`, `mm skillcreate`, `mm dockerinit`, `mm sbxinit`, `--version` et `--about` n'ont pas besoin de fichier d'agent. Avant la v1.1.1, mm tournait avec des valeurs par défaut intégrées (`dmr`, Mellum2) |
60 60
61 Quand `./agent.yaml` et `./.mm/agent.yaml` existent tous les deux, c'est `./agent.yaml` qui est utilisé.61 Quand `./agent.yaml` et `./.mm/agent.yaml` existent tous les deux, c'est `./agent.yaml` qui est utilisé.
62 62
@@ -104,7 +104,7 @@ Affichée sur stdout en mode terminal, sur stderr en mode ACP. Grisée quand std
104 ### Exemple104 ### Exemple
105 105
106 ```106 ```
107-[warning: llamacpp: nothing answers at http://host.docker.internal:8080/v1 — start it: llama-server -m <model.gguf> --jinja --port 8080 (add --host 0.0.0.0 when mm runs in a container or a sandbox)]107+[warning: llamacpp: nothing answers at http://host.docker.internal:9931/v1 — start it: llama-server -m <model.gguf> --jinja --port 9931 (add --host 0.0.0.0 when mm runs in a container or a sandbox)]
108 mm v0.1.7 | config: agent.llamacpp.yaml | provider: llamacpp | model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M | ctx: unknown | tools: bash, read_file, write_file, edit_file | skills: 0 | yolo: on108 mm v0.1.7 | config: agent.llamacpp.yaml | provider: llamacpp | model: jetbrains/mellum2-12b-a2.5b-instruct-gguf-q4_k_m:Q4_K_M | ctx: unknown | tools: bash, read_file, write_file, edit_file | skills: 0 | yolo: on
109 ```109 ```
110 110
@@ -239,8 +239,8 @@ Un fichier d'agent hors du workspace ne donne qu'un avertissement : voir [quand
239 | Option | Question quand elle est absente | Défaut |239 | Option | Question quand elle est absente | Défaut |
240 |--------|---------------------------------|--------|240 |--------|---------------------------------|--------|
241 | `--project yes\|no` | Tout ranger dans un dossier `.mm` ? — posée en premier. `yes` : le fichier est `.mm/agent.yaml` (le dossier est créé), ses chemins sont écrits depuis la racine du projet (`skillsDir: .mm/skills`), et `mm` / `mm tui` lancés là le trouvent sans argument | `no` |241 | `--project yes\|no` | Tout ranger dans un dossier `.mm` ? — posée en premier. `yes` : le fichier est `.mm/agent.yaml` (le dossier est créé), ses chemins sont écrits depuis la racine du projet (`skillsDir: .mm/skills`), et `mm` / `mm tui` lancés là le trouvent sans argument | `no` |
242-| `--provider` | Serveur de modèles : `llmman`, `ollama`, `dmr`, `llamacpp`, `kronk`, `openai` | le premier serveur local qui répond, sinon `llmman` (`openai` n'est jamais sondé : son adresse par défaut est l'API d'OpenAI) |242+| `--provider` | Serveur de modèles : `llamacpp`, `llmman`, `ollama`, `dmr`, `kronk`, `openai` | le premier serveur local qui répond, dans cet ordre (`llamacpp` sur 9931, puis 8080), sinon `llamacpp` (`openai` n'est jamais sondé : son adresse par défaut est l'API d'OpenAI) |
243-| `--base-url` | `openai` seulement : Endpoint — l'adresse compatible OpenAI du service (OpenAI, Cerebras, Hugging Face…) ; pour les autres fournisseurs, pas posée | `https://api.openai.com/v1` pour `openai` ; sinon `AGENT_BASE_URL` s'il est défini, sinon la première des adresses locales du fournisseur dont la liste de modèles répond — son adresse par défaut, puis la même avec `127.0.0.1` quand elle nomme `localhost` — et son adresse de secours pour conteneur (`host.docker.internal`) seulement quand aucune ne répond. La question du modèle nomme l'adresse d'où vient sa liste (`Model? (listed from …)`). Écrite comme `baseUrl` sauf si c'est la valeur par défaut |243+| `--base-url` | `openai` seulement : Endpoint — l'adresse compatible OpenAI du service (OpenAI, Cerebras, Hugging Face…) ; pour les autres fournisseurs, pas posée | `https://api.openai.com/v1` pour `openai` ; sinon `AGENT_BASE_URL` s'il est défini, sinon la première des adresses locales du fournisseur dont la liste de modèles répond — son adresse par défaut, puis la même avec `127.0.0.1` quand elle nomme `localhost`, puis pour `llamacpp` l'ancien port de llama-server, `http://127.0.0.1:8080/v1` — et son adresse de secours pour conteneur (`host.docker.internal`) seulement quand aucune ne répond. La question du modèle nomme l'adresse d'où vient sa liste (`Model? (listed from …)`). Écrite comme `baseUrl` sauf si c'est la valeur par défaut |
244 | `--api-key-env` | `openai` seulement : variable d'environnement qui contient la clé d'API | `OPENAI_API_KEY`. Écrite comme `apiKeyEnv` sauf si c'est la valeur par défaut |244 | `--api-key-env` | `openai` seulement : variable d'environnement qui contient la clé d'API | `OPENAI_API_KEY`. Écrite comme `apiKeyEnv` sauf si c'est la valeur par défaut |
245 | `--model` | Modèle : la liste des modèles du serveur (`/api/tags` pour llmman et Ollama, `/models` pour les autres ; 5 s pour un serveur local, 20 s pour `openai`), ou un nom à taper quand il n'y a pas de liste — la question dit pourquoi (`<VARIABLE> is not set: no list`, ou l'erreur du serveur). Pour `openai`, la liste est demandée avec la clé lue dans la variable nommée plus haut, et pas demandée du tout quand cette variable est vide | le premier de la liste |245 | `--model` | Modèle : la liste des modèles du serveur (`/api/tags` pour llmman et Ollama, `/models` pour les autres ; 5 s pour un serveur local, 20 s pour `openai`), ou un nom à taper quand il n'y a pas de liste — la question dit pourquoi (`<VARIABLE> is not set: no list`, ou l'erreur du serveur). Pour `openai`, la liste est demandée avec la clé lue dans la variable nommée plus haut, et pas demandée du tout quand cette variable est vide | le premier de la liste |
246 | `--family` | Famille du modèle | détectée d'après le nom du modèle, puis d'après le nom de famille donné par le serveur |246 | `--family` | Famille du modèle | détectée d'après le nom du modèle, puis d'après le nom de famille donné par le serveur |
modified docs/fr/reference/configuration.md +5 -3
@@ -197,12 +197,14 @@ tools:
197197 | Fournisseur | `baseUrl` | `fallback` | `apiKeyEnv` | Clé requise |
198198 |-------------|-----------|------------|-------------|-------------|
199199 | `dmr` | `http://localhost:12434/engines/v1` | `http://host.docker.internal:12434/engines/v1` | aucune | non |
200-| `llamacpp` | `http://127.0.0.1:8080/v1` | `http://host.docker.internal:8080/v1` | `LLAMA_API_KEY` | non |
200+| `llamacpp` | `http://127.0.0.1:9931/v1` (puis `http://127.0.0.1:8080/v1`) | `http://host.docker.internal:9931/v1` | `LLAMA_API_KEY` | non |
201201 | `llmman` | `http://127.0.0.1:17434/v1` | `http://host.docker.internal:17434/v1` | `LLMMAN_API_KEY` | non |
202202 | `ollama` | `http://localhost:11434/v1` | `http://host.docker.internal:11434/v1` | `OLLAMA_API_KEY` | non |
203203 | `kronk` | `http://127.0.0.1:11435/v1` | `http://host.docker.internal:11435/v1` | `KRONK_TOKEN` | non — seuls les modes `authenticated` et `full-protected` de Kronk la vérifient |
204204 | `openai` | `https://api.openai.com/v1` | aucun | `OPENAI_API_KEY` | non — un serveur qui en exige une répond 401, et l'avertissement de démarrage nomme la variable |
205205
206+`llamacpp` : le port par défaut de llama-server est `9931` depuis llama.cpp b11521 (2026-10-09), `8080` avant et dans les images Docker officielles. Quand l'adresse utilisée est `http://127.0.0.1:9931/v1` (pas de `baseUrl`, ou celle-ci) et qu'elle ne répond pas, mm essaie `http://127.0.0.1:8080/v1`, puis le `fallback`.
207+
206208 Le fournisseur `openai` n'envoie que des champs standard : pas de `return_progress` (donc pas de progression pendant la lecture d'un long prompt), pas d'interrupteur de raisonnement sur une requête de résumé, pas de `/unload`. Il ne peut pas demander sa fenêtre au serveur : renseignez `contextWindow`, sinon la compression compte les messages (`context.maxMessages`). Sa sonde de démarrage envoie la clé à `GET /models` ; un 401 ou un 403 est signalé comme une clé refusée, pas comme un serveur qui ne répond pas.
207209
208210 ## `structuredOutput`
@@ -477,14 +479,14 @@ Un avertissement au démarrage, et non une erreur, est affiché quand `context.e
477479 | Fichier | Rôle |
478480 |---------|------|
479481 | `agent.yaml` | Configuration Docker Model Runner : `provider: dmr`, `maxTurns: 40`, `displayCommands: true`, compression désactivée, un prompt système nommé « Bob » qui décrit les skills et les règles d'édition de fichiers. |
480-| `agent.llamacpp.yaml` | Configuration llama.cpp : `provider: llamacpp`, `baseUrl: http://127.0.0.1:8080/v1`, compression activée. |
482+| `agent.llamacpp.yaml` | Configuration llama.cpp : `provider: llamacpp`, `baseUrl: http://127.0.0.1:9931/v1`, compression activée. |
481483
482484 ### Exemple
483485
484486 ```yaml
485487 provider: llamacpp
486488 model: mon-alias
487-baseUrl: http://127.0.0.1:8080/v1
489+baseUrl: http://127.0.0.1:9931/v1
488490 fallback: ""
489491 maxTurns: 40
490492 context:
@@ -197,12 +197,14 @@ tools:
197 | Fournisseur | `baseUrl` | `fallback` | `apiKeyEnv` | Clé requise |197 | Fournisseur | `baseUrl` | `fallback` | `apiKeyEnv` | Clé requise |
198 |-------------|-----------|------------|-------------|-------------|198 |-------------|-----------|------------|-------------|-------------|
199 | `dmr` | `http://localhost:12434/engines/v1` | `http://host.docker.internal:12434/engines/v1` | aucune | non |199 | `dmr` | `http://localhost:12434/engines/v1` | `http://host.docker.internal:12434/engines/v1` | aucune | non |
200-| `llamacpp` | `http://127.0.0.1:8080/v1` | `http://host.docker.internal:8080/v1` | `LLAMA_API_KEY` | non |200+| `llamacpp` | `http://127.0.0.1:9931/v1` (puis `http://127.0.0.1:8080/v1`) | `http://host.docker.internal:9931/v1` | `LLAMA_API_KEY` | non |
201 | `llmman` | `http://127.0.0.1:17434/v1` | `http://host.docker.internal:17434/v1` | `LLMMAN_API_KEY` | non |201 | `llmman` | `http://127.0.0.1:17434/v1` | `http://host.docker.internal:17434/v1` | `LLMMAN_API_KEY` | non |
202 | `ollama` | `http://localhost:11434/v1` | `http://host.docker.internal:11434/v1` | `OLLAMA_API_KEY` | non |202 | `ollama` | `http://localhost:11434/v1` | `http://host.docker.internal:11434/v1` | `OLLAMA_API_KEY` | non |
203 | `kronk` | `http://127.0.0.1:11435/v1` | `http://host.docker.internal:11435/v1` | `KRONK_TOKEN` | non — seuls les modes `authenticated` et `full-protected` de Kronk la vérifient |203 | `kronk` | `http://127.0.0.1:11435/v1` | `http://host.docker.internal:11435/v1` | `KRONK_TOKEN` | non — seuls les modes `authenticated` et `full-protected` de Kronk la vérifient |
204 | `openai` | `https://api.openai.com/v1` | aucun | `OPENAI_API_KEY` | non — un serveur qui en exige une répond 401, et l'avertissement de démarrage nomme la variable |204 | `openai` | `https://api.openai.com/v1` | aucun | `OPENAI_API_KEY` | non — un serveur qui en exige une répond 401, et l'avertissement de démarrage nomme la variable |
205 205
206+`llamacpp` : le port par défaut de llama-server est `9931` depuis llama.cpp b11521 (2026-10-09), `8080` avant et dans les images Docker officielles. Quand l'adresse utilisée est `http://127.0.0.1:9931/v1` (pas de `baseUrl`, ou celle-ci) et qu'elle ne répond pas, mm essaie `http://127.0.0.1:8080/v1`, puis le `fallback`.
207+
206 Le fournisseur `openai` n'envoie que des champs standard : pas de `return_progress` (donc pas de progression pendant la lecture d'un long prompt), pas d'interrupteur de raisonnement sur une requête de résumé, pas de `/unload`. Il ne peut pas demander sa fenêtre au serveur : renseignez `contextWindow`, sinon la compression compte les messages (`context.maxMessages`). Sa sonde de démarrage envoie la clé à `GET /models` ; un 401 ou un 403 est signalé comme une clé refusée, pas comme un serveur qui ne répond pas.208 Le fournisseur `openai` n'envoie que des champs standard : pas de `return_progress` (donc pas de progression pendant la lecture d'un long prompt), pas d'interrupteur de raisonnement sur une requête de résumé, pas de `/unload`. Il ne peut pas demander sa fenêtre au serveur : renseignez `contextWindow`, sinon la compression compte les messages (`context.maxMessages`). Sa sonde de démarrage envoie la clé à `GET /models` ; un 401 ou un 403 est signalé comme une clé refusée, pas comme un serveur qui ne répond pas.
207 209
208 ## `structuredOutput`210 ## `structuredOutput`
@@ -477,14 +479,14 @@ Un avertissement au démarrage, et non une erreur, est affiché quand `context.e
477 | Fichier | Rôle |479 | Fichier | Rôle |
478 |---------|------|480 |---------|------|
479 | `agent.yaml` | Configuration Docker Model Runner : `provider: dmr`, `maxTurns: 40`, `displayCommands: true`, compression désactivée, un prompt système nommé « Bob » qui décrit les skills et les règles d'édition de fichiers. |481 | `agent.yaml` | Configuration Docker Model Runner : `provider: dmr`, `maxTurns: 40`, `displayCommands: true`, compression désactivée, un prompt système nommé « Bob » qui décrit les skills et les règles d'édition de fichiers. |
480-| `agent.llamacpp.yaml` | Configuration llama.cpp : `provider: llamacpp`, `baseUrl: http://127.0.0.1:8080/v1`, compression activée. |482+| `agent.llamacpp.yaml` | Configuration llama.cpp : `provider: llamacpp`, `baseUrl: http://127.0.0.1:9931/v1`, compression activée. |
481 483
482 ### Exemple484 ### Exemple
483 485
484 ```yaml486 ```yaml
485 provider: llamacpp487 provider: llamacpp
486 model: mon-alias488 model: mon-alias
487-baseUrl: http://127.0.0.1:8080/v1489+baseUrl: http://127.0.0.1:9931/v1
488 fallback: ""490 fallback: ""
489 maxTurns: 40491 maxTurns: 40
490 context:492 context:
modified internal/agentinit/decide.go +1 -1
@@ -7,7 +7,7 @@ import (
77
88 // Choices are the wizard's answers.
99 type Choices struct {
10- Provider string // llmman, ollama, dmr, llamacpp, openai
10+ Provider string // llamacpp, llmman, ollama, dmr, kronk, openai
1111 BaseURL string // "" = the provider's default
1212 // APIKeyEnv names the variable holding the API key of an
1313 // OpenAI-compatible service (provider openai); "" = OPENAI_API_KEY.
@@ -7,7 +7,7 @@ import (
7 7
8 // Choices are the wizard's answers.8 // Choices are the wizard's answers.
9 type Choices struct {9 type Choices struct {
10- Provider string // llmman, ollama, dmr, llamacpp, openai10+ Provider string // llamacpp, llmman, ollama, dmr, kronk, openai
11 BaseURL string // "" = the provider's default11 BaseURL string // "" = the provider's default
12 // APIKeyEnv names the variable holding the API key of an12 // APIKeyEnv names the variable holding the API key of an
13 // OpenAI-compatible service (provider openai); "" = OPENAI_API_KEY.13 // OpenAI-compatible service (provider openai); "" = OPENAI_API_KEY.
modified internal/agentinit/decide_test.go +1 -1
@@ -170,7 +170,7 @@ func TestRenderRecordsTheDefaultURLs(t *testing.T) {
170170 t.Errorf("llmman's default URLs missing:\n%s", llmman)
171171 }
172172 llamacpp := Render(Decide(p, Choices{Provider: "llamacpp", Model: "qwen3", Usage: "assistant", Machine: "small"}, Facts{}))
173- if !strings.Contains(llamacpp, "# baseUrl: \"http://127.0.0.1:8080/v1\"\n# fallback: \"http://host.docker.internal:8080/v1\" # tried when baseUrl does not answer\n") {
173+ if !strings.Contains(llamacpp, "# baseUrl: \"http://127.0.0.1:9931/v1\"\n# (llamacpp also tries http://127.0.0.1:8080/v1 on this machine when baseUrl does not answer)\n# fallback: \"http://host.docker.internal:9931/v1\" # tried when baseUrl does not answer\n") {
174174 t.Errorf("llamacpp's default URL missing:\n%s", llamacpp)
175175 }
176176 own := Render(Decide(p, Choices{Provider: "llmman", BaseURL: "http://box:17434/v1", Model: "qwen3", Usage: "assistant", Machine: "small"}, Facts{}))
@@ -170,7 +170,7 @@ func TestRenderRecordsTheDefaultURLs(t *testing.T) {
170 t.Errorf("llmman's default URLs missing:\n%s", llmman)170 t.Errorf("llmman's default URLs missing:\n%s", llmman)
171 }171 }
172 llamacpp := Render(Decide(p, Choices{Provider: "llamacpp", Model: "qwen3", Usage: "assistant", Machine: "small"}, Facts{}))172 llamacpp := Render(Decide(p, Choices{Provider: "llamacpp", Model: "qwen3", Usage: "assistant", Machine: "small"}, Facts{}))
173- if !strings.Contains(llamacpp, "# baseUrl: \"http://127.0.0.1:8080/v1\"\n# fallback: \"http://host.docker.internal:8080/v1\" # tried when baseUrl does not answer\n") {173+ if !strings.Contains(llamacpp, "# baseUrl: \"http://127.0.0.1:9931/v1\"\n# (llamacpp also tries http://127.0.0.1:8080/v1 on this machine when baseUrl does not answer)\n# fallback: \"http://host.docker.internal:9931/v1\" # tried when baseUrl does not answer\n") {
174 t.Errorf("llamacpp's default URL missing:\n%s", llamacpp)174 t.Errorf("llamacpp's default URL missing:\n%s", llamacpp)
175 }175 }
176 own := Render(Decide(p, Choices{Provider: "llmman", BaseURL: "http://box:17434/v1", Model: "qwen3", Usage: "assistant", Machine: "small"}, Facts{}))176 own := Render(Decide(p, Choices{Provider: "llmman", BaseURL: "http://box:17434/v1", Model: "qwen3", Usage: "assistant", Machine: "small"}, Facts{}))
modified internal/agentinit/render.go +3 -0
@@ -277,6 +277,9 @@ func writeDefaultURLs(b *strings.Builder, provider string) {
277277 }
278278 fmt.Fprintf(b, "# No baseUrl: %s's defaults apply. For the record:\n", provider)
279279 fmt.Fprintf(b, "# baseUrl: %s\n", quote(base))
280+ for _, alt := range engine.LocalURLs(provider)[1:] {
281+ fmt.Fprintf(b, "# (%s also tries %s on this machine when baseUrl does not answer)\n", provider, alt)
282+ }
280283 if fallback != "" {
281284 fmt.Fprintf(b, "# fallback: %s # tried when baseUrl does not answer\n", quote(fallback))
282285 } else {
@@ -277,6 +277,9 @@ func writeDefaultURLs(b *strings.Builder, provider string) {
277 }277 }
278 fmt.Fprintf(b, "# No baseUrl: %s's defaults apply. For the record:\n", provider)278 fmt.Fprintf(b, "# No baseUrl: %s's defaults apply. For the record:\n", provider)
279 fmt.Fprintf(b, "# baseUrl: %s\n", quote(base))279 fmt.Fprintf(b, "# baseUrl: %s\n", quote(base))
280+ for _, alt := range engine.LocalURLs(provider)[1:] {
281+ fmt.Fprintf(b, "# (%s also tries %s on this machine when baseUrl does not answer)\n", provider, alt)
282+ }
280 if fallback != "" {283 if fallback != "" {
281 fmt.Fprintf(b, "# fallback: %s # tried when baseUrl does not answer\n", quote(fallback))284 fmt.Fprintf(b, "# fallback: %s # tried when baseUrl does not answer\n", quote(fallback))
282 } else {285 } else {
modified internal/agentinit/wizard.go +28 -18
@@ -19,12 +19,16 @@ import (
1919 )
2020
2121 // providers are the servers mm speaks to, in the order they are offered.
22-var providers = []string{"llmman", "ollama", "dmr", "llamacpp", "kronk", "openai"}
22+// llamacpp first (ticket 221, user's choice): the default when nothing
23+// answers (firstAnswering).
24+var providers = []string{"llamacpp", "llmman", "ollama", "dmr", "kronk", "openai"}
2325
24-// local are the providers probed for the first question's default: never
25-// `openai`, whose default address is the OpenAI API — mm init must not call
26-// a remote service nobody asked for.
27-var local = []string{"llmman", "ollama", "dmr", "llamacpp", "kronk"}
26+// local are the providers probed for the first question's default, in this
27+// order: the first that answers is proposed — llamacpp when llama-server
28+// runs (9931, then 8080), else a running llmman, Ollama… Never `openai`,
29+// whose default address is the OpenAI API — mm init must not call a remote
30+// service nobody asked for.
31+var local = []string{"llamacpp", "llmman", "ollama", "dmr", "kronk"}
2832
2933 // Window asks the flow's questions in a full-screen window (internal/tui's
3034 // RunInit): it returns false when the user quit without writing. main hands
@@ -385,8 +389,8 @@ func resolveBase(ctx context.Context, c Choices) string {
385389 if env := engine.EnvBaseURL(c.Provider); env != "" {
386390 return env
387391 }
388- if base, fallback, ok := engine.DefaultURLs(c.Provider); ok {
389- return chooseBase(base, fallback, func(url string) bool {
392+ if _, fallback, ok := engine.DefaultURLs(c.Provider); ok {
393+ return chooseBase(engine.LocalURLs(c.Provider), fallback, func(url string) bool {
390394 _, err := Models(ctx, c.Provider, url)
391395 return err == nil
392396 })
@@ -395,21 +399,27 @@ func resolveBase(ctx context.Context, c Choices) string {
395399 }
396400
397401 // chooseBase picks the address to list models from: the first that lists
398-// them among the local ones (localAddresses), else the fallback when it
399-// does, else the default — whose error the model question then shows. A
400-// provider without a fallback (llamacpp, openai) is not probed at all: there
401-// is nothing to choose, and openai's default is a remote service nobody
402-// asked mm to call yet.
403-func chooseBase(base, fallback string, lists func(string) bool) string {
404- if fallback == "" {
402+// them among the local ones — locals is the provider's default, then its
403+// alternates (engine.LocalURLs), each with its localAddresses — else the
404+// fallback when it does, else the default, whose error the model question
405+// then shows. A provider with one address and no fallback (openai) is not
406+// probed at all: there is nothing to choose, and openai's default is a
407+// remote service nobody asked mm to call yet.
408+//
409+// chooseBase([]string{"http://127.0.0.1:9931/v1", "http://127.0.0.1:8080/v1"}, "http://host.docker.internal:9931/v1", lists)
410+func chooseBase(locals []string, fallback string, lists func(string) bool) string {
411+ base := locals[0]
412+ if fallback == "" && len(locals) == 1 {
405413 return base
406414 }
407- for _, url := range localAddresses(base) {
408- if lists(url) {
409- return url
415+ for _, local := range locals {
416+ for _, url := range localAddresses(local) {
417+ if lists(url) {
418+ return url
419+ }
410420 }
411421 }
412- if lists(fallback) {
422+ if fallback != "" && lists(fallback) {
413423 return fallback
414424 }
415425 return base
@@ -19,12 +19,16 @@ import (
19 )19 )
20 20
21 // providers are the servers mm speaks to, in the order they are offered.21 // providers are the servers mm speaks to, in the order they are offered.
22-var providers = []string{"llmman", "ollama", "dmr", "llamacpp", "kronk", "openai"}22+// llamacpp first (ticket 221, user's choice): the default when nothing
23+// answers (firstAnswering).
24+var providers = []string{"llamacpp", "llmman", "ollama", "dmr", "kronk", "openai"}
23 25
24-// local are the providers probed for the first question's default: never26+// local are the providers probed for the first question's default, in this
25-// `openai`, whose default address is the OpenAI API — mm init must not call27+// order: the first that answers is proposed — llamacpp when llama-server
26-// a remote service nobody asked for.28+// runs (9931, then 8080), else a running llmman, Ollama… Never `openai`,
27-var local = []string{"llmman", "ollama", "dmr", "llamacpp", "kronk"}29+// whose default address is the OpenAI API — mm init must not call a remote
30+// service nobody asked for.
31+var local = []string{"llamacpp", "llmman", "ollama", "dmr", "kronk"}
28 32
29 // Window asks the flow's questions in a full-screen window (internal/tui's33 // Window asks the flow's questions in a full-screen window (internal/tui's
30 // RunInit): it returns false when the user quit without writing. main hands34 // RunInit): it returns false when the user quit without writing. main hands
@@ -385,8 +389,8 @@ func resolveBase(ctx context.Context, c Choices) string {
385 if env := engine.EnvBaseURL(c.Provider); env != "" {389 if env := engine.EnvBaseURL(c.Provider); env != "" {
386 return env390 return env
387 }391 }
388- if base, fallback, ok := engine.DefaultURLs(c.Provider); ok {392+ if _, fallback, ok := engine.DefaultURLs(c.Provider); ok {
389- return chooseBase(base, fallback, func(url string) bool {393+ return chooseBase(engine.LocalURLs(c.Provider), fallback, func(url string) bool {
390 _, err := Models(ctx, c.Provider, url)394 _, err := Models(ctx, c.Provider, url)
391 return err == nil395 return err == nil
392 })396 })
@@ -395,21 +399,27 @@ func resolveBase(ctx context.Context, c Choices) string {
395 }399 }
396 400
397 // chooseBase picks the address to list models from: the first that lists401 // chooseBase picks the address to list models from: the first that lists
398-// them among the local ones (localAddresses), else the fallback when it402+// them among the local ones — locals is the provider's default, then its
399-// does, else the default — whose error the model question then shows. A403+// alternates (engine.LocalURLs), each with its localAddresses — else the
400-// provider without a fallback (llamacpp, openai) is not probed at all: there404+// fallback when it does, else the default, whose error the model question
401-// is nothing to choose, and openai's default is a remote service nobody405+// then shows. A provider with one address and no fallback (openai) is not
402-// asked mm to call yet.406+// probed at all: there is nothing to choose, and openai's default is a
403-func chooseBase(base, fallback string, lists func(string) bool) string {407+// remote service nobody asked mm to call yet.
404- if fallback == "" {408+//
409+// chooseBase([]string{"http://127.0.0.1:9931/v1", "http://127.0.0.1:8080/v1"}, "http://host.docker.internal:9931/v1", lists)
410+func chooseBase(locals []string, fallback string, lists func(string) bool) string {
411+ base := locals[0]
412+ if fallback == "" && len(locals) == 1 {
405 return base413 return base
406 }414 }
407- for _, url := range localAddresses(base) {415+ for _, local := range locals {
408- if lists(url) {416+ for _, url := range localAddresses(local) {
409- return url417+ if lists(url) {
418+ return url
419+ }
410 }420 }
411 }421 }
412- if lists(fallback) {422+ if fallback != "" && lists(fallback) {
413 return fallback423 return fallback
414 }424 }
415 return base425 return base
modified internal/agentinit/wizard_test.go +63 -3
@@ -8,6 +8,7 @@ import (
88 "net/http/httptest"
99 "os"
1010 "path/filepath"
11+ "slices"
1112 "strings"
1213 "testing"
1314 "time"
@@ -284,16 +285,47 @@ func TestChooseBasePrefersALocalAddress(t *testing.T) {
284285 }
285286 for _, c := range cases {
286287 lists, asked := answering(c.answer...)
287- if got := chooseBase(base, fallback, lists); got != c.want || len(*asked) != c.wantAsked {
288+ if got := chooseBase([]string{base}, fallback, lists); got != c.want || len(*asked) != c.wantAsked {
288289 t.Errorf("%s: got %s after asking %v, want %s after %d", c.name, got, *asked, c.want, c.wantAsked)
289290 }
290291 }
291292 lists, asked := answering()
292- if got := chooseBase("https://api.openai.com/v1", "", lists); got != "https://api.openai.com/v1" || len(*asked) != 0 {
293+ if got := chooseBase([]string{"https://api.openai.com/v1"}, "", lists); got != "https://api.openai.com/v1" || len(*asked) != 0 {
293294 t.Errorf("no fallback: got %s, asked %v — want the default, nothing asked", got, *asked)
294295 }
295296 }
296297
298+// llamacpp tries llama-server's former port, 8080, before the container
299+// address when 9931 does not list models (ticket 218); a provider with
300+// alternates and no fallback still tries them.
301+func TestChooseBaseTriesTheAlternates(t *testing.T) {
302+ const now, before, fallback = "http://127.0.0.1:9931/v1", "http://127.0.0.1:8080/v1", "http://host.docker.internal:9931/v1"
303+ locals := []string{now, before}
304+ answering := func(urls ...string) func(string) bool {
305+ return func(url string) bool { return slices.Contains(urls, url) }
306+ }
307+ cases := []struct {
308+ name, fallback string
309+ answer []string
310+ want string
311+ }{
312+ {"a recent llama-server on 9931", fallback, []string{now, before}, now},
313+ {"an older one on 8080", fallback, []string{before, fallback}, before},
314+ {"none on this machine: the container address", fallback, []string{fallback}, fallback},
315+ {"nothing answers: the default", fallback, nil, now},
316+ {"no fallback: the alternate still counts", "", []string{before}, before},
317+ {"no fallback, nothing answers: the default", "", nil, now},
318+ }
319+ for _, c := range cases {
320+ if got := chooseBase(locals, c.fallback, answering(c.answer...)); got != c.want {
321+ t.Errorf("%s: got %s, want %s", c.name, got, c.want)
322+ }
323+ }
324+ if got := engine.LocalURLs("llamacpp"); !slices.Equal(got, locals) {
325+ t.Errorf("engine.LocalURLs(llamacpp) = %v, want %v", got, locals)
326+ }
327+}
328+
297329 func TestLocalAddresses(t *testing.T) {
298330 for in, want := range map[string]string{
299331 "http://localhost:11434/v1": "http://localhost:11434/v1 http://127.0.0.1:11434/v1",
@@ -333,7 +365,7 @@ func TestResolveBaseKeepsASlowLocalServer(t *testing.T) {
333365 if b, err := p.Resolve(config.Config{Provider: "ollama", Model: "probe", BaseURL: base, Fallback: &fallback}); err != nil || b.BaseURL != fallback {
334366 t.Fatalf("the engine's probe kept %s (%v): the test server is not slow enough to show ticket 214", b.BaseURL, err)
335367 }
336- got := chooseBase(base, fallback, func(url string) bool {
368+ got := chooseBase([]string{base}, fallback, func(url string) bool {
337369 _, err := Models(context.Background(), "ollama", url)
338370 return err == nil
339371 })
@@ -349,3 +381,31 @@ func TestResolveBaseHonoursAgentBaseURL(t *testing.T) {
349381 t.Errorf("got %s", got)
350382 }
351383 }
384+
385+// Ticket 221: llamacpp is offered first and is the default when its server
386+// answers or when nothing does; another running server is proposed when
387+// llama-server is not running.
388+func TestFirstAnsweringPrefersLlamacpp(t *testing.T) {
389+ if providers[0] != "llamacpp" || local[0] != "llamacpp" {
390+ t.Fatalf("providers = %v, local = %v: want llamacpp first in both", providers, local)
391+ }
392+ cases := []struct {
393+ name string
394+ answering []string
395+ want string
396+ }{
397+ {"llama-server runs, llmman too", []string{"llamacpp", "llmman"}, "llamacpp"},
398+ {"only llmman runs", []string{"llmman"}, "llmman"},
399+ {"only Ollama runs", []string{"ollama"}, "ollama"},
400+ {"nothing runs", nil, "llamacpp"},
401+ }
402+ for _, c := range cases {
403+ f := &Flow{reachable: map[string]bool{}}
404+ for _, p := range c.answering {
405+ f.reachable[p] = true
406+ }
407+ if got := f.firstAnswering(); got != c.want {
408+ t.Errorf("%s: firstAnswering() = %s, want %s", c.name, got, c.want)
409+ }
410+ }
411+}
@@ -8,6 +8,7 @@ import (
8 "net/http/httptest"8 "net/http/httptest"
9 "os"9 "os"
10 "path/filepath"10 "path/filepath"
11+ "slices"
11 "strings"12 "strings"
12 "testing"13 "testing"
13 "time"14 "time"
@@ -284,16 +285,47 @@ func TestChooseBasePrefersALocalAddress(t *testing.T) {
284 }285 }
285 for _, c := range cases {286 for _, c := range cases {
286 lists, asked := answering(c.answer...)287 lists, asked := answering(c.answer...)
287- if got := chooseBase(base, fallback, lists); got != c.want || len(*asked) != c.wantAsked {288+ if got := chooseBase([]string{base}, fallback, lists); got != c.want || len(*asked) != c.wantAsked {
288 t.Errorf("%s: got %s after asking %v, want %s after %d", c.name, got, *asked, c.want, c.wantAsked)289 t.Errorf("%s: got %s after asking %v, want %s after %d", c.name, got, *asked, c.want, c.wantAsked)
289 }290 }
290 }291 }
291 lists, asked := answering()292 lists, asked := answering()
292- if got := chooseBase("https://api.openai.com/v1", "", lists); got != "https://api.openai.com/v1" || len(*asked) != 0 {293+ if got := chooseBase([]string{"https://api.openai.com/v1"}, "", lists); got != "https://api.openai.com/v1" || len(*asked) != 0 {
293 t.Errorf("no fallback: got %s, asked %v — want the default, nothing asked", got, *asked)294 t.Errorf("no fallback: got %s, asked %v — want the default, nothing asked", got, *asked)
294 }295 }
295 }296 }
296 297
298+// llamacpp tries llama-server's former port, 8080, before the container
299+// address when 9931 does not list models (ticket 218); a provider with
300+// alternates and no fallback still tries them.
301+func TestChooseBaseTriesTheAlternates(t *testing.T) {
302+ const now, before, fallback = "http://127.0.0.1:9931/v1", "http://127.0.0.1:8080/v1", "http://host.docker.internal:9931/v1"
303+ locals := []string{now, before}
304+ answering := func(urls ...string) func(string) bool {
305+ return func(url string) bool { return slices.Contains(urls, url) }
306+ }
307+ cases := []struct {
308+ name, fallback string
309+ answer []string
310+ want string
311+ }{
312+ {"a recent llama-server on 9931", fallback, []string{now, before}, now},
313+ {"an older one on 8080", fallback, []string{before, fallback}, before},
314+ {"none on this machine: the container address", fallback, []string{fallback}, fallback},
315+ {"nothing answers: the default", fallback, nil, now},
316+ {"no fallback: the alternate still counts", "", []string{before}, before},
317+ {"no fallback, nothing answers: the default", "", nil, now},
318+ }
319+ for _, c := range cases {
320+ if got := chooseBase(locals, c.fallback, answering(c.answer...)); got != c.want {
321+ t.Errorf("%s: got %s, want %s", c.name, got, c.want)
322+ }
323+ }
324+ if got := engine.LocalURLs("llamacpp"); !slices.Equal(got, locals) {
325+ t.Errorf("engine.LocalURLs(llamacpp) = %v, want %v", got, locals)
326+ }
327+}
328+
297 func TestLocalAddresses(t *testing.T) {329 func TestLocalAddresses(t *testing.T) {
298 for in, want := range map[string]string{330 for in, want := range map[string]string{
299 "http://localhost:11434/v1": "http://localhost:11434/v1 http://127.0.0.1:11434/v1",331 "http://localhost:11434/v1": "http://localhost:11434/v1 http://127.0.0.1:11434/v1",
@@ -333,7 +365,7 @@ func TestResolveBaseKeepsASlowLocalServer(t *testing.T) {
333 if b, err := p.Resolve(config.Config{Provider: "ollama", Model: "probe", BaseURL: base, Fallback: &fallback}); err != nil || b.BaseURL != fallback {365 if b, err := p.Resolve(config.Config{Provider: "ollama", Model: "probe", BaseURL: base, Fallback: &fallback}); err != nil || b.BaseURL != fallback {
334 t.Fatalf("the engine's probe kept %s (%v): the test server is not slow enough to show ticket 214", b.BaseURL, err)366 t.Fatalf("the engine's probe kept %s (%v): the test server is not slow enough to show ticket 214", b.BaseURL, err)
335 }367 }
336- got := chooseBase(base, fallback, func(url string) bool {368+ got := chooseBase([]string{base}, fallback, func(url string) bool {
337 _, err := Models(context.Background(), "ollama", url)369 _, err := Models(context.Background(), "ollama", url)
338 return err == nil370 return err == nil
339 })371 })
@@ -349,3 +381,31 @@ func TestResolveBaseHonoursAgentBaseURL(t *testing.T) {
349 t.Errorf("got %s", got)381 t.Errorf("got %s", got)
350 }382 }
351 }383 }
384+
385+// Ticket 221: llamacpp is offered first and is the default when its server
386+// answers or when nothing does; another running server is proposed when
387+// llama-server is not running.
388+func TestFirstAnsweringPrefersLlamacpp(t *testing.T) {
389+ if providers[0] != "llamacpp" || local[0] != "llamacpp" {
390+ t.Fatalf("providers = %v, local = %v: want llamacpp first in both", providers, local)
391+ }
392+ cases := []struct {
393+ name string
394+ answering []string
395+ want string
396+ }{
397+ {"llama-server runs, llmman too", []string{"llamacpp", "llmman"}, "llamacpp"},
398+ {"only llmman runs", []string{"llmman"}, "llmman"},
399+ {"only Ollama runs", []string{"ollama"}, "ollama"},
400+ {"nothing runs", nil, "llamacpp"},
401+ }
402+ for _, c := range cases {
403+ f := &Flow{reachable: map[string]bool{}}
404+ for _, p := range c.answering {
405+ f.reachable[p] = true
406+ }
407+ if got := f.firstAnswering(); got != c.want {
408+ t.Errorf("%s: firstAnswering() = %s, want %s", c.name, got, c.want)
409+ }
410+ }
411+}
modified internal/config/config.go +4 -2
@@ -774,8 +774,10 @@ which ones you left running.`,
774774 // more local of the two — closer to the run you are making right now.
775775 //
776776 // A path asked for EXPLICITLY (command line or AGENT_CONFIG) that does not
777-// exist is an error: you named a file, it should be there. A missing
778-// ./agent.yaml is not an error — the built-in defaults are enough to run.
777+// exist is an error: you named a file, it should be there. No file in the
778+// default places is not an error here: Load returns "" with the built-in
779+// defaults in Cfg (tests and the wizards rely on it); main refuses to run
780+// an agent without a file (ticket 220).
779781 func Load(cliPath string) (string, error) {
780782 path, explicit := cliPath, true
781783 if path == "" {
@@ -774,8 +774,10 @@ which ones you left running.`,
774 // more local of the two — closer to the run you are making right now.774 // more local of the two — closer to the run you are making right now.
775 //775 //
776 // A path asked for EXPLICITLY (command line or AGENT_CONFIG) that does not776 // A path asked for EXPLICITLY (command line or AGENT_CONFIG) that does not
777-// exist is an error: you named a file, it should be there. A missing777+// exist is an error: you named a file, it should be there. No file in the
778-// ./agent.yaml is not an error — the built-in defaults are enough to run.778+// default places is not an error here: Load returns "" with the built-in
779+// defaults in Cfg (tests and the wizards rely on it); main refuses to run
780+// an agent without a file (ticket 220).
779 func Load(cliPath string) (string, error) {781 func Load(cliPath string) (string, error) {
780 path, explicit := cliPath, true782 path, explicit := cliPath, true
781 if path == "" {783 if path == "" {
modified internal/config/locate.go +1 -1
@@ -15,7 +15,7 @@ const ProjectDir = ".mm"
1515 var defaultPaths = []string{DefaultPath, filepath.Join(ProjectDir, DefaultPath)}
1616
1717 // defaultPath returns the first of defaultPaths that exists, or DefaultPath
18-// when none does — Load then finds no file and the built-in defaults stand.
18+// when none does — Load then finds no file and returns "" (main stops: ticket 220).
1919 //
2020 // // in a project with only .mm/agent.yaml
2121 // defaultPath() // ".mm/agent.yaml"
@@ -15,7 +15,7 @@ const ProjectDir = ".mm"
15 var defaultPaths = []string{DefaultPath, filepath.Join(ProjectDir, DefaultPath)}15 var defaultPaths = []string{DefaultPath, filepath.Join(ProjectDir, DefaultPath)}
16 16
17 // defaultPath returns the first of defaultPaths that exists, or DefaultPath17 // defaultPath returns the first of defaultPaths that exists, or DefaultPath
18-// when none does — Load then finds no file and the built-in defaults stand.18+// when none does — Load then finds no file and returns "" (main stops: ticket 220).
19 //19 //
20 // // in a project with only .mm/agent.yaml20 // // in a project with only .mm/agent.yaml
21 // defaultPath() // ".mm/agent.yaml"21 // defaultPath() // ".mm/agent.yaml"
modified internal/engine/openai_compat.go +54 -8
@@ -33,6 +33,12 @@ type openaiCompat struct {
3333 baseURL string // used when the config gives none
3434 fallback string // tried when baseURL does not answer; "" = no fallback
3535
36+ // alternates are other addresses on this machine, tried in order when
37+ // the address in use is baseURL and does not answer — before the
38+ // fallback. llamacpp: llama-server's former default port, 8080, which
39+ // older builds and the official Docker images still use (ticket 218).
40+ alternates []string
41+
3642 // legacyBaseURLEnv keeps DMR_BASE_URL working for the `dmr` provider: the
3743 // variable is in every README and in the sandbox start scripts. The
3844 // provider-neutral AGENT_BASE_URL wins over it.
@@ -87,6 +93,20 @@ func DefaultURLs(provider string) (baseURL, fallback string, ok bool) {
8793 return p.baseURL, p.fallback, true
8894 }
8995
96+// LocalURLs returns the addresses a provider tries on this machine when the
97+// config gives no baseUrl: its default, then its alternates (ticket 218).
98+// nil for a provider this build does not know.
99+//
100+// engine.LocalURLs("llamacpp")
101+// // ["http://127.0.0.1:9931/v1", "http://127.0.0.1:8080/v1"]
102+func LocalURLs(provider string) []string {
103+ p, found := registry[provider].(*openaiCompat)
104+ if !found {
105+ return nil
106+ }
107+ return append([]string{p.baseURL}, p.alternates...)
108+}
109+
90110 // EnvBaseURL is the address the environment imposes on a provider —
91111 // AGENT_BASE_URL, else the provider's legacy variable (DMR_BASE_URL) — or
92112 // "" when none is set. Resolve takes it as is, without probing; so does
@@ -116,18 +136,24 @@ func init() {
116136 pull: pullDMR,
117137 })
118138 register(&openaiCompat{
119- name: "llamacpp",
120- baseURL: "http://127.0.0.1:8080/v1", // llama-server's default host:port, plus the OpenAI prefix
139+ name: "llamacpp",
140+ // llama-server's default host:port since llama.cpp b11521
141+ // (2026-10-09, ggml-org/llama.cpp#30159), plus the OpenAI prefix.
142+ baseURL: "http://127.0.0.1:9931/v1",
143+ // Its default before b11521, still the port of the official Docker
144+ // images (LLAMA_ARG_PORT=8080) and of every guide written before:
145+ // tried on this machine when 9931 does not answer (ticket 218).
146+ alternates: []string{"http://127.0.0.1:8080/v1"},
121147 // From a container or a sandbox, like the other local servers
122148 // (ticket 217). llama-server listens on the loopback only unless
123149 // started with --host 0.0.0.0, which Linux and a Docker Sandbox need
124150 // for this name to reach it (Docker Desktop reaches the loopback).
125- fallback: "http://host.docker.internal:8080/v1",
151+ fallback: "http://host.docker.internal:9931/v1",
126152 // llama-server only checks a key when started with --api-key; most
127153 // local set-ups are not, so an unset LLAMA_API_KEY is normal.
128154 apiKeyEnv: "LLAMA_API_KEY",
129155 dummyKey: "not-needed",
130- startHint: "start it: llama-server -m <model.gguf> --jinja --port 8080 (add --host 0.0.0.0 when mm runs in a container or a sandbox)",
156+ startHint: "start it: llama-server -m <model.gguf> --jinja --port 9931 (add --host 0.0.0.0 when mm runs in a container or a sandbox)",
131157 notFoundHint: "llama-server serves one model; check baseUrl ends with /v1 (model: %s)",
132158 probe: probeLlamaCpp,
133159 progress: true,
@@ -235,10 +261,7 @@ func (p *openaiCompat) resolve(cfg config.Config, useEnv bool) (Backend, error)
235261 if cfg.Fallback != nil {
236262 fallback = *cfg.Fallback
237263 }
238- b.BaseURL = base
239- if fallback != "" && !reachable(base) {
240- b.BaseURL = fallback
241- }
264+ b.BaseURL = p.pickBase(base, fallback)
242265 }
243266
244267 keyEnv := cfg.APIKeyEnv
@@ -346,6 +369,29 @@ func (p *openaiCompat) Probe(ctx context.Context, b Backend) Info {
346369 return info
347370 }
348371
372+// pickBase is the address to talk to: base when it answers, else the first
373+// alternate that does (only when base is the provider's default: a baseUrl
374+// written in the file names one server), else the fallback; base when there
375+// is no fallback either. Nothing is probed when there is nothing to choose.
376+func (p *openaiCompat) pickBase(base, fallback string) string {
377+ candidates := []string{base}
378+ if base == p.baseURL {
379+ candidates = append(candidates, p.alternates...)
380+ }
381+ if fallback == "" && len(candidates) == 1 {
382+ return base
383+ }
384+ for _, url := range candidates {
385+ if reachable(url) {
386+ return url
387+ }
388+ }
389+ if fallback != "" {
390+ return fallback
391+ }
392+ return base
393+}
394+
349395 // probeClient: two seconds, like the old reachable(). A local server answers in
350396 // milliseconds; a longer wait only delays the prompt when it is down.
351397 var probeClient = &http.Client{Timeout: 2 * time.Second}
@@ -33,6 +33,12 @@ type openaiCompat struct {
33 baseURL string // used when the config gives none33 baseURL string // used when the config gives none
34 fallback string // tried when baseURL does not answer; "" = no fallback34 fallback string // tried when baseURL does not answer; "" = no fallback
35 35
36+ // alternates are other addresses on this machine, tried in order when
37+ // the address in use is baseURL and does not answer — before the
38+ // fallback. llamacpp: llama-server's former default port, 8080, which
39+ // older builds and the official Docker images still use (ticket 218).
40+ alternates []string
41+
36 // legacyBaseURLEnv keeps DMR_BASE_URL working for the `dmr` provider: the42 // legacyBaseURLEnv keeps DMR_BASE_URL working for the `dmr` provider: the
37 // variable is in every README and in the sandbox start scripts. The43 // variable is in every README and in the sandbox start scripts. The
38 // provider-neutral AGENT_BASE_URL wins over it.44 // provider-neutral AGENT_BASE_URL wins over it.
@@ -87,6 +93,20 @@ func DefaultURLs(provider string) (baseURL, fallback string, ok bool) {
87 return p.baseURL, p.fallback, true93 return p.baseURL, p.fallback, true
88 }94 }
89 95
96+// LocalURLs returns the addresses a provider tries on this machine when the
97+// config gives no baseUrl: its default, then its alternates (ticket 218).
98+// nil for a provider this build does not know.
99+//
100+// engine.LocalURLs("llamacpp")
101+// // ["http://127.0.0.1:9931/v1", "http://127.0.0.1:8080/v1"]
102+func LocalURLs(provider string) []string {
103+ p, found := registry[provider].(*openaiCompat)
104+ if !found {
105+ return nil
106+ }
107+ return append([]string{p.baseURL}, p.alternates...)
108+}
109+
90 // EnvBaseURL is the address the environment imposes on a provider —110 // EnvBaseURL is the address the environment imposes on a provider —
91 // AGENT_BASE_URL, else the provider's legacy variable (DMR_BASE_URL) — or111 // AGENT_BASE_URL, else the provider's legacy variable (DMR_BASE_URL) — or
92 // "" when none is set. Resolve takes it as is, without probing; so does112 // "" when none is set. Resolve takes it as is, without probing; so does
@@ -116,18 +136,24 @@ func init() {
116 pull: pullDMR,136 pull: pullDMR,
117 })137 })
118 register(&openaiCompat{138 register(&openaiCompat{
119- name: "llamacpp",139+ name: "llamacpp",
120- baseURL: "http://127.0.0.1:8080/v1", // llama-server's default host:port, plus the OpenAI prefix140+ // llama-server's default host:port since llama.cpp b11521
141+ // (2026-10-09, ggml-org/llama.cpp#30159), plus the OpenAI prefix.
142+ baseURL: "http://127.0.0.1:9931/v1",
143+ // Its default before b11521, still the port of the official Docker
144+ // images (LLAMA_ARG_PORT=8080) and of every guide written before:
145+ // tried on this machine when 9931 does not answer (ticket 218).
146+ alternates: []string{"http://127.0.0.1:8080/v1"},
121 // From a container or a sandbox, like the other local servers147 // From a container or a sandbox, like the other local servers
122 // (ticket 217). llama-server listens on the loopback only unless148 // (ticket 217). llama-server listens on the loopback only unless
123 // started with --host 0.0.0.0, which Linux and a Docker Sandbox need149 // started with --host 0.0.0.0, which Linux and a Docker Sandbox need
124 // for this name to reach it (Docker Desktop reaches the loopback).150 // for this name to reach it (Docker Desktop reaches the loopback).
125- fallback: "http://host.docker.internal:8080/v1",151+ fallback: "http://host.docker.internal:9931/v1",
126 // llama-server only checks a key when started with --api-key; most152 // llama-server only checks a key when started with --api-key; most
127 // local set-ups are not, so an unset LLAMA_API_KEY is normal.153 // local set-ups are not, so an unset LLAMA_API_KEY is normal.
128 apiKeyEnv: "LLAMA_API_KEY",154 apiKeyEnv: "LLAMA_API_KEY",
129 dummyKey: "not-needed",155 dummyKey: "not-needed",
130- startHint: "start it: llama-server -m <model.gguf> --jinja --port 8080 (add --host 0.0.0.0 when mm runs in a container or a sandbox)",156+ startHint: "start it: llama-server -m <model.gguf> --jinja --port 9931 (add --host 0.0.0.0 when mm runs in a container or a sandbox)",
131 notFoundHint: "llama-server serves one model; check baseUrl ends with /v1 (model: %s)",157 notFoundHint: "llama-server serves one model; check baseUrl ends with /v1 (model: %s)",
132 probe: probeLlamaCpp,158 probe: probeLlamaCpp,
133 progress: true,159 progress: true,
@@ -235,10 +261,7 @@ func (p *openaiCompat) resolve(cfg config.Config, useEnv bool) (Backend, error)
235 if cfg.Fallback != nil {261 if cfg.Fallback != nil {
236 fallback = *cfg.Fallback262 fallback = *cfg.Fallback
237 }263 }
238- b.BaseURL = base264+ b.BaseURL = p.pickBase(base, fallback)
239- if fallback != "" && !reachable(base) {
240- b.BaseURL = fallback
241- }
242 }265 }
243 266
244 keyEnv := cfg.APIKeyEnv267 keyEnv := cfg.APIKeyEnv
@@ -346,6 +369,29 @@ func (p *openaiCompat) Probe(ctx context.Context, b Backend) Info {
346 return info369 return info
347 }370 }
348 371
372+// pickBase is the address to talk to: base when it answers, else the first
373+// alternate that does (only when base is the provider's default: a baseUrl
374+// written in the file names one server), else the fallback; base when there
375+// is no fallback either. Nothing is probed when there is nothing to choose.
376+func (p *openaiCompat) pickBase(base, fallback string) string {
377+ candidates := []string{base}
378+ if base == p.baseURL {
379+ candidates = append(candidates, p.alternates...)
380+ }
381+ if fallback == "" && len(candidates) == 1 {
382+ return base
383+ }
384+ for _, url := range candidates {
385+ if reachable(url) {
386+ return url
387+ }
388+ }
389+ if fallback != "" {
390+ return fallback
391+ }
392+ return base
393+}
394+
349 // probeClient: two seconds, like the old reachable(). A local server answers in395 // probeClient: two seconds, like the old reachable(). A local server answers in
350 // milliseconds; a longer wait only delays the prompt when it is down.396 // milliseconds; a longer wait only delays the prompt when it is down.
351 var probeClient = &http.Client{Timeout: 2 * time.Second}397 var probeClient = &http.Client{Timeout: 2 * time.Second}
modified internal/engine/provider_test.go +40 -4
@@ -110,7 +110,7 @@ func TestResolveURLPrecedence(t *testing.T) {
110110 {"DMR_BASE_URL still works for dmr", "dmr", config.Config{BaseURL: up.URL, Fallback: ptr("")}, map[string]string{"DMR_BASE_URL": down}, down, "not-needed"},
111111 // llamacpp falls back on the host like the other local servers
112112 // since ticket 217 (its default address: TestDefaultURLs).
113- {"llamacpp falls back to the host's llama-server", "llamacpp", config.Config{BaseURL: down}, nil, "http://host.docker.internal:8080/v1", "not-needed"},
113+ {"llamacpp falls back to the host's llama-server", "llamacpp", config.Config{BaseURL: down}, nil, "http://host.docker.internal:9931/v1", "not-needed"},
114114 {"llamacpp keeps a reachable baseUrl", "llamacpp", config.Config{BaseURL: up.URL}, nil, up.URL, "not-needed"},
115115 {"llamacpp ignores DMR_BASE_URL", "llamacpp", config.Config{BaseURL: up.URL}, map[string]string{"DMR_BASE_URL": down}, up.URL, "not-needed"},
116116 {"llamacpp reads LLAMA_API_KEY when set", "llamacpp", config.Config{BaseURL: up.URL}, map[string]string{"LLAMA_API_KEY": "secret"}, up.URL, "secret"},
@@ -289,7 +289,7 @@ func TestExplainThroughTheStack(t *testing.T) {
289289
290290 t.Run("connection refused", func(t *testing.T) {
291291 got := explainAgainst(t, "llamacpp", closedURL(t))
292- if !strings.Contains(got, "nothing answers") || !strings.Contains(got, "--jinja --port 8080") {
292+ if !strings.Contains(got, "nothing answers") || !strings.Contains(got, "--jinja --port 9931") {
293293 t.Errorf("Explain = %q, want the start hint", got)
294294 }
295295 })
@@ -459,7 +459,7 @@ func TestConfigCompat(t *testing.T) {
459459 if err != nil {
460460 t.Fatal(err)
461461 }
462- if b.BaseURL != "http://127.0.0.1:8080/v1" || b.ContextWindow != 16384 {
462+ if b.BaseURL != "http://127.0.0.1:9931/v1" || b.ContextWindow != 16384 {
463463 t.Errorf("Backend = %+v, want llama-server's default URL and the 16384 hint", b)
464464 }
465465
@@ -556,6 +556,42 @@ func TestOpenKeepsGenkitQuiet(t *testing.T) {
556556 }
557557 }
558558
559+// pickBase: the default, then its alternates (only when the default is the
560+// address in use), then the fallback (ticket 218).
561+func TestPickBaseTriesTheAlternates(t *testing.T) {
562+ up := openaiServer(t, 200, "{}", "fake-model")
563+ down, down2 := closedURL(t), closedURL(t)
564+ const fallback = "http://host.docker.internal:1/v1"
565+ cases := []struct {
566+ name string
567+ base, def, fallback string
568+ alternates []string
569+ want string
570+ }{
571+ {"the default answers", up.URL, up.URL, fallback, []string{down}, up.URL},
572+ {"the default is down, the alternate answers", down, down, fallback, []string{up.URL}, up.URL},
573+ {"all local ones down: the fallback", down, down, fallback, []string{down2}, fallback},
574+ {"no fallback: the alternate still counts", down, down, "", []string{up.URL}, up.URL},
575+ {"no fallback, all down: the default", down, down, "", []string{down2}, down},
576+ {"a baseUrl of the file's own skips the alternates", down, "http://default.invalid/v1", fallback, []string{up.URL}, fallback},
577+ }
578+ for _, c := range cases {
579+ p := &openaiCompat{baseURL: c.def, alternates: c.alternates}
580+ if got := p.pickBase(c.base, c.fallback); got != c.want {
581+ t.Errorf("%s: got %s, want %s", c.name, got, c.want)
582+ }
583+ }
584+ if got := LocalURLs("llamacpp"); len(got) != 2 || got[1] != "http://127.0.0.1:8080/v1" {
585+ t.Errorf("LocalURLs(llamacpp) = %v, want 9931 then 8080", got)
586+ }
587+ if got := LocalURLs("ollama"); len(got) != 1 {
588+ t.Errorf("LocalURLs(ollama) = %v, want the default only", got)
589+ }
590+ if LocalURLs("nope") != nil {
591+ t.Error("an unknown provider has local URLs")
592+ }
593+}
594+
559595 // DefaultURLs gives the addresses a provider uses with no baseUrl: the
560596 // fallback when it has one, nothing for an unknown provider.
561597 func TestDefaultURLs(t *testing.T) {
@@ -564,7 +600,7 @@ func TestDefaultURLs(t *testing.T) {
564600 {"ollama", "http://localhost:11434/v1", "http://host.docker.internal:11434/v1"},
565601 {"kronk", "http://127.0.0.1:11435/v1", "http://host.docker.internal:11435/v1"},
566602 {"dmr", "http://localhost:12434/engines/v1", "http://host.docker.internal:12434/engines/v1"},
567- {"llamacpp", "http://127.0.0.1:8080/v1", "http://host.docker.internal:8080/v1"},
603+ {"llamacpp", "http://127.0.0.1:9931/v1", "http://host.docker.internal:9931/v1"},
568604 {"openai", "https://api.openai.com/v1", ""},
569605 }
570606 for _, c := range cases {
@@ -110,7 +110,7 @@ func TestResolveURLPrecedence(t *testing.T) {
110 {"DMR_BASE_URL still works for dmr", "dmr", config.Config{BaseURL: up.URL, Fallback: ptr("")}, map[string]string{"DMR_BASE_URL": down}, down, "not-needed"},110 {"DMR_BASE_URL still works for dmr", "dmr", config.Config{BaseURL: up.URL, Fallback: ptr("")}, map[string]string{"DMR_BASE_URL": down}, down, "not-needed"},
111 // llamacpp falls back on the host like the other local servers111 // llamacpp falls back on the host like the other local servers
112 // since ticket 217 (its default address: TestDefaultURLs).112 // since ticket 217 (its default address: TestDefaultURLs).
113- {"llamacpp falls back to the host's llama-server", "llamacpp", config.Config{BaseURL: down}, nil, "http://host.docker.internal:8080/v1", "not-needed"},113+ {"llamacpp falls back to the host's llama-server", "llamacpp", config.Config{BaseURL: down}, nil, "http://host.docker.internal:9931/v1", "not-needed"},
114 {"llamacpp keeps a reachable baseUrl", "llamacpp", config.Config{BaseURL: up.URL}, nil, up.URL, "not-needed"},114 {"llamacpp keeps a reachable baseUrl", "llamacpp", config.Config{BaseURL: up.URL}, nil, up.URL, "not-needed"},
115 {"llamacpp ignores DMR_BASE_URL", "llamacpp", config.Config{BaseURL: up.URL}, map[string]string{"DMR_BASE_URL": down}, up.URL, "not-needed"},115 {"llamacpp ignores DMR_BASE_URL", "llamacpp", config.Config{BaseURL: up.URL}, map[string]string{"DMR_BASE_URL": down}, up.URL, "not-needed"},
116 {"llamacpp reads LLAMA_API_KEY when set", "llamacpp", config.Config{BaseURL: up.URL}, map[string]string{"LLAMA_API_KEY": "secret"}, up.URL, "secret"},116 {"llamacpp reads LLAMA_API_KEY when set", "llamacpp", config.Config{BaseURL: up.URL}, map[string]string{"LLAMA_API_KEY": "secret"}, up.URL, "secret"},
@@ -289,7 +289,7 @@ func TestExplainThroughTheStack(t *testing.T) {
289 289
290 t.Run("connection refused", func(t *testing.T) {290 t.Run("connection refused", func(t *testing.T) {
291 got := explainAgainst(t, "llamacpp", closedURL(t))291 got := explainAgainst(t, "llamacpp", closedURL(t))
292- if !strings.Contains(got, "nothing answers") || !strings.Contains(got, "--jinja --port 8080") {292+ if !strings.Contains(got, "nothing answers") || !strings.Contains(got, "--jinja --port 9931") {
293 t.Errorf("Explain = %q, want the start hint", got)293 t.Errorf("Explain = %q, want the start hint", got)
294 }294 }
295 })295 })
@@ -459,7 +459,7 @@ func TestConfigCompat(t *testing.T) {
459 if err != nil {459 if err != nil {
460 t.Fatal(err)460 t.Fatal(err)
461 }461 }
462- if b.BaseURL != "http://127.0.0.1:8080/v1" || b.ContextWindow != 16384 {462+ if b.BaseURL != "http://127.0.0.1:9931/v1" || b.ContextWindow != 16384 {
463 t.Errorf("Backend = %+v, want llama-server's default URL and the 16384 hint", b)463 t.Errorf("Backend = %+v, want llama-server's default URL and the 16384 hint", b)
464 }464 }
465 465
@@ -556,6 +556,42 @@ func TestOpenKeepsGenkitQuiet(t *testing.T) {
556 }556 }
557 }557 }
558 558
559+// pickBase: the default, then its alternates (only when the default is the
560+// address in use), then the fallback (ticket 218).
561+func TestPickBaseTriesTheAlternates(t *testing.T) {
562+ up := openaiServer(t, 200, "{}", "fake-model")
563+ down, down2 := closedURL(t), closedURL(t)
564+ const fallback = "http://host.docker.internal:1/v1"
565+ cases := []struct {
566+ name string
567+ base, def, fallback string
568+ alternates []string
569+ want string
570+ }{
571+ {"the default answers", up.URL, up.URL, fallback, []string{down}, up.URL},
572+ {"the default is down, the alternate answers", down, down, fallback, []string{up.URL}, up.URL},
573+ {"all local ones down: the fallback", down, down, fallback, []string{down2}, fallback},
574+ {"no fallback: the alternate still counts", down, down, "", []string{up.URL}, up.URL},
575+ {"no fallback, all down: the default", down, down, "", []string{down2}, down},
576+ {"a baseUrl of the file's own skips the alternates", down, "http://default.invalid/v1", fallback, []string{up.URL}, fallback},
577+ }
578+ for _, c := range cases {
579+ p := &openaiCompat{baseURL: c.def, alternates: c.alternates}
580+ if got := p.pickBase(c.base, c.fallback); got != c.want {
581+ t.Errorf("%s: got %s, want %s", c.name, got, c.want)
582+ }
583+ }
584+ if got := LocalURLs("llamacpp"); len(got) != 2 || got[1] != "http://127.0.0.1:8080/v1" {
585+ t.Errorf("LocalURLs(llamacpp) = %v, want 9931 then 8080", got)
586+ }
587+ if got := LocalURLs("ollama"); len(got) != 1 {
588+ t.Errorf("LocalURLs(ollama) = %v, want the default only", got)
589+ }
590+ if LocalURLs("nope") != nil {
591+ t.Error("an unknown provider has local URLs")
592+ }
593+}
594+
559 // DefaultURLs gives the addresses a provider uses with no baseUrl: the595 // DefaultURLs gives the addresses a provider uses with no baseUrl: the
560 // fallback when it has one, nothing for an unknown provider.596 // fallback when it has one, nothing for an unknown provider.
561 func TestDefaultURLs(t *testing.T) {597 func TestDefaultURLs(t *testing.T) {
@@ -564,7 +600,7 @@ func TestDefaultURLs(t *testing.T) {
564 {"ollama", "http://localhost:11434/v1", "http://host.docker.internal:11434/v1"},600 {"ollama", "http://localhost:11434/v1", "http://host.docker.internal:11434/v1"},
565 {"kronk", "http://127.0.0.1:11435/v1", "http://host.docker.internal:11435/v1"},601 {"kronk", "http://127.0.0.1:11435/v1", "http://host.docker.internal:11435/v1"},
566 {"dmr", "http://localhost:12434/engines/v1", "http://host.docker.internal:12434/engines/v1"},602 {"dmr", "http://localhost:12434/engines/v1", "http://host.docker.internal:12434/engines/v1"},
567- {"llamacpp", "http://127.0.0.1:8080/v1", "http://host.docker.internal:8080/v1"},603+ {"llamacpp", "http://127.0.0.1:9931/v1", "http://host.docker.internal:9931/v1"},
568 {"openai", "https://api.openai.com/v1", ""},604 {"openai", "https://api.openai.com/v1", ""},
569 }605 }
570 for _, c := range cases {606 for _, c := range cases {
modified main.go +26 -5
@@ -224,12 +224,21 @@ func main() {
224224 spinner.Disable()
225225 }
226226
227- // Settings: built-in defaults, overridden by the YAML file if there is one.
227+ // Settings: built-in defaults, overridden by the agent file.
228228 path, err := config.Load(*configPath)
229229 if err != nil {
230230 fail("[config error: %v ]", err)
231231 os.Exit(1)
232232 }
233+ // No agent file found: stop rather than run a built-in model on a
234+ // built-in server the user never chose (ticket 220). Every mode that
235+ // reaches this point talks to a model; the commands that write the
236+ // files (init, acp-create, skillcreate, dockerinit, sbxinit) and
237+ // --version / --about were answered before.
238+ if path == "" {
239+ fail("%s", noAgentFile())
240+ os.Exit(1)
241+ }
233242
234243 // Where a relative skillsDir points depends on who started mm. From a
235244 // terminal, it is the directory mm was started from — an installed mm
@@ -309,10 +318,6 @@ func main() {
309318 agentTools := set.tools
310319 set.warnings = append(set.warnings, ask.Missing()...)
311320
312- if path == "" {
313- path = "built-in defaults"
314- }
315-
316321 // Handle prompt mode: run a single prompt and exit
317322 if *promptMode != "" && e.IsDecider() {
318323 ui.Out = os.Stderr
@@ -820,6 +825,22 @@ func fail(format string, args ...any) {
820825 _, _ = fmt.Fprintf(errOut, format+"\n", args...)
821826 }
822827
828+// noAgentFile is the error mm stops with when no agent file was found: where
829+// it looked, and how to get one (ticket 220). A file named on the command
830+// line or in AGENT_CONFIG that does not exist is config.Load's own error.
831+//
832+// [config error: no agent file in /home/bob/demo — looked for agent.yaml and .mm/agent.yaml (AGENT_CONFIG is not set).
833+// Create one with: mm init (or mm acp-create from an editor). Or name one: mm <file>, AGENT_CONFIG=<file> ]
834+func noAgentFile() string {
835+ dir, err := os.Getwd()
836+ if err != nil {
837+ dir = "the current directory"
838+ }
839+ return fmt.Sprintf("[config error: no agent file in %s — looked for %s and %s (AGENT_CONFIG is not set).\n"+
840+ " Create one with: mm init (or mm acp-create from an editor). Or name one: mm <file>, AGENT_CONFIG=<file> ]",
841+ dir, config.DefaultPath, filepath.Join(config.ProjectDir, config.DefaultPath))
842+}
843+
823844 // resolveSkillsDir makes the skills directory absolute. An absolute dir is
824845 // kept as-is. A relative one follows the config file in ACP mode when there
825846 // is one (the editor's working directory is not the project's) — its
@@ -224,12 +224,21 @@ func main() {
224 spinner.Disable()224 spinner.Disable()
225 }225 }
226 226
227- // Settings: built-in defaults, overridden by the YAML file if there is one.227+ // Settings: built-in defaults, overridden by the agent file.
228 path, err := config.Load(*configPath)228 path, err := config.Load(*configPath)
229 if err != nil {229 if err != nil {
230 fail("[config error: %v ]", err)230 fail("[config error: %v ]", err)
231 os.Exit(1)231 os.Exit(1)
232 }232 }
233+ // No agent file found: stop rather than run a built-in model on a
234+ // built-in server the user never chose (ticket 220). Every mode that
235+ // reaches this point talks to a model; the commands that write the
236+ // files (init, acp-create, skillcreate, dockerinit, sbxinit) and
237+ // --version / --about were answered before.
238+ if path == "" {
239+ fail("%s", noAgentFile())
240+ os.Exit(1)
241+ }
233 242
234 // Where a relative skillsDir points depends on who started mm. From a243 // Where a relative skillsDir points depends on who started mm. From a
235 // terminal, it is the directory mm was started from — an installed mm244 // terminal, it is the directory mm was started from — an installed mm
@@ -309,10 +318,6 @@ func main() {
309 agentTools := set.tools318 agentTools := set.tools
310 set.warnings = append(set.warnings, ask.Missing()...)319 set.warnings = append(set.warnings, ask.Missing()...)
311 320
312- if path == "" {
313- path = "built-in defaults"
314- }
315-
316 // Handle prompt mode: run a single prompt and exit321 // Handle prompt mode: run a single prompt and exit
317 if *promptMode != "" && e.IsDecider() {322 if *promptMode != "" && e.IsDecider() {
318 ui.Out = os.Stderr323 ui.Out = os.Stderr
@@ -820,6 +825,22 @@ func fail(format string, args ...any) {
820 _, _ = fmt.Fprintf(errOut, format+"\n", args...)825 _, _ = fmt.Fprintf(errOut, format+"\n", args...)
821 }826 }
822 827
828+// noAgentFile is the error mm stops with when no agent file was found: where
829+// it looked, and how to get one (ticket 220). A file named on the command
830+// line or in AGENT_CONFIG that does not exist is config.Load's own error.
831+//
832+// [config error: no agent file in /home/bob/demo — looked for agent.yaml and .mm/agent.yaml (AGENT_CONFIG is not set).
833+// Create one with: mm init (or mm acp-create from an editor). Or name one: mm <file>, AGENT_CONFIG=<file> ]
834+func noAgentFile() string {
835+ dir, err := os.Getwd()
836+ if err != nil {
837+ dir = "the current directory"
838+ }
839+ return fmt.Sprintf("[config error: no agent file in %s — looked for %s and %s (AGENT_CONFIG is not set).\n"+
840+ " Create one with: mm init (or mm acp-create from an editor). Or name one: mm <file>, AGENT_CONFIG=<file> ]",
841+ dir, config.DefaultPath, filepath.Join(config.ProjectDir, config.DefaultPath))
842+}
843+
823 // resolveSkillsDir makes the skills directory absolute. An absolute dir is844 // resolveSkillsDir makes the skills directory absolute. An absolute dir is
824 // kept as-is. A relative one follows the config file in ACP mode when there845 // kept as-is. A relative one follows the config file in ACP mode when there
825 // is one (the editor's working directory is not the project's) — its846 // is one (the editor's working directory is not the project's) — its
modified main_test.go +60 -0
@@ -2,6 +2,11 @@ package main
22
33 import (
44 "bytes"
5+ "errors"
6+ "os"
7+ "os/exec"
8+ "slices"
9+ "strings"
510 "testing"
611
712 "mm/internal/config"
@@ -40,3 +45,58 @@ func TestStartupErrorsGoToStderr(t *testing.T) {
4045 t.Errorf("stderr got %q", stderr.String())
4146 }
4247 }
48+
49+// Ticket 220: with no agent file, mm stops with an error on stderr and exit
50+// code 1 — in line mode, tui, -p and acp — instead of running the built-in
51+// model. The real main runs in a child process (the test binary itself, with
52+// MM_TEST_RUN_MAIN set), in an empty directory, with AGENT_CONFIG unset.
53+func TestNoAgentFileStopsMM(t *testing.T) {
54+ if os.Getenv("MM_TEST_RUN_MAIN") == "1" {
55+ os.Args = append([]string{"mm"}, strings.Fields(os.Getenv("MM_TEST_ARGS"))...)
56+ main()
57+ os.Exit(0)
58+ }
59+ dir := t.TempDir()
60+ for _, args := range []string{"", "tui", "-p hello", "acp"} {
61+ cmd := exec.Command(os.Args[0], "-test.run=^TestNoAgentFileStopsMM$")
62+ cmd.Dir = dir
63+ cmd.Env = append(withoutEnv("AGENT_CONFIG", "MM_CONFIG"), "MM_TEST_RUN_MAIN=1", "MM_TEST_ARGS="+args)
64+ var stdout, stderr bytes.Buffer
65+ cmd.Stdout, cmd.Stderr = &stdout, &stderr
66+ cmd.Stdin = strings.NewReader("")
67+ err := cmd.Run()
68+ var exit *exec.ExitError
69+ if !errors.As(err, &exit) || exit.ExitCode() != 1 {
70+ t.Errorf("mm %s: err = %v, want exit code 1 (stderr: %s)", args, err, stderr.String())
71+ continue
72+ }
73+ got := stderr.String()
74+ if !strings.Contains(got, "[config error: no agent file in ") || !strings.Contains(got, "agent.yaml and .mm/agent.yaml") || !strings.Contains(got, "mm init") {
75+ t.Errorf("mm %s: stderr = %q, want the no-agent-file error", args, got)
76+ }
77+ if strings.Contains(stdout.String(), "config error") {
78+ t.Errorf("mm %s: the error went to stdout: %q", args, stdout.String())
79+ }
80+ }
81+}
82+
83+// The message names the directory mm looked in.
84+func TestNoAgentFileMessage(t *testing.T) {
85+ got := noAgentFile()
86+ wd, _ := os.Getwd()
87+ if !strings.HasPrefix(got, "[config error: no agent file in "+wd+" — ") || !strings.HasSuffix(got, " ]") {
88+ t.Errorf("noAgentFile() = %q", got)
89+ }
90+}
91+
92+// withoutEnv is os.Environ() minus the named variables.
93+func withoutEnv(names ...string) []string {
94+ var out []string
95+ for _, kv := range os.Environ() {
96+ name, _, _ := strings.Cut(kv, "=")
97+ if !slices.Contains(names, name) {
98+ out = append(out, kv)
99+ }
100+ }
101+ return out
102+}
@@ -2,6 +2,11 @@ package main
2 2
3 import (3 import (
4 "bytes"4 "bytes"
5+ "errors"
6+ "os"
7+ "os/exec"
8+ "slices"
9+ "strings"
5 "testing"10 "testing"
6 11
7 "mm/internal/config"12 "mm/internal/config"
@@ -40,3 +45,58 @@ func TestStartupErrorsGoToStderr(t *testing.T) {
40 t.Errorf("stderr got %q", stderr.String())45 t.Errorf("stderr got %q", stderr.String())
41 }46 }
42 }47 }
48+
49+// Ticket 220: with no agent file, mm stops with an error on stderr and exit
50+// code 1 — in line mode, tui, -p and acp — instead of running the built-in
51+// model. The real main runs in a child process (the test binary itself, with
52+// MM_TEST_RUN_MAIN set), in an empty directory, with AGENT_CONFIG unset.
53+func TestNoAgentFileStopsMM(t *testing.T) {
54+ if os.Getenv("MM_TEST_RUN_MAIN") == "1" {
55+ os.Args = append([]string{"mm"}, strings.Fields(os.Getenv("MM_TEST_ARGS"))...)
56+ main()
57+ os.Exit(0)
58+ }
59+ dir := t.TempDir()
60+ for _, args := range []string{"", "tui", "-p hello", "acp"} {
61+ cmd := exec.Command(os.Args[0], "-test.run=^TestNoAgentFileStopsMM$")
62+ cmd.Dir = dir
63+ cmd.Env = append(withoutEnv("AGENT_CONFIG", "MM_CONFIG"), "MM_TEST_RUN_MAIN=1", "MM_TEST_ARGS="+args)
64+ var stdout, stderr bytes.Buffer
65+ cmd.Stdout, cmd.Stderr = &stdout, &stderr
66+ cmd.Stdin = strings.NewReader("")
67+ err := cmd.Run()
68+ var exit *exec.ExitError
69+ if !errors.As(err, &exit) || exit.ExitCode() != 1 {
70+ t.Errorf("mm %s: err = %v, want exit code 1 (stderr: %s)", args, err, stderr.String())
71+ continue
72+ }
73+ got := stderr.String()
74+ if !strings.Contains(got, "[config error: no agent file in ") || !strings.Contains(got, "agent.yaml and .mm/agent.yaml") || !strings.Contains(got, "mm init") {
75+ t.Errorf("mm %s: stderr = %q, want the no-agent-file error", args, got)
76+ }
77+ if strings.Contains(stdout.String(), "config error") {
78+ t.Errorf("mm %s: the error went to stdout: %q", args, stdout.String())
79+ }
80+ }
81+}
82+
83+// The message names the directory mm looked in.
84+func TestNoAgentFileMessage(t *testing.T) {
85+ got := noAgentFile()
86+ wd, _ := os.Getwd()
87+ if !strings.HasPrefix(got, "[config error: no agent file in "+wd+" — ") || !strings.HasSuffix(got, " ]") {
88+ t.Errorf("noAgentFile() = %q", got)
89+ }
90+}
91+
92+// withoutEnv is os.Environ() minus the named variables.
93+func withoutEnv(names ...string) []string {
94+ var out []string
95+ for _, kv := range os.Environ() {
96+ name, _, _ := strings.Cut(kv, "=")
97+ if !slices.Contains(names, name) {
98+ out = append(out, kv)
99+ }
100+ }
101+ return out
102+}