bots-garden/razorbillpublic Fork
⑂ 83271da
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/razorbill.git
git clone ssh://git@rickub.com/bots-garden/razorbill.git

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

Download ZIP

Default port 7920; hint when the base URL itself is called

8080 is taken by llama-server, mlx_lm.server and Open WebUI. GET /, /v1 and /v1/ still answer
404 unknown_url, now saying that /v1 is the base URL clients add endpoints to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
k33g committed 2026-11-26T08:30:07+01:00 Browse files
83271da parent: 6e6d79e
modified .memory/handoffs/2026-11-25-v0-2-server-foundation.md +2 -0
@@ -139,3 +139,5 @@ Trap: `samples/` is now `experiments/`; host_runner.py on the Mac must be restar
139139 refuses `experiments/...`). Old tickets and handoffs still say `samples/`.
140140 Trap: `sed -i` on this mount drops the executable bit (seen on host.sh, host_runner.py,
141141 release.sh). After any sed -i on a script, `chmod +x` it and check `git ls-files -s`.
142+Default port is now 7920 (the sandbox reaches a Mac server at http://host.docker.internal:7920/v1;
143+the user may have to `sbx policy allow network localhost:7920`).
@@ -139,3 +139,5 @@ Trap: `samples/` is now `experiments/`; host_runner.py on the Mac must be restar
139 refuses `experiments/...`). Old tickets and handoffs still say `samples/`.139 refuses `experiments/...`). Old tickets and handoffs still say `samples/`.
140 Trap: `sed -i` on this mount drops the executable bit (seen on host.sh, host_runner.py,140 Trap: `sed -i` on this mount drops the executable bit (seen on host.sh, host_runner.py,
141 release.sh). After any sed -i on a script, `chmod +x` it and check `git ls-files -s`.141 release.sh). After any sed -i on a script, `chmod +x` it and check `git ls-files -s`.
142+Default port is now 7920 (the sandbox reaches a Mac server at http://host.docker.internal:7920/v1;
143+the user may have to `sbx policy allow network localhost:7920`).
modified .memory/history.md +10 -0
@@ -356,3 +356,13 @@ examples) and chose to rename it `experiments/` and list both in the README. Upd
356356 (project names are now `experiments/<name>`; its 9 unit tests pass), .vscode, sandbox how-to EN+FR,
357357 the experiments' READMEs, summary. Tickets, history and older handoffs keep `samples/` (record).
358358 The Mac's running host_runner.py must be restarted to accept the new name. Gate PASS, links OK.
359+
360+## 2026-11-26 — default port 7920, hint on the base URL
361+
362+User tried `rzb serve --port 7920` and called `GET /v1`: got 404 unknown_url (expected — /v1 is the
363+base URL, not an endpoint; 0.0.0.0 is a listen address, not one to call). Asked for a default port
364+proposal: 7920 ("rzb" on a phone keypad), 8080 rejected (llama-server, mlx_lm.server, Open WebUI).
365+User agreed to both changes: default port 7920 (code, tests, example config, docs EN+FR, compat
366+suite defaults, ticket #54; compat.sh's own 18080 unchanged) and a hint in the 404 message on `/`,
367+`/v1`, `/v1/` (status and code unchanged). Included in 0.2.0: local tag moved again. Tests Linux
368+173, compat Linux 51/20, gate PASS, links OK. Mac tests not re-run (server code is not MLX).
@@ -356,3 +356,13 @@ examples) and chose to rename it `experiments/` and list both in the README. Upd
356 (project names are now `experiments/<name>`; its 9 unit tests pass), .vscode, sandbox how-to EN+FR,356 (project names are now `experiments/<name>`; its 9 unit tests pass), .vscode, sandbox how-to EN+FR,
357 the experiments' READMEs, summary. Tickets, history and older handoffs keep `samples/` (record).357 the experiments' READMEs, summary. Tickets, history and older handoffs keep `samples/` (record).
358 The Mac's running host_runner.py must be restarted to accept the new name. Gate PASS, links OK.358 The Mac's running host_runner.py must be restarted to accept the new name. Gate PASS, links OK.
359+
360+## 2026-11-26 — default port 7920, hint on the base URL
361+
362+User tried `rzb serve --port 7920` and called `GET /v1`: got 404 unknown_url (expected — /v1 is the
363+base URL, not an endpoint; 0.0.0.0 is a listen address, not one to call). Asked for a default port
364+proposal: 7920 ("rzb" on a phone keypad), 8080 rejected (llama-server, mlx_lm.server, Open WebUI).
365+User agreed to both changes: default port 7920 (code, tests, example config, docs EN+FR, compat
366+suite defaults, ticket #54; compat.sh's own 18080 unchanged) and a hint in the 404 message on `/`,
367+`/v1`, `/v1/` (status and code unchanged). Included in 0.2.0: local tag moved again. Tests Linux
368+173, compat Linux 51/20, gate PASS, links OK. Mac tests not re-run (server code is not MLX).
modified .memory/summary.md +4 -2
@@ -48,7 +48,7 @@ tool calls / finish + usage, stop sequences), `ChatCompletionRoute` (plain + str
4848 `ChatCompletionChunk`/`ChunkBuilder`), `RazorbillCLI` (`serve`,
4949 `models list|pull|rm`, `version`; `CLIEnvironment` carries `variables` and a replaceable `serve`
5050 runner for tests; `ServerSettings.config` carries the loaded file to the server).
51-`rzb serve [--config file] --host 127.0.0.1 --port 8080 --api-key-env RZB_API_KEY --cors-origin`
51+`rzb serve [--config file] --host 127.0.0.1 --port 7920 --api-key-env RZB_API_KEY --cors-origin`
5252 (options win over the file's `server:` section); `rzb config validate <file>`; example
5353 `examples/server.yaml`. The API key is read only from the environment (`server.api_key_env` names
5454 the variable). One engine instance per loaded model (`InferenceEngine.unload()`); the engine is the
@@ -86,7 +86,7 @@ throws WrongModelKind); reuses `CompletionStream`, SSE and `CompletionEnvelope<C
8686 chat chunks); suffix/logprobs/n/best_of/multi-prompt/token arrays → 400; max_tokens defaults to the
8787 config (not OpenAI's 16). Shared field checks in `FieldChecking.swift`. Docs (#45): Diátaxis EN+FR rewritten around the
8888 server (tutorial, 10 how-to, 4 reference incl. `http-api.md` / `api-http.md`, 5 explanation); the
89-`curl` blocks of `docs/*/reference/*.md` that hit `http://127.0.0.1:8080/v1` are run by
89+`curl` blocks of `docs/*/reference/*.md` that hit `http://127.0.0.1:7920/v1` are run by
9090 `Tests/Compatibility/test_docs_curl.py` (doc models `mlx-community/Qwen3-4B-4bit` /
9191 `BAAI/bge-small-en-v1.5` are mapped to `chat` / `embed`): keep reference examples in that form, and
9292 only successful calls in ```bash blocks. v0.2 tickets #31–#45 closed; #47 (KV-cache spike)
@@ -132,6 +132,8 @@ parser commands, `CLIEnvironment` task-local for tests), executable `rzb`. Engin
132132 file handled directly; local-only (loopback) `/rzb/*` routes for status, unload, config reload —
133133 this amends the #31 "OpenAI-compatible API only" rule (still no Ollama `/api/*`). Unload in v0.4;
134134 settings = TUI preferences + server config. Tickets #53–#59, #26/#28 moved to v0.4.
135+- Default port 7920 (user, 2026-11-26; was 8080, taken by llama-server / mlx_lm.server / Open WebUI).
136+ `/`, `/v1`, `/v1/` answer the usual 404 `unknown_url` plus a hint that `/v1` is the base URL.
135137 - Work stays local: no push to `origin` until the user says so. `main` is fast-forwarded to the
136138 feature branch at the end of each step.
137139
@@ -48,7 +48,7 @@ tool calls / finish + usage, stop sequences), `ChatCompletionRoute` (plain + str
48 `ChatCompletionChunk`/`ChunkBuilder`), `RazorbillCLI` (`serve`,48 `ChatCompletionChunk`/`ChunkBuilder`), `RazorbillCLI` (`serve`,
49 `models list|pull|rm`, `version`; `CLIEnvironment` carries `variables` and a replaceable `serve`49 `models list|pull|rm`, `version`; `CLIEnvironment` carries `variables` and a replaceable `serve`
50 runner for tests; `ServerSettings.config` carries the loaded file to the server).50 runner for tests; `ServerSettings.config` carries the loaded file to the server).
51-`rzb serve [--config file] --host 127.0.0.1 --port 8080 --api-key-env RZB_API_KEY --cors-origin`51+`rzb serve [--config file] --host 127.0.0.1 --port 7920 --api-key-env RZB_API_KEY --cors-origin`
52 (options win over the file's `server:` section); `rzb config validate <file>`; example52 (options win over the file's `server:` section); `rzb config validate <file>`; example
53 `examples/server.yaml`. The API key is read only from the environment (`server.api_key_env` names53 `examples/server.yaml`. The API key is read only from the environment (`server.api_key_env` names
54 the variable). One engine instance per loaded model (`InferenceEngine.unload()`); the engine is the54 the variable). One engine instance per loaded model (`InferenceEngine.unload()`); the engine is the
@@ -86,7 +86,7 @@ throws WrongModelKind); reuses `CompletionStream`, SSE and `CompletionEnvelope<C
86 chat chunks); suffix/logprobs/n/best_of/multi-prompt/token arrays → 400; max_tokens defaults to the86 chat chunks); suffix/logprobs/n/best_of/multi-prompt/token arrays → 400; max_tokens defaults to the
87 config (not OpenAI's 16). Shared field checks in `FieldChecking.swift`. Docs (#45): Diátaxis EN+FR rewritten around the87 config (not OpenAI's 16). Shared field checks in `FieldChecking.swift`. Docs (#45): Diátaxis EN+FR rewritten around the
88 server (tutorial, 10 how-to, 4 reference incl. `http-api.md` / `api-http.md`, 5 explanation); the88 server (tutorial, 10 how-to, 4 reference incl. `http-api.md` / `api-http.md`, 5 explanation); the
89-`curl` blocks of `docs/*/reference/*.md` that hit `http://127.0.0.1:8080/v1` are run by89+`curl` blocks of `docs/*/reference/*.md` that hit `http://127.0.0.1:7920/v1` are run by
90 `Tests/Compatibility/test_docs_curl.py` (doc models `mlx-community/Qwen3-4B-4bit` /90 `Tests/Compatibility/test_docs_curl.py` (doc models `mlx-community/Qwen3-4B-4bit` /
91 `BAAI/bge-small-en-v1.5` are mapped to `chat` / `embed`): keep reference examples in that form, and91 `BAAI/bge-small-en-v1.5` are mapped to `chat` / `embed`): keep reference examples in that form, and
92 only successful calls in ```bash blocks. v0.2 tickets #31–#45 closed; #47 (KV-cache spike)92 only successful calls in ```bash blocks. v0.2 tickets #31–#45 closed; #47 (KV-cache spike)
@@ -132,6 +132,8 @@ parser commands, `CLIEnvironment` task-local for tests), executable `rzb`. Engin
132 file handled directly; local-only (loopback) `/rzb/*` routes for status, unload, config reload —132 file handled directly; local-only (loopback) `/rzb/*` routes for status, unload, config reload —
133 this amends the #31 "OpenAI-compatible API only" rule (still no Ollama `/api/*`). Unload in v0.4;133 this amends the #31 "OpenAI-compatible API only" rule (still no Ollama `/api/*`). Unload in v0.4;
134 settings = TUI preferences + server config. Tickets #53–#59, #26/#28 moved to v0.4.134 settings = TUI preferences + server config. Tickets #53–#59, #26/#28 moved to v0.4.
135+- Default port 7920 (user, 2026-11-26; was 8080, taken by llama-server / mlx_lm.server / Open WebUI).
136+ `/`, `/v1`, `/v1/` answer the usual 404 `unknown_url` plus a hint that `/v1` is the base URL.
135 - Work stays local: no push to `origin` until the user says so. `main` is fast-forwarded to the137 - Work stays local: no push to `origin` until the user says so. `main` is fast-forwarded to the
136 feature branch at the end of each step.138 feature branch at the end of each step.
137 139
modified .quality/history.jsonl +1 -0
@@ -29,3 +29,4 @@
2929 {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "17b9753", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 29, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T04:34:58Z"}
3030 {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a218748", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 30, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T05:21:18Z"}
3131 {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "fe0695f", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 31, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T07:11:39Z"}
32+{"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "6e6d79e", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 547, "cyclo": 605, "fields": 1210, "funcs": 583, "lcom": 115, "lines": 10687, "loc": 8507}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 32, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T07:29:39Z"}
@@ -29,3 +29,4 @@
29 {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "17b9753", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 29, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T04:34:58Z"}29 {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "17b9753", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 29, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T04:34:58Z"}
30 {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a218748", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 30, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T05:21:18Z"}30 {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a218748", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 30, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T05:21:18Z"}
31 {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "fe0695f", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 31, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T07:11:39Z"}31 {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "fe0695f", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 546, "cyclo": 604, "fields": 1209, "funcs": 582, "lcom": 115, "lines": 10669, "loc": 8492}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 31, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T07:11:39Z"}
32+{"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "6e6d79e", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 547, "cyclo": 605, "fields": 1210, "funcs": 583, "lcom": 115, "lines": 10687, "loc": 8507}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 32, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T07:29:39Z"}
added .quality/report-20261126T072939Z.md +73 -0
new file mode 100644
@@ -0,0 +1,73 @@
1+# Quality report — 2026-11-26T07:29:39Z
2+
3+- **Gate**: ✅ **PASS**
4+- **Commit**: `6e6d79e` on `feature/v0.2-openai-server`
5+- **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)
6+- **swiftlint**: 0.65.1 (run directly, merged into lint issues)
7+- **Run**: #32 (previous: 2026-11-26T07:11:39Z)
8+
9+## Lint issues (`qlty check`)
10+
11+_none_
12+
13+### Top rules
14+
15+_none_
16+
17+### Most affected files
18+
19+_none_
20+
21+## Code smells (`qlty smells`)
22+
23+Total: **0** (vs previous: ±0)
24+
25+_none_
26+
27+## Metrics (`qlty metrics`)
28+
29+| metric | total | vs previous |
30+|---|---|---|
31+| funcs | 583 | +1 |
32+| classes | 234 | ±0 |
33+| fields | 1210 | +1 |
34+| cyclo | 605 | +1 |
35+| complex | 547 | +1 |
36+| lcom | 115 | ±0 |
37+| lines | 10687 | +18 |
38+| loc | 8507 | +15 |
39+
40+### Most complex files
41+
42+| file | complex | cyclo | loc |
43+|---|---|---|---|
44+| Sources/RazorbillServer/CompletionsRoute.swift | 47 | 20 | 242 |
45+| Sources/RazorbillServer/Chat/CompletionStream.swift | 31 | 20 | 125 |
46+| experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | 26 | 20 | 285 |
47+| Sources/RazorbillMLX/MLXEngine.swift | 23 | 35 | 246 |
48+| tools/host-runner/host_runner.py | 22 | 22 | 141 |
49+| Sources/RazorbillCore/Config/ConfigValue+JSON.swift | 20 | 25 | 71 |
50+| Sources/RazorbillCore/Config/ServerConfigLoader.swift | 20 | 17 | 227 |
51+| Sources/RazorbillServer/Chat/ToolsAndFormats.swift | 18 | 30 | 170 |
52+| Sources/RazorbillServer/Chat/ChatCompletionRequest.swift | 17 | 24 | 276 |
53+| Sources/RazorbillServer/Chat/ChatCompletionChunk.swift | 16 | 11 | 137 |
54+| Sources/RazorbillServer/ModelManager.swift | 16 | 22 | 220 |
55+| Sources/RazorbillCore/Config/OrderedJSONReader.swift | 15 | 24 | 140 |
56+| Sources/RazorbillCore/Config/GenerationOverrides.swift | 14 | 15 | 67 |
57+| Sources/RazorbillCLI/Commands/ModelsCommand.swift | 13 | 7 | 100 |
58+| Sources/RazorbillServer/EmbeddingsRoute.swift | 13 | 13 | 143 |
59+
60+## Trend
61+
62+| run | timestamp | error | warning | smells | complex | gate |
63+|---|---|---|---|---|---|---|
64+| 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS |
65+| 24 | 2026-11-25T21:37:24Z | 0 | 1 | 1 | 559 | FAIL |
66+| 25 | 2026-11-25T21:37:51Z | 0 | 1 | 0 | 544 | FAIL |
67+| 26 | 2026-11-25T21:38:24Z | 0 | 0 | 0 | 544 | PASS |
68+| 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS |
69+| 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS |
70+| 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS |
71+| 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS |
72+| 31 | 2026-11-26T07:11:39Z | 0 | 0 | 0 | 546 | PASS |
73+| 32 | 2026-11-26T07:29:39Z | 0 | 0 | 0 | 547 | PASS |
new file mode 100644
@@ -0,0 +1,73 @@
1+# Quality report — 2026-11-26T07:29:39Z
2+
3+- **Gate**: ✅ **PASS**
4+- **Commit**: `6e6d79e` on `feature/v0.2-openai-server`
5+- **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)
6+- **swiftlint**: 0.65.1 (run directly, merged into lint issues)
7+- **Run**: #32 (previous: 2026-11-26T07:11:39Z)
8+
9+## Lint issues (`qlty check`)
10+
11+_none_
12+
13+### Top rules
14+
15+_none_
16+
17+### Most affected files
18+
19+_none_
20+
21+## Code smells (`qlty smells`)
22+
23+Total: **0** (vs previous: ±0)
24+
25+_none_
26+
27+## Metrics (`qlty metrics`)
28+
29+| metric | total | vs previous |
30+|---|---|---|
31+| funcs | 583 | +1 |
32+| classes | 234 | ±0 |
33+| fields | 1210 | +1 |
34+| cyclo | 605 | +1 |
35+| complex | 547 | +1 |
36+| lcom | 115 | ±0 |
37+| lines | 10687 | +18 |
38+| loc | 8507 | +15 |
39+
40+### Most complex files
41+
42+| file | complex | cyclo | loc |
43+|---|---|---|---|
44+| Sources/RazorbillServer/CompletionsRoute.swift | 47 | 20 | 242 |
45+| Sources/RazorbillServer/Chat/CompletionStream.swift | 31 | 20 | 125 |
46+| experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | 26 | 20 | 285 |
47+| Sources/RazorbillMLX/MLXEngine.swift | 23 | 35 | 246 |
48+| tools/host-runner/host_runner.py | 22 | 22 | 141 |
49+| Sources/RazorbillCore/Config/ConfigValue+JSON.swift | 20 | 25 | 71 |
50+| Sources/RazorbillCore/Config/ServerConfigLoader.swift | 20 | 17 | 227 |
51+| Sources/RazorbillServer/Chat/ToolsAndFormats.swift | 18 | 30 | 170 |
52+| Sources/RazorbillServer/Chat/ChatCompletionRequest.swift | 17 | 24 | 276 |
53+| Sources/RazorbillServer/Chat/ChatCompletionChunk.swift | 16 | 11 | 137 |
54+| Sources/RazorbillServer/ModelManager.swift | 16 | 22 | 220 |
55+| Sources/RazorbillCore/Config/OrderedJSONReader.swift | 15 | 24 | 140 |
56+| Sources/RazorbillCore/Config/GenerationOverrides.swift | 14 | 15 | 67 |
57+| Sources/RazorbillCLI/Commands/ModelsCommand.swift | 13 | 7 | 100 |
58+| Sources/RazorbillServer/EmbeddingsRoute.swift | 13 | 13 | 143 |
59+
60+## Trend
61+
62+| run | timestamp | error | warning | smells | complex | gate |
63+|---|---|---|---|---|---|---|
64+| 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS |
65+| 24 | 2026-11-25T21:37:24Z | 0 | 1 | 1 | 559 | FAIL |
66+| 25 | 2026-11-25T21:37:51Z | 0 | 1 | 0 | 544 | FAIL |
67+| 26 | 2026-11-25T21:38:24Z | 0 | 0 | 0 | 544 | PASS |
68+| 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS |
69+| 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS |
70+| 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS |
71+| 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS |
72+| 31 | 2026-11-26T07:11:39Z | 0 | 0 | 0 | 546 | PASS |
73+| 32 | 2026-11-26T07:29:39Z | 0 | 0 | 0 | 547 | PASS |
modified .quality/report-latest.md +10 -10
@@ -1,10 +1,10 @@
1-# Quality report — 2026-11-26T07:11:39Z
1+# Quality report — 2026-11-26T07:29:39Z
22
33 - **Gate**: ✅ **PASS**
4-- **Commit**: `fe0695f` on `feature/v0.2-openai-server`
4+- **Commit**: `6e6d79e` on `feature/v0.2-openai-server`
55 - **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)
66 - **swiftlint**: 0.65.1 (run directly, merged into lint issues)
7-- **Run**: #31 (previous: 2026-11-26T05:21:18Z)
7+- **Run**: #32 (previous: 2026-11-26T07:11:39Z)
88
99 ## Lint issues (`qlty check`)
1010
@@ -28,14 +28,14 @@ _none_
2828
2929 | metric | total | vs previous |
3030 |---|---|---|
31-| funcs | 582 | ±0 |
31+| funcs | 583 | +1 |
3232 | classes | 234 | ±0 |
33-| fields | 1209 | ±0 |
34-| cyclo | 604 | ±0 |
35-| complex | 546 | ±0 |
33+| fields | 1210 | +1 |
34+| cyclo | 605 | +1 |
35+| complex | 547 | +1 |
3636 | lcom | 115 | ±0 |
37-| lines | 10669 | ±0 |
38-| loc | 8492 | ±0 |
37+| lines | 10687 | +18 |
38+| loc | 8507 | +15 |
3939
4040 ### Most complex files
4141
@@ -61,7 +61,6 @@ _none_
6161
6262 | run | timestamp | error | warning | smells | complex | gate |
6363 |---|---|---|---|---|---|---|
64-| 22 | 2026-11-25T21:27:49Z | 4 | 1 | 0 | 538 | FAIL |
6564 | 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS |
6665 | 24 | 2026-11-25T21:37:24Z | 0 | 1 | 1 | 559 | FAIL |
6766 | 25 | 2026-11-25T21:37:51Z | 0 | 1 | 0 | 544 | FAIL |
@@ -71,3 +70,4 @@ _none_
7170 | 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS |
7271 | 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS |
7372 | 31 | 2026-11-26T07:11:39Z | 0 | 0 | 0 | 546 | PASS |
73+| 32 | 2026-11-26T07:29:39Z | 0 | 0 | 0 | 547 | PASS |
@@ -1,10 +1,10 @@
1-# Quality report — 2026-11-26T07:11:39Z1+# Quality report — 2026-11-26T07:29:39Z
2 2
3 - **Gate**: ✅ **PASS**3 - **Gate**: ✅ **PASS**
4-- **Commit**: `fe0695f` on `feature/v0.2-openai-server`4+- **Commit**: `6e6d79e` on `feature/v0.2-openai-server`
5 - **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)5 - **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)
6 - **swiftlint**: 0.65.1 (run directly, merged into lint issues)6 - **swiftlint**: 0.65.1 (run directly, merged into lint issues)
7-- **Run**: #31 (previous: 2026-11-26T05:21:18Z)7+- **Run**: #32 (previous: 2026-11-26T07:11:39Z)
8 8
9 ## Lint issues (`qlty check`)9 ## Lint issues (`qlty check`)
10 10
@@ -28,14 +28,14 @@ _none_
28 28
29 | metric | total | vs previous |29 | metric | total | vs previous |
30 |---|---|---|30 |---|---|---|
31-| funcs | 582 | ±0 |31+| funcs | 583 | +1 |
32 | classes | 234 | ±0 |32 | classes | 234 | ±0 |
33-| fields | 1209 | ±0 |33+| fields | 1210 | +1 |
34-| cyclo | 604 | ±0 |34+| cyclo | 605 | +1 |
35-| complex | 546 | ±0 |35+| complex | 547 | +1 |
36 | lcom | 115 | ±0 |36 | lcom | 115 | ±0 |
37-| lines | 10669 | ±0 |37+| lines | 10687 | +18 |
38-| loc | 8492 | ±0 |38+| loc | 8507 | +15 |
39 39
40 ### Most complex files40 ### Most complex files
41 41
@@ -61,7 +61,6 @@ _none_
61 61
62 | run | timestamp | error | warning | smells | complex | gate |62 | run | timestamp | error | warning | smells | complex | gate |
63 |---|---|---|---|---|---|---|63 |---|---|---|---|---|---|---|
64-| 22 | 2026-11-25T21:27:49Z | 4 | 1 | 0 | 538 | FAIL |
65 | 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS |64 | 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS |
66 | 24 | 2026-11-25T21:37:24Z | 0 | 1 | 1 | 559 | FAIL |65 | 24 | 2026-11-25T21:37:24Z | 0 | 1 | 1 | 559 | FAIL |
67 | 25 | 2026-11-25T21:37:51Z | 0 | 1 | 0 | 544 | FAIL |66 | 25 | 2026-11-25T21:37:51Z | 0 | 1 | 0 | 544 | FAIL |
@@ -71,3 +70,4 @@ _none_
71 | 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS |70 | 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS |
72 | 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS |71 | 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS |
73 | 31 | 2026-11-26T07:11:39Z | 0 | 0 | 0 | 546 | PASS |72 | 31 | 2026-11-26T07:11:39Z | 0 | 0 | 0 | 546 | PASS |
73+| 32 | 2026-11-26T07:29:39Z | 0 | 0 | 0 | 547 | PASS |
modified .tickets/issues/0054-tui-foundation-rzb-tui-screens-server-client.yaml +1 -1
@@ -19,7 +19,7 @@ related:
1919 - 53
2020 - 16
2121 body: |
22- `rzb tui [--url http://127.0.0.1:8080] [--config server.yaml] [--api-key-env RZB_API_KEY]`: a full-screen app with four screens (Chat, Dashboard, Models, Settings), switched by keys (e.g. F1–F4 or Tab), and a status bar (server reachable or not, model, memory).
22+ `rzb tui [--url http://127.0.0.1:7920] [--config server.yaml] [--api-key-env RZB_API_KEY]`: a full-screen app with four screens (Chat, Dashboard, Models, Settings), switched by keys (e.g. F1–F4 or Tab), and a status bar (server reachable or not, model, memory).
2323
2424 - Bring back from tag `v0.1-agent` (`Sources/RazorbillTUI`): `Terminal` / `PosixTerminal`, `Key`, `TextLayout`, and the pattern pure state + `handle(key) -> Action` + pure renderer, tested on Linux with a fake terminal.
2525 - New: screen routing, list and form widgets, a small HTTP client for the server (OpenAI SSE + `/rzb/*`), a clear "server not running" state with the command to start it.
@@ -19,7 +19,7 @@ related:
19 - 5319 - 53
20 - 1620 - 16
21 body: |21 body: |
22- `rzb tui [--url http://127.0.0.1:8080] [--config server.yaml] [--api-key-env RZB_API_KEY]`: a full-screen app with four screens (Chat, Dashboard, Models, Settings), switched by keys (e.g. F1–F4 or Tab), and a status bar (server reachable or not, model, memory).22+ `rzb tui [--url http://127.0.0.1:7920] [--config server.yaml] [--api-key-env RZB_API_KEY]`: a full-screen app with four screens (Chat, Dashboard, Models, Settings), switched by keys (e.g. F1–F4 or Tab), and a status bar (server reachable or not, model, memory).
23 23
24 - Bring back from tag `v0.1-agent` (`Sources/RazorbillTUI`): `Terminal` / `PosixTerminal`, `Key`, `TextLayout`, and the pattern pure state + `handle(key) -> Action` + pure renderer, tested on Linux with a fake terminal.24 - Bring back from tag `v0.1-agent` (`Sources/RazorbillTUI`): `Terminal` / `PosixTerminal`, `Key`, `TextLayout`, and the pattern pure state + `handle(key) -> Action` + pure renderer, tested on Linux with a fake terminal.
25 - New: screen routing, list and form widgets, a small HTTP client for the server (OpenAI SSE + `/rzb/*`), a clear "server not running" state with the command to start it.25 - New: screen routing, list and form widgets, a small HTTP client for the server (OpenAI SSE + `/rzb/*`), a clear "server not running" state with the command to start it.
modified README.md +2 -2
@@ -10,13 +10,13 @@ razorbill is a model server for the Mac. Its command is **`rzb`**. It runs langu
1010
1111 ```bash
1212 rzb models pull mlx-community/Qwen3-4B-4bit
13-rzb serve # http://127.0.0.1:8080/v1
13+rzb serve # http://127.0.0.1:7920/v1
1414 ```
1515
1616 ```python
1717 from openai import OpenAI
1818
19-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")
19+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
2020 answer = client.chat.completions.create(
2121 model="mlx-community/Qwen3-4B-4bit",
2222 messages=[{"role": "user", "content": "Explain Swift actors in 3 lines."}],
@@ -10,13 +10,13 @@ razorbill is a model server for the Mac. Its command is **`rzb`**. It runs langu
10 10
11 ```bash11 ```bash
12 rzb models pull mlx-community/Qwen3-4B-4bit12 rzb models pull mlx-community/Qwen3-4B-4bit
13-rzb serve # http://127.0.0.1:8080/v113+rzb serve # http://127.0.0.1:7920/v1
14 ```14 ```
15 15
16 ```python16 ```python
17 from openai import OpenAI17 from openai import OpenAI
18 18
19-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")19+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
20 answer = client.chat.completions.create(20 answer = client.chat.completions.create(
21 model="mlx-community/Qwen3-4B-4bit",21 model="mlx-community/Qwen3-4B-4bit",
22 messages=[{"role": "user", "content": "Explain Swift actors in 3 lines."}],22 messages=[{"role": "user", "content": "Explain Swift actors in 3 lines."}],
modified Sources/RazorbillCLI/Commands/ServeCommand.swift +2 -2
@@ -5,7 +5,7 @@ import RazorbillServer
55 /// `rzb serve`: starts the OpenAI-compatible server until Ctrl-C or SIGTERM.
66 ///
77 /// ```sh
8-/// rzb serve # http://127.0.0.1:8080/v1, this Mac only
8+/// rzb serve # http://127.0.0.1:7920/v1, this Mac only
99 /// RZB_API_KEY=s3cret rzb serve --host 0.0.0.0 # the whole network, with a key
1010 /// ```
1111 struct ServeCommand: AsyncParsableCommand {
@@ -26,7 +26,7 @@ struct ServeCommand: AsyncParsableCommand {
2626 @Option(help: "Address to listen on, 0.0.0.0 for every network interface. (default: 127.0.0.1)")
2727 var host: String?
2828
29- @Option(help: "TCP port. (default: 8080)")
29+ @Option(help: "TCP port. (default: 7920)")
3030 var port: Int?
3131
3232 @Option(
@@ -5,7 +5,7 @@ import RazorbillServer
5 /// `rzb serve`: starts the OpenAI-compatible server until Ctrl-C or SIGTERM.5 /// `rzb serve`: starts the OpenAI-compatible server until Ctrl-C or SIGTERM.
6 ///6 ///
7 /// ```sh7 /// ```sh
8-/// rzb serve # http://127.0.0.1:8080/v1, this Mac only8+/// rzb serve # http://127.0.0.1:7920/v1, this Mac only
9 /// RZB_API_KEY=s3cret rzb serve --host 0.0.0.0 # the whole network, with a key9 /// RZB_API_KEY=s3cret rzb serve --host 0.0.0.0 # the whole network, with a key
10 /// ```10 /// ```
11 struct ServeCommand: AsyncParsableCommand {11 struct ServeCommand: AsyncParsableCommand {
@@ -26,7 +26,7 @@ struct ServeCommand: AsyncParsableCommand {
26 @Option(help: "Address to listen on, 0.0.0.0 for every network interface. (default: 127.0.0.1)")26 @Option(help: "Address to listen on, 0.0.0.0 for every network interface. (default: 127.0.0.1)")
27 var host: String?27 var host: String?
28 28
29- @Option(help: "TCP port. (default: 8080)")29+ @Option(help: "TCP port. (default: 7920)")
30 var port: Int?30 var port: Int?
31 31
32 @Option(32 @Option(
modified Sources/RazorbillCore/Config/ServerConfig.swift +1 -1
@@ -6,7 +6,7 @@ import Foundation
66 /// ```yaml
77 /// server:
88 /// host: 127.0.0.1
9-/// port: 8080
9+/// port: 7920
1010 /// api_key_env: RZB_API_KEY
1111 /// defaults: { temperature: 0.6 }
1212 /// locked: { max_tokens: 4096 }
@@ -6,7 +6,7 @@ import Foundation
6 /// ```yaml6 /// ```yaml
7 /// server:7 /// server:
8 /// host: 127.0.0.18 /// host: 127.0.0.1
9-/// port: 80809+/// port: 7920
10 /// api_key_env: RZB_API_KEY10 /// api_key_env: RZB_API_KEY
11 /// defaults: { temperature: 0.6 }11 /// defaults: { temperature: 0.6 }
12 /// locked: { max_tokens: 4096 }12 /// locked: { max_tokens: 4096 }
modified Sources/RazorbillServer/OpenAIError.swift +10 -4
@@ -104,13 +104,19 @@ extension OpenAIError {
104104 code: "model_not_found")
105105 }
106106
107- /// 404: no endpoint at this method and path.
107+ /// 404: no endpoint at this method and path. A call to the base URL itself (`/`, `/v1`) gets
108+ /// a hint: it is what clients are configured with, and easy to try by hand.
108109 static func unknownRoute(_ request: Request) -> OpenAIError {
109- OpenAIError(
110- .notFound, message: "Invalid URL (\(request.method) \(request.uri.path))",
111- code: "unknown_url")
110+ var message = "Invalid URL (\(request.method) \(request.uri.path))"
111+ if baseURLPaths.contains(request.uri.path) {
112+ message += ". /v1 is the base URL of the API: clients add the endpoint to it,"
113+ + " e.g. GET /v1/models or POST /v1/chat/completions."
114+ }
115+ return OpenAIError(.notFound, message: message, code: "unknown_url")
112116 }
113117
118+ private static let baseURLPaths: Set<String> = ["/", "/v1", "/v1/"]
119+
114120 /// Any other error, mapped by status. Unknown errors become 500 without leaking details.
115121 /// Hummingbird's own 404, thrown when no route matches (handlers throw ``modelNotFound``).
116122 private static func isRouteNotFound(_ error: any Error) -> Bool {
@@ -104,13 +104,19 @@ extension OpenAIError {
104 code: "model_not_found")104 code: "model_not_found")
105 }105 }
106 106
107- /// 404: no endpoint at this method and path.107+ /// 404: no endpoint at this method and path. A call to the base URL itself (`/`, `/v1`) gets
108+ /// a hint: it is what clients are configured with, and easy to try by hand.
108 static func unknownRoute(_ request: Request) -> OpenAIError {109 static func unknownRoute(_ request: Request) -> OpenAIError {
109- OpenAIError(110+ var message = "Invalid URL (\(request.method) \(request.uri.path))"
110- .notFound, message: "Invalid URL (\(request.method) \(request.uri.path))",111+ if baseURLPaths.contains(request.uri.path) {
111- code: "unknown_url")112+ message += ". /v1 is the base URL of the API: clients add the endpoint to it,"
113+ + " e.g. GET /v1/models or POST /v1/chat/completions."
114+ }
115+ return OpenAIError(.notFound, message: message, code: "unknown_url")
112 }116 }
113 117
118+ private static let baseURLPaths: Set<String> = ["/", "/v1", "/v1/"]
119+
114 /// Any other error, mapped by status. Unknown errors become 500 without leaking details.120 /// Any other error, mapped by status. Unknown errors become 500 without leaking details.
115 /// Hummingbird's own 404, thrown when no route matches (handlers throw ``modelNotFound``).121 /// Hummingbird's own 404, thrown when no route matches (handlers throw ``modelNotFound``).
116 private static func isRouteNotFound(_ error: any Error) -> Bool {122 private static func isRouteNotFound(_ error: any Error) -> Bool {
modified Sources/RazorbillServer/RazorbillServer.swift +1 -1
@@ -7,7 +7,7 @@ import ServiceLifecycle
77 ///
88 /// ```swift
99 /// try await RazorbillServer.run(
10-/// ServerSettings(port: 8080), engines: engines, store: ModelStore(), logger: logger
10+/// ServerSettings(port: 7920), engines: engines, store: ModelStore(), logger: logger
1111 /// ) { port in print("listening on \(port)") }
1212 /// ```
1313 ///
@@ -7,7 +7,7 @@ import ServiceLifecycle
7 ///7 ///
8 /// ```swift8 /// ```swift
9 /// try await RazorbillServer.run(9 /// try await RazorbillServer.run(
10-/// ServerSettings(port: 8080), engines: engines, store: ModelStore(), logger: logger10+/// ServerSettings(port: 7920), engines: engines, store: ModelStore(), logger: logger
11 /// ) { port in print("listening on \(port)") }11 /// ) { port in print("listening on \(port)") }
12 /// ```12 /// ```
13 ///13 ///
modified Sources/RazorbillServer/ServerSettings.swift +3 -3
@@ -3,7 +3,7 @@ import RazorbillCore
33 /// How `rzb serve` listens and who it accepts.
44 ///
55 /// ```swift
6-/// var settings = ServerSettings() // 127.0.0.1:8080, no API key, no CORS
6+/// var settings = ServerSettings() // 127.0.0.1:7920, no API key, no CORS
77 /// settings.host = "0.0.0.0"
88 /// settings.apiKey = "secret"
99 /// print(settings.warnings) // [] — a key protects the network address
@@ -21,7 +21,7 @@ public struct ServerSettings: Sendable, Equatable {
2121 public var config: ServerConfig
2222
2323 public init(
24- host: String = "127.0.0.1", port: Int = 8080, apiKey: String? = nil,
24+ host: String = "127.0.0.1", port: Int = 7920, apiKey: String? = nil,
2525 corsOrigin: String? = nil, config: ServerConfig = ServerConfig()
2626 ) {
2727 self.host = host
@@ -50,7 +50,7 @@ public struct ServerSettings: Sendable, Equatable {
5050 return warnings
5151 }
5252
53- /// The base URL clients use, e.g. `http://127.0.0.1:8080/v1`.
53+ /// The base URL clients use, e.g. `http://127.0.0.1:7920/v1`.
5454 public func baseURL(port actualPort: Int? = nil) -> String {
5555 let shownHost = host.contains(":") ? "[\(host)]" : host
5656 return "http://\(shownHost):\(actualPort ?? port)/v1"
@@ -3,7 +3,7 @@ import RazorbillCore
3 /// How `rzb serve` listens and who it accepts.3 /// How `rzb serve` listens and who it accepts.
4 ///4 ///
5 /// ```swift5 /// ```swift
6-/// var settings = ServerSettings() // 127.0.0.1:8080, no API key, no CORS6+/// var settings = ServerSettings() // 127.0.0.1:7920, no API key, no CORS
7 /// settings.host = "0.0.0.0"7 /// settings.host = "0.0.0.0"
8 /// settings.apiKey = "secret"8 /// settings.apiKey = "secret"
9 /// print(settings.warnings) // [] — a key protects the network address9 /// print(settings.warnings) // [] — a key protects the network address
@@ -21,7 +21,7 @@ public struct ServerSettings: Sendable, Equatable {
21 public var config: ServerConfig21 public var config: ServerConfig
22 22
23 public init(23 public init(
24- host: String = "127.0.0.1", port: Int = 8080, apiKey: String? = nil,24+ host: String = "127.0.0.1", port: Int = 7920, apiKey: String? = nil,
25 corsOrigin: String? = nil, config: ServerConfig = ServerConfig()25 corsOrigin: String? = nil, config: ServerConfig = ServerConfig()
26 ) {26 ) {
27 self.host = host27 self.host = host
@@ -50,7 +50,7 @@ public struct ServerSettings: Sendable, Equatable {
50 return warnings50 return warnings
51 }51 }
52 52
53- /// The base URL clients use, e.g. `http://127.0.0.1:8080/v1`.53+ /// The base URL clients use, e.g. `http://127.0.0.1:7920/v1`.
54 public func baseURL(port actualPort: Int? = nil) -> String {54 public func baseURL(port actualPort: Int? = nil) -> String {
55 let shownHost = host.contains(":") ? "[\(host)]" : host55 let shownHost = host.contains(":") ? "[\(host)]" : host
56 return "http://\(shownHost):\(actualPort ?? port)/v1"56 return "http://\(shownHost):\(actualPort ?? port)/v1"
modified Tests/Compatibility/conftest.py +1 -1
@@ -18,7 +18,7 @@ import httpx
1818 import pytest
1919 from openai import OpenAI
2020
21-BASE_URL = os.environ.get("RZB_URL", "http://127.0.0.1:8080/v1")
21+BASE_URL = os.environ.get("RZB_URL", "http://127.0.0.1:7920/v1")
2222 API_KEY = os.environ.get("RZB_API_KEY", "unused")
2323 # What `embed` is (scripts/compat.sh exports it): reference values exist for bge-small only.
2424 EMBED_SOURCE = os.environ.get("RZB_COMPAT_EMBED_SOURCE", "BAAI/bge-small-en-v1.5")
@@ -18,7 +18,7 @@ import httpx
18 import pytest18 import pytest
19 from openai import OpenAI19 from openai import OpenAI
20 20
21-BASE_URL = os.environ.get("RZB_URL", "http://127.0.0.1:8080/v1")21+BASE_URL = os.environ.get("RZB_URL", "http://127.0.0.1:7920/v1")
22 API_KEY = os.environ.get("RZB_API_KEY", "unused")22 API_KEY = os.environ.get("RZB_API_KEY", "unused")
23 # What `embed` is (scripts/compat.sh exports it): reference values exist for bge-small only.23 # What `embed` is (scripts/compat.sh exports it): reference values exist for bge-small only.
24 EMBED_SOURCE = os.environ.get("RZB_COMPAT_EMBED_SOURCE", "BAAI/bge-small-en-v1.5")24 EMBED_SOURCE = os.environ.get("RZB_COMPAT_EMBED_SOURCE", "BAAI/bge-small-en-v1.5")
modified Tests/Compatibility/test_docs_curl.py +2 -2
@@ -1,6 +1,6 @@
11 """The `curl` examples of the API reference run against the server and answer without error.
22
3-Every fenced `bash` block of `docs/*/reference/*.md` that calls `http://127.0.0.1:8080/v1` is
3+Every fenced `bash` block of `docs/*/reference/*.md` that calls `http://127.0.0.1:7920/v1` is
44 run, with the address replaced by the server under test and the documentation's models by the
55 suite's (`chat`, `embed`). An example that needs a real model says so with a `# real model`
66 comment in its block.
@@ -17,7 +17,7 @@ import pytest
1717 from conftest import BASE_URL
1818
1919 ROOT = Path(__file__).resolve().parents[2]
20-DOCS_ADDRESS = "http://127.0.0.1:8080/v1"
20+DOCS_ADDRESS = "http://127.0.0.1:7920/v1"
2121 DOCS_MODELS = {
2222 "mlx-community/Qwen3-4B-4bit": "chat",
2323 "BAAI/bge-small-en-v1.5": "embed",
@@ -1,6 +1,6 @@
1 """The `curl` examples of the API reference run against the server and answer without error.1 """The `curl` examples of the API reference run against the server and answer without error.
2 2
3-Every fenced `bash` block of `docs/*/reference/*.md` that calls `http://127.0.0.1:8080/v1` is3+Every fenced `bash` block of `docs/*/reference/*.md` that calls `http://127.0.0.1:7920/v1` is
4 run, with the address replaced by the server under test and the documentation's models by the4 run, with the address replaced by the server under test and the documentation's models by the
5 suite's (`chat`, `embed`). An example that needs a real model says so with a `# real model`5 suite's (`chat`, `embed`). An example that needs a real model says so with a `# real model`
6 comment in its block.6 comment in its block.
@@ -17,7 +17,7 @@ import pytest
17 from conftest import BASE_URL17 from conftest import BASE_URL
18 18
19 ROOT = Path(__file__).resolve().parents[2]19 ROOT = Path(__file__).resolve().parents[2]
20-DOCS_ADDRESS = "http://127.0.0.1:8080/v1"20+DOCS_ADDRESS = "http://127.0.0.1:7920/v1"
21 DOCS_MODELS = {21 DOCS_MODELS = {
22 "mlx-community/Qwen3-4B-4bit": "chat",22 "mlx-community/Qwen3-4B-4bit": "chat",
23 "BAAI/bge-small-en-v1.5": "embed",23 "BAAI/bge-small-en-v1.5": "embed",
modified Tests/RazorbillCLITests/ServeCommandTests.swift +1 -1
@@ -12,7 +12,7 @@ import Testing
1212 #expect(result.exitCode == 0)
1313 #expect(world.servers.started == [ServerSettings()])
1414 #expect(
15- result.stderr.contains("serving http://127.0.0.1:8080/v1 (no API key) — Ctrl-C to stop")
15+ result.stderr.contains("serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop")
1616 )
1717 #expect(!result.stderr.contains("warning"))
1818 }
@@ -12,7 +12,7 @@ import Testing
12 #expect(result.exitCode == 0)12 #expect(result.exitCode == 0)
13 #expect(world.servers.started == [ServerSettings()])13 #expect(world.servers.started == [ServerSettings()])
14 #expect(14 #expect(
15- result.stderr.contains("serving http://127.0.0.1:8080/v1 (no API key) — Ctrl-C to stop")15+ result.stderr.contains("serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop")
16 )16 )
17 #expect(!result.stderr.contains("warning"))17 #expect(!result.stderr.contains("warning"))
18 }18 }
modified Tests/RazorbillServerTests/ServerTests.swift +14 -2
@@ -80,6 +80,18 @@ struct ErrorBody: Decodable {
8080 }
8181 }
8282
83+ @Test(arguments: ["/", "/v1", "/v1/"]) func theBaseURLAnswersWithAHint(path: String) async throws {
84+ try await withLiveServer { client in
85+ try await client.execute(uri: path, method: .get) { response in
86+ #expect(response.status == .notFound)
87+ let body = try ErrorBody(response)
88+ #expect(body.error.code == "unknown_url")
89+ #expect(body.error.message.hasPrefix("Invalid URL (GET \(path)). /v1 is the base URL"))
90+ #expect(body.error.message.contains("GET /v1/models"))
91+ }
92+ }
93+ }
94+
8395 @Test func envelopeWritesNullParamAndCode() throws {
8496 let json = String(bytes: OpenAIError(.badRequest, message: "bad").json(), encoding: .utf8)
8597 #expect(
@@ -290,9 +302,9 @@ struct ErrorBody: Decodable {
290302 @Suite struct ServerSettingsTests {
291303 @Test func defaultsAreLocalOnly() {
292304 let settings = ServerSettings()
293- #expect(settings.host == "127.0.0.1" && settings.port == 8080)
305+ #expect(settings.host == "127.0.0.1" && settings.port == 7920)
294306 #expect(settings.isLoopback && settings.warnings.isEmpty)
295- #expect(settings.baseURL() == "http://127.0.0.1:8080/v1")
307+ #expect(settings.baseURL() == "http://127.0.0.1:7920/v1")
296308 }
297309
298310 @Test func networkAddressWithoutKeyWarns() {
@@ -80,6 +80,18 @@ struct ErrorBody: Decodable {
80 }80 }
81 }81 }
82 82
83+ @Test(arguments: ["/", "/v1", "/v1/"]) func theBaseURLAnswersWithAHint(path: String) async throws {
84+ try await withLiveServer { client in
85+ try await client.execute(uri: path, method: .get) { response in
86+ #expect(response.status == .notFound)
87+ let body = try ErrorBody(response)
88+ #expect(body.error.code == "unknown_url")
89+ #expect(body.error.message.hasPrefix("Invalid URL (GET \(path)). /v1 is the base URL"))
90+ #expect(body.error.message.contains("GET /v1/models"))
91+ }
92+ }
93+ }
94+
83 @Test func envelopeWritesNullParamAndCode() throws {95 @Test func envelopeWritesNullParamAndCode() throws {
84 let json = String(bytes: OpenAIError(.badRequest, message: "bad").json(), encoding: .utf8)96 let json = String(bytes: OpenAIError(.badRequest, message: "bad").json(), encoding: .utf8)
85 #expect(97 #expect(
@@ -290,9 +302,9 @@ struct ErrorBody: Decodable {
290 @Suite struct ServerSettingsTests {302 @Suite struct ServerSettingsTests {
291 @Test func defaultsAreLocalOnly() {303 @Test func defaultsAreLocalOnly() {
292 let settings = ServerSettings()304 let settings = ServerSettings()
293- #expect(settings.host == "127.0.0.1" && settings.port == 8080)305+ #expect(settings.host == "127.0.0.1" && settings.port == 7920)
294 #expect(settings.isLoopback && settings.warnings.isEmpty)306 #expect(settings.isLoopback && settings.warnings.isEmpty)
295- #expect(settings.baseURL() == "http://127.0.0.1:8080/v1")307+ #expect(settings.baseURL() == "http://127.0.0.1:7920/v1")
296 }308 }
297 309
298 @Test func networkAddressWithoutKeyWarns() {310 @Test func networkAddressWithoutKeyWarns() {
modified docs/en/how-to/compute-embeddings.md +2 -2
@@ -26,7 +26,7 @@ Declared, it is listed as `"kind": "embedding"` by `/v1/models`, and a chat requ
2626 ```python
2727 from openai import OpenAI
2828
29-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")
29+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
3030 result = client.embeddings.create(model="embed", input=["The cat sits on the mat.", "A feline rests on a rug."])
3131 vectors = [item.embedding for item in result.data]
3232 ```
@@ -37,7 +37,7 @@ Vectors are normalised: their dot product is their cosine similarity.
3737
3838 - **Shorter vectors**: `dimensions=256` keeps the first 256 values and renormalises them. Meaningful for Matryoshka models (Qwen3-Embedding, nomic…); for others it loses quality.
3939 - **Smaller responses**: `encoding_format="base64"` (the openai library asks for it by default and decodes it for you).
40-- **LangChain**: `OpenAIEmbeddings(base_url="http://127.0.0.1:8080/v1", api_key="unused", model="embed", check_embedding_ctx_length=False)`. Without `check_embedding_ctx_length=False`, LangChain sends token arrays, which the server refuses.
40+- **LangChain**: `OpenAIEmbeddings(base_url="http://127.0.0.1:7920/v1", api_key="unused", model="embed", check_embedding_ctx_length=False)`. Without `check_embedding_ctx_length=False`, LangChain sends token arrays, which the server refuses.
4141 - **Long texts**: a text longer than the model accepts (512 tokens for bge-small) is a 400 naming it. Split your documents first.
4242 - **Query prefixes**: models that expect a prefix (`query: `, `search_query: `, an instruction) need it in your text; the server adds nothing.
4343 - **Chat and embeddings together**: set `limits.max_loaded_models: 2` so the two models stay loaded.
@@ -26,7 +26,7 @@ Declared, it is listed as `"kind": "embedding"` by `/v1/models`, and a chat requ
26 ```python26 ```python
27 from openai import OpenAI27 from openai import OpenAI
28 28
29-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")29+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
30 result = client.embeddings.create(model="embed", input=["The cat sits on the mat.", "A feline rests on a rug."])30 result = client.embeddings.create(model="embed", input=["The cat sits on the mat.", "A feline rests on a rug."])
31 vectors = [item.embedding for item in result.data]31 vectors = [item.embedding for item in result.data]
32 ```32 ```
@@ -37,7 +37,7 @@ Vectors are normalised: their dot product is their cosine similarity.
37 37
38 - **Shorter vectors**: `dimensions=256` keeps the first 256 values and renormalises them. Meaningful for Matryoshka models (Qwen3-Embedding, nomic…); for others it loses quality.38 - **Shorter vectors**: `dimensions=256` keeps the first 256 values and renormalises them. Meaningful for Matryoshka models (Qwen3-Embedding, nomic…); for others it loses quality.
39 - **Smaller responses**: `encoding_format="base64"` (the openai library asks for it by default and decodes it for you).39 - **Smaller responses**: `encoding_format="base64"` (the openai library asks for it by default and decodes it for you).
40-- **LangChain**: `OpenAIEmbeddings(base_url="http://127.0.0.1:8080/v1", api_key="unused", model="embed", check_embedding_ctx_length=False)`. Without `check_embedding_ctx_length=False`, LangChain sends token arrays, which the server refuses.40+- **LangChain**: `OpenAIEmbeddings(base_url="http://127.0.0.1:7920/v1", api_key="unused", model="embed", check_embedding_ctx_length=False)`. Without `check_embedding_ctx_length=False`, LangChain sends token arrays, which the server refuses.
41 - **Long texts**: a text longer than the model accepts (512 tokens for bge-small) is a 400 naming it. Split your documents first.41 - **Long texts**: a text longer than the model accepts (512 tokens for bge-small) is a 400 naming it. Split your documents first.
42 - **Query prefixes**: models that expect a prefix (`query: `, `search_query: `, an instruction) need it in your text; the server adds nothing.42 - **Query prefixes**: models that expect a prefix (`query: `, `search_query: `, an instruction) need it in your text; the server adds nothing.
43 - **Chat and embeddings together**: set `limits.max_loaded_models: 2` so the two models stay loaded.43 - **Chat and embeddings together**: set `limits.max_loaded_models: 2` so the two models stay loaded.
modified docs/en/how-to/develop-from-a-sandbox.md +1 -1
@@ -52,7 +52,7 @@ The script's exit code is the command's exit code on the Mac, so it can be chain
5252
5353 ## Limits
5454
55-- `host.sh run` has no terminal, and waits for the command to end: do not use it for `rzb serve`. Killing `host.sh` in the sandbox does not stop the server on the Mac, and host-runner then answers 409 to everything until you stop `rzb serve` on the Mac. Start the server in a terminal on the Mac instead; the sandbox reaches it at `http://host.docker.internal:8080/v1` (allow it once with `sbx policy allow network localhost:8080`).
55+- `host.sh run` has no terminal, and waits for the command to end: do not use it for `rzb serve`. Killing `host.sh` in the sandbox does not stop the server on the Mac, and host-runner then answers 409 to everything until you stop `rzb serve` on the Mac. Start the server in a terminal on the Mac instead; the sandbox reaches it at `http://host.docker.internal:7920/v1` (allow it once with `sbx policy allow network localhost:7920`).
5656 - host-runner runs one command at a time (a second request gets HTTP 409) and only knows `list`, `build`, `test`, `run`, `resolve` and `clean`, on `.` or `experiments/<name>`.
5757 - Models are downloaded into the **Mac's** Hugging Face cache; the sandbox cannot see it.
5858
@@ -52,7 +52,7 @@ The script's exit code is the command's exit code on the Mac, so it can be chain
52 52
53 ## Limits53 ## Limits
54 54
55-- `host.sh run` has no terminal, and waits for the command to end: do not use it for `rzb serve`. Killing `host.sh` in the sandbox does not stop the server on the Mac, and host-runner then answers 409 to everything until you stop `rzb serve` on the Mac. Start the server in a terminal on the Mac instead; the sandbox reaches it at `http://host.docker.internal:8080/v1` (allow it once with `sbx policy allow network localhost:8080`).55+- `host.sh run` has no terminal, and waits for the command to end: do not use it for `rzb serve`. Killing `host.sh` in the sandbox does not stop the server on the Mac, and host-runner then answers 409 to everything until you stop `rzb serve` on the Mac. Start the server in a terminal on the Mac instead; the sandbox reaches it at `http://host.docker.internal:7920/v1` (allow it once with `sbx policy allow network localhost:7920`).
56 - host-runner runs one command at a time (a second request gets HTTP 409) and only knows `list`, `build`, `test`, `run`, `resolve` and `clean`, on `.` or `experiments/<name>`.56 - host-runner runs one command at a time (a second request gets HTTP 409) and only knows `list`, `build`, `test`, `run`, `resolve` and `clean`, on `.` or `experiments/<name>`.
57 - Models are downloaded into the **Mac's** Hugging Face cache; the sandbox cannot see it.57 - Models are downloaded into the **Mac's** Hugging Face cache; the sandbox cannot see it.
58 58
modified docs/en/how-to/get-structured-output.md +1 -1
@@ -14,7 +14,7 @@ class City(BaseModel):
1414 population: int
1515 landmarks: list[str]
1616
17-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")
17+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
1818 completion = client.beta.chat.completions.parse(
1919 model="mlx-community/Qwen3-4B-4bit",
2020 messages=[{"role": "user", "content": "Describe Lyon, France."}],
@@ -14,7 +14,7 @@ class City(BaseModel):
14 population: int14 population: int
15 landmarks: list[str]15 landmarks: list[str]
16 16
17-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")17+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
18 completion = client.beta.chat.completions.parse(18 completion = client.beta.chat.completions.parse(
19 model="mlx-community/Qwen3-4B-4bit",19 model="mlx-community/Qwen3-4B-4bit",
20 messages=[{"role": "user", "content": "Describe Lyon, France."}],20 messages=[{"role": "user", "content": "Describe Lyon, France."}],
modified docs/en/how-to/run-the-tests.md +1 -1
@@ -42,7 +42,7 @@ It starts `rzb serve` on port 18080 with a configuration of its own, runs `Tests
4242
4343 - **On the Mac** the server runs MLX: pull `mlx-community/Qwen3-4B-4bit` and `BAAI/bge-small-en-v1.5` first. `mlx-community/Llama-3.2-3B-Instruct-4bit`, when cached, adds the tests of a second tool-call family. The script rebuilds `rzb` (incrementally) before running.
4444 - **On Linux** the server runs the fake engine: the protocol is checked (shapes, streaming, errors) and the tests that need a real model are skipped.
45-- **Against a server you started**: `RZB_URL=http://127.0.0.1:8080/v1 scripts/compat.sh`. It must declare the ids `chat` and `embed` (and optionally `unforced`).
45+- **Against a server you started**: `RZB_URL=http://127.0.0.1:7920/v1 scripts/compat.sh`. It must declare the ids `chat` and `embed` (and optionally `unforced`).
4646 - Other models: `RZB_COMPAT_CHAT_SOURCE`, `RZB_COMPAT_EMBED_SOURCE`, `RZB_COMPAT_UNFORCED_SOURCE`.
4747
4848 ## Run the tests of the host-runner tool
@@ -42,7 +42,7 @@ It starts `rzb serve` on port 18080 with a configuration of its own, runs `Tests
42 42
43 - **On the Mac** the server runs MLX: pull `mlx-community/Qwen3-4B-4bit` and `BAAI/bge-small-en-v1.5` first. `mlx-community/Llama-3.2-3B-Instruct-4bit`, when cached, adds the tests of a second tool-call family. The script rebuilds `rzb` (incrementally) before running.43 - **On the Mac** the server runs MLX: pull `mlx-community/Qwen3-4B-4bit` and `BAAI/bge-small-en-v1.5` first. `mlx-community/Llama-3.2-3B-Instruct-4bit`, when cached, adds the tests of a second tool-call family. The script rebuilds `rzb` (incrementally) before running.
44 - **On Linux** the server runs the fake engine: the protocol is checked (shapes, streaming, errors) and the tests that need a real model are skipped.44 - **On Linux** the server runs the fake engine: the protocol is checked (shapes, streaming, errors) and the tests that need a real model are skipped.
45-- **Against a server you started**: `RZB_URL=http://127.0.0.1:8080/v1 scripts/compat.sh`. It must declare the ids `chat` and `embed` (and optionally `unforced`).45+- **Against a server you started**: `RZB_URL=http://127.0.0.1:7920/v1 scripts/compat.sh`. It must declare the ids `chat` and `embed` (and optionally `unforced`).
46 - Other models: `RZB_COMPAT_CHAT_SOURCE`, `RZB_COMPAT_EMBED_SOURCE`, `RZB_COMPAT_UNFORCED_SOURCE`.46 - Other models: `RZB_COMPAT_CHAT_SOURCE`, `RZB_COMPAT_EMBED_SOURCE`, `RZB_COMPAT_UNFORCED_SOURCE`.
47 47
48 ## Run the tests of the host-runner tool48 ## Run the tests of the host-runner tool
modified docs/en/how-to/use-function-calling.md +1 -1
@@ -25,7 +25,7 @@ tools = [{
2525 import json
2626 from openai import OpenAI
2727
28-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")
28+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
2929 messages = [{"role": "user", "content": "What's the weather like in Lyon?"}]
3030
3131 def get_weather(city):
@@ -25,7 +25,7 @@ tools = [{
25 import json25 import json
26 from openai import OpenAI26 from openai import OpenAI
27 27
28-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")28+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
29 messages = [{"role": "user", "content": "What's the weather like in Lyon?"}]29 messages = [{"role": "user", "content": "What's the weather like in Lyon?"}]
30 30
31 def get_weather(city):31 def get_weather(city):
modified docs/en/how-to/use-openai-clients.md +9 -9
@@ -1,14 +1,14 @@
11 # How to use razorbill from an OpenAI client
22
3-This guide points existing OpenAI clients and frameworks at `rzb serve`. It assumes the server is running at `http://127.0.0.1:8080` (add your key if you set one).
3+This guide points existing OpenAI clients and frameworks at `rzb serve`. It assumes the server is running at `http://127.0.0.1:7920` (add your key if you set one).
44
5-The rule is always the same: **base URL** `http://127.0.0.1:8080/v1`, **API key** any non-empty value (or the server's key), **model** a declared `id` or a Hugging Face id.
5+The rule is always the same: **base URL** `http://127.0.0.1:7920/v1`, **API key** any non-empty value (or the server's key), **model** a declared `id` or a Hugging Face id.
66
77 ## Python — openai
88
99 ```python
1010 from openai import OpenAI
11-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")
11+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
1212 ```
1313
1414 razorbill-specific fields go in `extra_body`, for example `extra_body={"reasoning_effort": "none", "thinking_budget": 256}`.
@@ -17,7 +17,7 @@ razorbill-specific fields go in `extra_body`, for example `extra_body={"reasonin
1717
1818 ```javascript
1919 import OpenAI from "openai";
20-const client = new OpenAI({ baseURL: "http://127.0.0.1:8080/v1", apiKey: "unused" });
20+const client = new OpenAI({ baseURL: "http://127.0.0.1:7920/v1", apiKey: "unused" });
2121 const answer = await client.chat.completions.create({
2222 model: "mlx-community/Qwen3-4B-4bit",
2323 messages: [{ role: "user", content: "Hello" }],
@@ -29,8 +29,8 @@ const answer = await client.chat.completions.create({
2929 ```python
3030 from langchain_openai import ChatOpenAI, OpenAIEmbeddings
3131
32-llm = ChatOpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused", model="mlx-community/Qwen3-4B-4bit")
33-embeddings = OpenAIEmbeddings(base_url="http://127.0.0.1:8080/v1", api_key="unused",
32+llm = ChatOpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused", model="mlx-community/Qwen3-4B-4bit")
33+embeddings = OpenAIEmbeddings(base_url="http://127.0.0.1:7920/v1", api_key="unused",
3434 model="BAAI/bge-small-en-v1.5", check_embedding_ctx_length=False)
3535 ```
3636
@@ -41,13 +41,13 @@ embeddings = OpenAIEmbeddings(base_url="http://127.0.0.1:8080/v1", api_key="unus
4141 Many tools read the standard OpenAI variables:
4242
4343 ```bash
44-export OPENAI_BASE_URL=http://127.0.0.1:8080/v1
44+export OPENAI_BASE_URL=http://127.0.0.1:7920/v1
4545 export OPENAI_API_KEY=unused
4646 ```
4747
4848 ## Chat UIs (Open WebUI and others)
4949
50-Add an "OpenAI API" connection with the base URL `http://127.0.0.1:8080/v1` and any key. If the UI runs in Docker, `127.0.0.1` is the container itself: use `http://host.docker.internal:8080/v1` and start the server with `--host 0.0.0.0` and an API key. The UI lists the models of `/v1/models`.
50+Add an "OpenAI API" connection with the base URL `http://127.0.0.1:7920/v1` and any key. If the UI runs in Docker, `127.0.0.1` is the container itself: use `http://host.docker.internal:7920/v1` and start the server with `--host 0.0.0.0` and an API key. The UI lists the models of `/v1/models`.
5151
5252 ## Tools that use the legacy completions API
5353
@@ -56,7 +56,7 @@ Code-completion plugins and benchmark harnesses (lm-eval…) that call `/v1/comp
5656 ## curl
5757
5858 ```bash
59-curl -s http://127.0.0.1:8080/v1/chat/completions -H "Content-Type: application/json" \
59+curl -s http://127.0.0.1:7920/v1/chat/completions -H "Content-Type: application/json" \
6060 -H "Authorization: Bearer $RZB_API_KEY" \
6161 -d '{"model": "mlx-community/Qwen3-4B-4bit", "messages": [{"role": "user", "content": "Hello"}]}'
6262 ```
@@ -1,14 +1,14 @@
1 # How to use razorbill from an OpenAI client1 # How to use razorbill from an OpenAI client
2 2
3-This guide points existing OpenAI clients and frameworks at `rzb serve`. It assumes the server is running at `http://127.0.0.1:8080` (add your key if you set one).3+This guide points existing OpenAI clients and frameworks at `rzb serve`. It assumes the server is running at `http://127.0.0.1:7920` (add your key if you set one).
4 4
5-The rule is always the same: **base URL** `http://127.0.0.1:8080/v1`, **API key** any non-empty value (or the server's key), **model** a declared `id` or a Hugging Face id.5+The rule is always the same: **base URL** `http://127.0.0.1:7920/v1`, **API key** any non-empty value (or the server's key), **model** a declared `id` or a Hugging Face id.
6 6
7 ## Python — openai7 ## Python — openai
8 8
9 ```python9 ```python
10 from openai import OpenAI10 from openai import OpenAI
11-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")11+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
12 ```12 ```
13 13
14 razorbill-specific fields go in `extra_body`, for example `extra_body={"reasoning_effort": "none", "thinking_budget": 256}`.14 razorbill-specific fields go in `extra_body`, for example `extra_body={"reasoning_effort": "none", "thinking_budget": 256}`.
@@ -17,7 +17,7 @@ razorbill-specific fields go in `extra_body`, for example `extra_body={"reasonin
17 17
18 ```javascript18 ```javascript
19 import OpenAI from "openai";19 import OpenAI from "openai";
20-const client = new OpenAI({ baseURL: "http://127.0.0.1:8080/v1", apiKey: "unused" });20+const client = new OpenAI({ baseURL: "http://127.0.0.1:7920/v1", apiKey: "unused" });
21 const answer = await client.chat.completions.create({21 const answer = await client.chat.completions.create({
22 model: "mlx-community/Qwen3-4B-4bit",22 model: "mlx-community/Qwen3-4B-4bit",
23 messages: [{ role: "user", content: "Hello" }],23 messages: [{ role: "user", content: "Hello" }],
@@ -29,8 +29,8 @@ const answer = await client.chat.completions.create({
29 ```python29 ```python
30 from langchain_openai import ChatOpenAI, OpenAIEmbeddings30 from langchain_openai import ChatOpenAI, OpenAIEmbeddings
31 31
32-llm = ChatOpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused", model="mlx-community/Qwen3-4B-4bit")32+llm = ChatOpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused", model="mlx-community/Qwen3-4B-4bit")
33-embeddings = OpenAIEmbeddings(base_url="http://127.0.0.1:8080/v1", api_key="unused",33+embeddings = OpenAIEmbeddings(base_url="http://127.0.0.1:7920/v1", api_key="unused",
34 model="BAAI/bge-small-en-v1.5", check_embedding_ctx_length=False)34 model="BAAI/bge-small-en-v1.5", check_embedding_ctx_length=False)
35 ```35 ```
36 36
@@ -41,13 +41,13 @@ embeddings = OpenAIEmbeddings(base_url="http://127.0.0.1:8080/v1", api_key="unus
41 Many tools read the standard OpenAI variables:41 Many tools read the standard OpenAI variables:
42 42
43 ```bash43 ```bash
44-export OPENAI_BASE_URL=http://127.0.0.1:8080/v144+export OPENAI_BASE_URL=http://127.0.0.1:7920/v1
45 export OPENAI_API_KEY=unused45 export OPENAI_API_KEY=unused
46 ```46 ```
47 47
48 ## Chat UIs (Open WebUI and others)48 ## Chat UIs (Open WebUI and others)
49 49
50-Add an "OpenAI API" connection with the base URL `http://127.0.0.1:8080/v1` and any key. If the UI runs in Docker, `127.0.0.1` is the container itself: use `http://host.docker.internal:8080/v1` and start the server with `--host 0.0.0.0` and an API key. The UI lists the models of `/v1/models`.50+Add an "OpenAI API" connection with the base URL `http://127.0.0.1:7920/v1` and any key. If the UI runs in Docker, `127.0.0.1` is the container itself: use `http://host.docker.internal:7920/v1` and start the server with `--host 0.0.0.0` and an API key. The UI lists the models of `/v1/models`.
51 51
52 ## Tools that use the legacy completions API52 ## Tools that use the legacy completions API
53 53
@@ -56,7 +56,7 @@ Code-completion plugins and benchmark harnesses (lm-eval…) that call `/v1/comp
56 ## curl56 ## curl
57 57
58 ```bash58 ```bash
59-curl -s http://127.0.0.1:8080/v1/chat/completions -H "Content-Type: application/json" \59+curl -s http://127.0.0.1:7920/v1/chat/completions -H "Content-Type: application/json" \
60 -H "Authorization: Bearer $RZB_API_KEY" \60 -H "Authorization: Bearer $RZB_API_KEY" \
61 -d '{"model": "mlx-community/Qwen3-4B-4bit", "messages": [{"role": "user", "content": "Hello"}]}'61 -d '{"model": "mlx-community/Qwen3-4B-4bit", "messages": [{"role": "user", "content": "Hello"}]}'
62 ```62 ```
modified docs/en/reference/cli.md +2 -2
@@ -27,7 +27,7 @@ Starts the server and runs until Ctrl-C or SIGTERM; then it stops accepting requ
2727 | --- | --- | --- | --- |
2828 | `--config <file>` | path | none | Server configuration file ([reference](configuration.md)). Without it: no declared models, built-in defaults |
2929 | `--host <address>` | string, not empty | `server.host`, else `127.0.0.1` | Address to listen on; `0.0.0.0` for every interface |
30-| `--port <n>` | integer, 1–65535 | `server.port`, else `8080` | TCP port |
30+| `--port <n>` | integer, 1–65535 | `server.port`, else `7920` | TCP port |
3131 | `--api-key-env <name>` | string | `server.api_key_env`, else `RZB_API_KEY` | Environment variable holding the API key. Set and not empty: every route but `/health` needs `Authorization: Bearer <key>` |
3232 | `--cors-origin <origin>` | string | `server.cors_origin`, else none | Let browser pages from this origin call the API; `*` for any origin |
3333
@@ -35,7 +35,7 @@ Options win over the `server:` section of the file. On start it prints, on stand
3535
3636 ```
3737 config: server.yaml (2 declared models)
38-rzb 0.2.0 serving http://127.0.0.1:8080/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop
38+rzb 0.2.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop
3939 ```
4040
4141 The first line appears only with `--config`. Warnings (`warning: …`) are printed before the banner when the server listens on a network address without an API key, or allows every CORS origin without one. Then one log line per request: method, path, status, duration, and the model and token counts (`model=… tokens=<prompt>+<completion>`, plus `cached=<n>` when part of the prompt was reused from the previous request); prompts and answers are never logged.
@@ -27,7 +27,7 @@ Starts the server and runs until Ctrl-C or SIGTERM; then it stops accepting requ
27 | --- | --- | --- | --- |27 | --- | --- | --- | --- |
28 | `--config <file>` | path | none | Server configuration file ([reference](configuration.md)). Without it: no declared models, built-in defaults |28 | `--config <file>` | path | none | Server configuration file ([reference](configuration.md)). Without it: no declared models, built-in defaults |
29 | `--host <address>` | string, not empty | `server.host`, else `127.0.0.1` | Address to listen on; `0.0.0.0` for every interface |29 | `--host <address>` | string, not empty | `server.host`, else `127.0.0.1` | Address to listen on; `0.0.0.0` for every interface |
30-| `--port <n>` | integer, 1–65535 | `server.port`, else `8080` | TCP port |30+| `--port <n>` | integer, 1–65535 | `server.port`, else `7920` | TCP port |
31 | `--api-key-env <name>` | string | `server.api_key_env`, else `RZB_API_KEY` | Environment variable holding the API key. Set and not empty: every route but `/health` needs `Authorization: Bearer <key>` |31 | `--api-key-env <name>` | string | `server.api_key_env`, else `RZB_API_KEY` | Environment variable holding the API key. Set and not empty: every route but `/health` needs `Authorization: Bearer <key>` |
32 | `--cors-origin <origin>` | string | `server.cors_origin`, else none | Let browser pages from this origin call the API; `*` for any origin |32 | `--cors-origin <origin>` | string | `server.cors_origin`, else none | Let browser pages from this origin call the API; `*` for any origin |
33 33
@@ -35,7 +35,7 @@ Options win over the `server:` section of the file. On start it prints, on stand
35 35
36 ```36 ```
37 config: server.yaml (2 declared models)37 config: server.yaml (2 declared models)
38-rzb 0.2.0 serving http://127.0.0.1:8080/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop38+rzb 0.2.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop
39 ```39 ```
40 40
41 The first line appears only with `--config`. Warnings (`warning: …`) are printed before the banner when the server listens on a network address without an API key, or allows every CORS origin without one. Then one log line per request: method, path, status, duration, and the model and token counts (`model=… tokens=<prompt>+<completion>`, plus `cached=<n>` when part of the prompt was reused from the previous request); prompts and answers are never logged.41 The first line appears only with `--config`. Warnings (`warning: …`) are printed before the banner when the server listens on a network address without an API key, or allows every CORS origin without one. Then one log line per request: method, path, status, duration, and the model and token counts (`model=… tokens=<prompt>+<completion>`, plus `cached=<n>` when part of the prompt was reused from the previous request); prompts and answers are never logged.
modified docs/en/reference/configuration.md +2 -2
@@ -7,7 +7,7 @@ Every section is optional; an empty file, or no file at all, is a valid configur
77 ```yaml
88 server:
99 host: 127.0.0.1
10- port: 8080
10+ port: 7920
1111 api_key_env: RZB_API_KEY
1212 defaults:
1313 temperature: 0.6
@@ -45,7 +45,7 @@ Command-line options win over these keys ([`rzb serve`](cli.md#rzb-serve)).
4545 | Key | Type | Default | Description |
4646 | --- | --- | --- | --- |
4747 | `host` | string, not empty | `127.0.0.1` | Address to listen on; `0.0.0.0` for every interface |
48-| `port` | integer, 1–65535 | `8080` | TCP port |
48+| `port` | integer, 1–65535 | `7920` | TCP port |
4949 | `api_key_env` | string, not empty | `RZB_API_KEY` | Name of the environment variable holding the API key. The key itself never goes in the file. When the variable is set and not empty, every route except `/health` needs `Authorization: Bearer <key>` |
5050 | `cors_origin` | string, not empty | none (CORS off) | Origin allowed to call the API from a browser; `*` for any origin |
5151
@@ -7,7 +7,7 @@ Every section is optional; an empty file, or no file at all, is a valid configur
7 ```yaml7 ```yaml
8 server:8 server:
9 host: 127.0.0.19 host: 127.0.0.1
10- port: 808010+ port: 7920
11 api_key_env: RZB_API_KEY11 api_key_env: RZB_API_KEY
12 defaults:12 defaults:
13 temperature: 0.613 temperature: 0.6
@@ -45,7 +45,7 @@ Command-line options win over these keys ([`rzb serve`](cli.md#rzb-serve)).
45 | Key | Type | Default | Description |45 | Key | Type | Default | Description |
46 | --- | --- | --- | --- |46 | --- | --- | --- | --- |
47 | `host` | string, not empty | `127.0.0.1` | Address to listen on; `0.0.0.0` for every interface |47 | `host` | string, not empty | `127.0.0.1` | Address to listen on; `0.0.0.0` for every interface |
48-| `port` | integer, 1–65535 | `8080` | TCP port |48+| `port` | integer, 1–65535 | `7920` | TCP port |
49 | `api_key_env` | string, not empty | `RZB_API_KEY` | Name of the environment variable holding the API key. The key itself never goes in the file. When the variable is set and not empty, every route except `/health` needs `Authorization: Bearer <key>` |49 | `api_key_env` | string, not empty | `RZB_API_KEY` | Name of the environment variable holding the API key. The key itself never goes in the file. When the variable is set and not empty, every route except `/health` needs `Authorization: Bearer <key>` |
50 | `cors_origin` | string, not empty | none (CORS off) | Origin allowed to call the API from a browser; `*` for any origin |50 | `cors_origin` | string, not empty | none (CORS off) | Origin allowed to call the API from a browser; `*` for any origin |
51 51
modified docs/en/reference/errors.md +1 -1
@@ -36,7 +36,7 @@ During a stream, an error after the first chunk is sent as a last event, `data:
3636 | --- | --- | --- | --- |
3737 | `invalid_api_key` | 401 | `Incorrect or missing API key. Send it as 'Authorization: Bearer <key>'.` | `Authorization: Bearer` missing or different from the server's key |
3838 | `model_not_found` | 404 | `The model 'qwen9' does not exist.` | Neither a declared `id` nor a Hugging Face id `org/name` |
39-| `unknown_url` | 404 | `Invalid URL (GET /v1/nothing)` | No such endpoint |
39+| `unknown_url` | 404 | `Invalid URL (GET /v1/nothing)` | No such endpoint. On `/`, `/v1` and `/v1/` the message adds that `/v1` is the base URL, with `GET /v1/models` and `POST /v1/chat/completions` as examples. |
4040 | `model_not_supported` | 400 | `the model 'org/name' is not in MLX format (no .safetensors weights)` | The cached repository has no MLX weights (GGUF…) |
4141 | `queue_full` | 429 | `too many requests waiting for 'qwen3' (max_queue: 16); retry later` | More than `limits.max_queue` requests waiting |
4242 | `server_busy` | 503 | `cannot load 'qwen3': every loaded model is busy (max_loaded_models reached); retry later` | Every loaded model is answering and `max_loaded_models` is reached |
@@ -36,7 +36,7 @@ During a stream, an error after the first chunk is sent as a last event, `data:
36 | --- | --- | --- | --- |36 | --- | --- | --- | --- |
37 | `invalid_api_key` | 401 | `Incorrect or missing API key. Send it as 'Authorization: Bearer <key>'.` | `Authorization: Bearer` missing or different from the server's key |37 | `invalid_api_key` | 401 | `Incorrect or missing API key. Send it as 'Authorization: Bearer <key>'.` | `Authorization: Bearer` missing or different from the server's key |
38 | `model_not_found` | 404 | `The model 'qwen9' does not exist.` | Neither a declared `id` nor a Hugging Face id `org/name` |38 | `model_not_found` | 404 | `The model 'qwen9' does not exist.` | Neither a declared `id` nor a Hugging Face id `org/name` |
39-| `unknown_url` | 404 | `Invalid URL (GET /v1/nothing)` | No such endpoint |39+| `unknown_url` | 404 | `Invalid URL (GET /v1/nothing)` | No such endpoint. On `/`, `/v1` and `/v1/` the message adds that `/v1` is the base URL, with `GET /v1/models` and `POST /v1/chat/completions` as examples. |
40 | `model_not_supported` | 400 | `the model 'org/name' is not in MLX format (no .safetensors weights)` | The cached repository has no MLX weights (GGUF…) |40 | `model_not_supported` | 400 | `the model 'org/name' is not in MLX format (no .safetensors weights)` | The cached repository has no MLX weights (GGUF…) |
41 | `queue_full` | 429 | `too many requests waiting for 'qwen3' (max_queue: 16); retry later` | More than `limits.max_queue` requests waiting |41 | `queue_full` | 429 | `too many requests waiting for 'qwen3' (max_queue: 16); retry later` | More than `limits.max_queue` requests waiting |
42 | `server_busy` | 503 | `cannot load 'qwen3': every loaded model is busy (max_loaded_models reached); retry later` | Every loaded model is answering and `max_loaded_models` is reached |42 | `server_busy` | 503 | `cannot load 'qwen3': every loaded model is busy (max_loaded_models reached); retry later` | Every loaded model is answering and `max_loaded_models` is reached |
modified docs/en/reference/http-api.md +9 -9
@@ -8,7 +8,7 @@ The examples use `mlx-community/Qwen3-4B-4bit` as chat model and `BAAI/bge-small
88
99 | Rule | Value |
1010 | --- | --- |
11-| Base URL | `http://<host>:<port>/v1`, by default `http://127.0.0.1:8080/v1` |
11+| Base URL | `http://<host>:<port>/v1`, by default `http://127.0.0.1:7920/v1` |
1212 | Request body | JSON (`Content-Type: application/json`), at most 16 MiB (larger: 413) |
1313 | Response body | JSON, compact, keys sorted; streams are Server-Sent Events |
1414 | Authentication | `Authorization: Bearer <key>` on every route except `/health`, when the server has an API key ([`--api-key-env`](cli.md#rzb-serve)); none otherwise |
@@ -33,7 +33,7 @@ Any other path answers 404 with code `unknown_url`.
3333 ## GET /health
3434
3535 ```bash
36-curl -s http://127.0.0.1:8080/health
36+curl -s http://127.0.0.1:7920/health
3737 ```
3838
3939 Answer: `{"status":"ok"}`, status 200, whenever the process is up.
@@ -41,7 +41,7 @@ Answer: `{"status":"ok"}`, status 200, whenever the process is up.
4141 ## GET /v1/models
4242
4343 ```bash
44-curl -s http://127.0.0.1:8080/v1/models
44+curl -s http://127.0.0.1:7920/v1/models
4545 ```
4646
4747 Answer: `{"object": "list", "data": [<model>, …]}`. The list holds, in this order: the models declared in the configuration (under their `id`), then the loadable models of the Hugging Face cache, then models loaded by their Hugging Face id that are neither.
@@ -69,7 +69,7 @@ Anything else is a 404 `model_not_found`.
6969 ## POST /v1/chat/completions
7070
7171 ```bash
72-curl -s http://127.0.0.1:8080/v1/chat/completions \
72+curl -s http://127.0.0.1:7920/v1/chat/completions \
7373 -H "Content-Type: application/json" \
7474 -d '{
7575 "model": "mlx-community/Qwen3-4B-4bit",
@@ -184,7 +184,7 @@ When a stop sequence ends the answer, the engine is interrupted before it report
184184 - With `"strict": true`, a schema that uses a keyword the decoder cannot enforce is refused with 400 naming it and where it is: `not`, `if`, `then`, `else`, `dependentRequired`, `dependentSchemas`, `multipleOf`, `uniqueItems`, `contains`, `minContains`, `maxContains`. Without `strict`, such keywords are ignored.
185185
186186 ```bash
187-curl -s http://127.0.0.1:8080/v1/chat/completions \
187+curl -s http://127.0.0.1:7920/v1/chat/completions \
188188 -H "Content-Type: application/json" \
189189 -d '{
190190 "model": "mlx-community/Qwen3-4B-4bit",
@@ -218,7 +218,7 @@ curl -s http://127.0.0.1:8080/v1/chat/completions \
218218 - With `parallel_tool_calls: false`, calls after the first are dropped.
219219
220220 ```bash
221-curl -s http://127.0.0.1:8080/v1/chat/completions \
221+curl -s http://127.0.0.1:7920/v1/chat/completions \
222222 -H "Content-Type: application/json" \
223223 -d '{
224224 "model": "mlx-community/Qwen3-4B-4bit",
@@ -236,7 +236,7 @@ curl -s http://127.0.0.1:8080/v1/chat/completions \
236236 The legacy text-completion endpoint. The prompt is tokenized as is and continued: no chat template, no thinking, no tool-call parsing.
237237
238238 ```bash
239-curl -s http://127.0.0.1:8080/v1/completions \
239+curl -s http://127.0.0.1:7920/v1/completions \
240240 -H "Content-Type: application/json" \
241241 -d '{"model": "mlx-community/Qwen3-4B-4bit", "prompt": "The capital of France is", "max_tokens": 8, "temperature": 0}'
242242 ```
@@ -257,7 +257,7 @@ Response: `{"id": "cmpl-…", "object": "text_completion", "created", "model", "
257257 ## POST /v1/embeddings
258258
259259 ```bash
260-curl -s http://127.0.0.1:8080/v1/embeddings \
260+curl -s http://127.0.0.1:7920/v1/embeddings \
261261 -H "Content-Type: application/json" \
262262 -d '{"model": "BAAI/bge-small-en-v1.5", "input": ["The cat sits on the mat.", "A feline rests on a rug."]}'
263263 ```
@@ -293,7 +293,7 @@ data: [DONE]
293293 - When the client disconnects, the generation stops and the model is freed for the next request.
294294
295295 ```bash
296-curl -sN http://127.0.0.1:8080/v1/chat/completions \
296+curl -sN http://127.0.0.1:7920/v1/chat/completions \
297297 -H "Content-Type: application/json" \
298298 -d '{"model": "mlx-community/Qwen3-4B-4bit", "messages": [{"role": "user", "content": "Count to 5."}],
299299 "stream": true, "stream_options": {"include_usage": true}, "reasoning_effort": "none"}'
@@ -8,7 +8,7 @@ The examples use `mlx-community/Qwen3-4B-4bit` as chat model and `BAAI/bge-small
8 8
9 | Rule | Value |9 | Rule | Value |
10 | --- | --- |10 | --- | --- |
11-| Base URL | `http://<host>:<port>/v1`, by default `http://127.0.0.1:8080/v1` |11+| Base URL | `http://<host>:<port>/v1`, by default `http://127.0.0.1:7920/v1` |
12 | Request body | JSON (`Content-Type: application/json`), at most 16 MiB (larger: 413) |12 | Request body | JSON (`Content-Type: application/json`), at most 16 MiB (larger: 413) |
13 | Response body | JSON, compact, keys sorted; streams are Server-Sent Events |13 | Response body | JSON, compact, keys sorted; streams are Server-Sent Events |
14 | Authentication | `Authorization: Bearer <key>` on every route except `/health`, when the server has an API key ([`--api-key-env`](cli.md#rzb-serve)); none otherwise |14 | Authentication | `Authorization: Bearer <key>` on every route except `/health`, when the server has an API key ([`--api-key-env`](cli.md#rzb-serve)); none otherwise |
@@ -33,7 +33,7 @@ Any other path answers 404 with code `unknown_url`.
33 ## GET /health33 ## GET /health
34 34
35 ```bash35 ```bash
36-curl -s http://127.0.0.1:8080/health36+curl -s http://127.0.0.1:7920/health
37 ```37 ```
38 38
39 Answer: `{"status":"ok"}`, status 200, whenever the process is up.39 Answer: `{"status":"ok"}`, status 200, whenever the process is up.
@@ -41,7 +41,7 @@ Answer: `{"status":"ok"}`, status 200, whenever the process is up.
41 ## GET /v1/models41 ## GET /v1/models
42 42
43 ```bash43 ```bash
44-curl -s http://127.0.0.1:8080/v1/models44+curl -s http://127.0.0.1:7920/v1/models
45 ```45 ```
46 46
47 Answer: `{"object": "list", "data": [<model>, …]}`. The list holds, in this order: the models declared in the configuration (under their `id`), then the loadable models of the Hugging Face cache, then models loaded by their Hugging Face id that are neither.47 Answer: `{"object": "list", "data": [<model>, …]}`. The list holds, in this order: the models declared in the configuration (under their `id`), then the loadable models of the Hugging Face cache, then models loaded by their Hugging Face id that are neither.
@@ -69,7 +69,7 @@ Anything else is a 404 `model_not_found`.
69 ## POST /v1/chat/completions69 ## POST /v1/chat/completions
70 70
71 ```bash71 ```bash
72-curl -s http://127.0.0.1:8080/v1/chat/completions \72+curl -s http://127.0.0.1:7920/v1/chat/completions \
73 -H "Content-Type: application/json" \73 -H "Content-Type: application/json" \
74 -d '{74 -d '{
75 "model": "mlx-community/Qwen3-4B-4bit",75 "model": "mlx-community/Qwen3-4B-4bit",
@@ -184,7 +184,7 @@ When a stop sequence ends the answer, the engine is interrupted before it report
184 - With `"strict": true`, a schema that uses a keyword the decoder cannot enforce is refused with 400 naming it and where it is: `not`, `if`, `then`, `else`, `dependentRequired`, `dependentSchemas`, `multipleOf`, `uniqueItems`, `contains`, `minContains`, `maxContains`. Without `strict`, such keywords are ignored.184 - With `"strict": true`, a schema that uses a keyword the decoder cannot enforce is refused with 400 naming it and where it is: `not`, `if`, `then`, `else`, `dependentRequired`, `dependentSchemas`, `multipleOf`, `uniqueItems`, `contains`, `minContains`, `maxContains`. Without `strict`, such keywords are ignored.
185 185
186 ```bash186 ```bash
187-curl -s http://127.0.0.1:8080/v1/chat/completions \187+curl -s http://127.0.0.1:7920/v1/chat/completions \
188 -H "Content-Type: application/json" \188 -H "Content-Type: application/json" \
189 -d '{189 -d '{
190 "model": "mlx-community/Qwen3-4B-4bit",190 "model": "mlx-community/Qwen3-4B-4bit",
@@ -218,7 +218,7 @@ curl -s http://127.0.0.1:8080/v1/chat/completions \
218 - With `parallel_tool_calls: false`, calls after the first are dropped.218 - With `parallel_tool_calls: false`, calls after the first are dropped.
219 219
220 ```bash220 ```bash
221-curl -s http://127.0.0.1:8080/v1/chat/completions \221+curl -s http://127.0.0.1:7920/v1/chat/completions \
222 -H "Content-Type: application/json" \222 -H "Content-Type: application/json" \
223 -d '{223 -d '{
224 "model": "mlx-community/Qwen3-4B-4bit",224 "model": "mlx-community/Qwen3-4B-4bit",
@@ -236,7 +236,7 @@ curl -s http://127.0.0.1:8080/v1/chat/completions \
236 The legacy text-completion endpoint. The prompt is tokenized as is and continued: no chat template, no thinking, no tool-call parsing.236 The legacy text-completion endpoint. The prompt is tokenized as is and continued: no chat template, no thinking, no tool-call parsing.
237 237
238 ```bash238 ```bash
239-curl -s http://127.0.0.1:8080/v1/completions \239+curl -s http://127.0.0.1:7920/v1/completions \
240 -H "Content-Type: application/json" \240 -H "Content-Type: application/json" \
241 -d '{"model": "mlx-community/Qwen3-4B-4bit", "prompt": "The capital of France is", "max_tokens": 8, "temperature": 0}'241 -d '{"model": "mlx-community/Qwen3-4B-4bit", "prompt": "The capital of France is", "max_tokens": 8, "temperature": 0}'
242 ```242 ```
@@ -257,7 +257,7 @@ Response: `{"id": "cmpl-…", "object": "text_completion", "created", "model", "
257 ## POST /v1/embeddings257 ## POST /v1/embeddings
258 258
259 ```bash259 ```bash
260-curl -s http://127.0.0.1:8080/v1/embeddings \260+curl -s http://127.0.0.1:7920/v1/embeddings \
261 -H "Content-Type: application/json" \261 -H "Content-Type: application/json" \
262 -d '{"model": "BAAI/bge-small-en-v1.5", "input": ["The cat sits on the mat.", "A feline rests on a rug."]}'262 -d '{"model": "BAAI/bge-small-en-v1.5", "input": ["The cat sits on the mat.", "A feline rests on a rug."]}'
263 ```263 ```
@@ -293,7 +293,7 @@ data: [DONE]
293 - When the client disconnects, the generation stops and the model is freed for the next request.293 - When the client disconnects, the generation stops and the model is freed for the next request.
294 294
295 ```bash295 ```bash
296-curl -sN http://127.0.0.1:8080/v1/chat/completions \296+curl -sN http://127.0.0.1:7920/v1/chat/completions \
297 -H "Content-Type: application/json" \297 -H "Content-Type: application/json" \
298 -d '{"model": "mlx-community/Qwen3-4B-4bit", "messages": [{"role": "user", "content": "Count to 5."}],298 -d '{"model": "mlx-community/Qwen3-4B-4bit", "messages": [{"role": "user", "content": "Count to 5."}],
299 "stream": true, "stream_options": {"include_usage": true}, "reasoning_effort": "none"}'299 "stream": true, "stream_options": {"include_usage": true}, "reasoning_effort": "none"}'
modified docs/en/tutorials/getting-started.md +5 -5
@@ -43,7 +43,7 @@ rzb serve
4343 You should see:
4444
4545 ```
46-rzb 0.2.0 serving http://127.0.0.1:8080/v1 (no API key) — Ctrl-C to stop
46+rzb 0.2.0 serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop
4747 ```
4848
4949 The server is running and only accepts connections from this Mac. Leave this terminal open, and **open a second terminal** for the next steps.
@@ -53,7 +53,7 @@ The server is running and only accepts connections from this Mac. Leave this ter
5353 In the second terminal, type:
5454
5555 ```bash
56-curl -s http://127.0.0.1:8080/health
56+curl -s http://127.0.0.1:7920/health
5757 ```
5858
5959 You should see:
@@ -65,7 +65,7 @@ You should see:
6565 Now ask which models it can serve:
6666
6767 ```bash
68-curl -s http://127.0.0.1:8080/v1/models | python3 -m json.tool
68+curl -s http://127.0.0.1:7920/v1/models | python3 -m json.tool
6969 ```
7070
7171 You should see a list that contains the model we downloaded:
@@ -93,7 +93,7 @@ You should see a list that contains the model we downloaded:
9393 Type:
9494
9595 ```bash
96-curl -s http://127.0.0.1:8080/v1/chat/completions \
96+curl -s http://127.0.0.1:7920/v1/chat/completions \
9797 -H "Content-Type: application/json" \
9898 -d '{
9999 "model": "mlx-community/Qwen3-0.6B-4bit",
@@ -144,7 +144,7 @@ Any program written for the OpenAI API can use the server by changing its base U
144144 ```python
145145 from openai import OpenAI
146146
147-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")
147+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
148148
149149 stream = client.chat.completions.create(
150150 model="mlx-community/Qwen3-0.6B-4bit",
@@ -43,7 +43,7 @@ rzb serve
43 You should see:43 You should see:
44 44
45 ```45 ```
46-rzb 0.2.0 serving http://127.0.0.1:8080/v1 (no API key) — Ctrl-C to stop46+rzb 0.2.0 serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop
47 ```47 ```
48 48
49 The server is running and only accepts connections from this Mac. Leave this terminal open, and **open a second terminal** for the next steps.49 The server is running and only accepts connections from this Mac. Leave this terminal open, and **open a second terminal** for the next steps.
@@ -53,7 +53,7 @@ The server is running and only accepts connections from this Mac. Leave this ter
53 In the second terminal, type:53 In the second terminal, type:
54 54
55 ```bash55 ```bash
56-curl -s http://127.0.0.1:8080/health56+curl -s http://127.0.0.1:7920/health
57 ```57 ```
58 58
59 You should see:59 You should see:
@@ -65,7 +65,7 @@ You should see:
65 Now ask which models it can serve:65 Now ask which models it can serve:
66 66
67 ```bash67 ```bash
68-curl -s http://127.0.0.1:8080/v1/models | python3 -m json.tool68+curl -s http://127.0.0.1:7920/v1/models | python3 -m json.tool
69 ```69 ```
70 70
71 You should see a list that contains the model we downloaded:71 You should see a list that contains the model we downloaded:
@@ -93,7 +93,7 @@ You should see a list that contains the model we downloaded:
93 Type:93 Type:
94 94
95 ```bash95 ```bash
96-curl -s http://127.0.0.1:8080/v1/chat/completions \96+curl -s http://127.0.0.1:7920/v1/chat/completions \
97 -H "Content-Type: application/json" \97 -H "Content-Type: application/json" \
98 -d '{98 -d '{
99 "model": "mlx-community/Qwen3-0.6B-4bit",99 "model": "mlx-community/Qwen3-0.6B-4bit",
@@ -144,7 +144,7 @@ Any program written for the OpenAI API can use the server by changing its base U
144 ```python144 ```python
145 from openai import OpenAI145 from openai import OpenAI
146 146
147-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")147+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
148 148
149 stream = client.chat.completions.create(149 stream = client.chat.completions.create(
150 model="mlx-community/Qwen3-0.6B-4bit",150 model="mlx-community/Qwen3-0.6B-4bit",
modified docs/fr/how-to/calculer-des-embeddings.md +2 -2
@@ -26,7 +26,7 @@ Déclaré, il apparaît avec `"kind": "embedding"` dans `/v1/models`, et une req
2626 ```python
2727 from openai import OpenAI
2828
29-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")
29+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
3030 result = client.embeddings.create(model="embed", input=["The cat sits on the mat.", "A feline rests on a rug."])
3131 vectors = [item.embedding for item in result.data]
3232 ```
@@ -37,7 +37,7 @@ Les vecteurs sont normalisés : leur produit scalaire est leur similarité cosin
3737
3838 - **Vecteurs plus courts** : `dimensions=256` garde les 256 premières valeurs et les renormalise. Pertinent pour les modèles Matryoshka (Qwen3-Embedding, nomic…) ; pour les autres, la qualité baisse.
3939 - **Réponses plus légères** : `encoding_format="base64"` (la bibliothèque openai le demande par défaut et le décode pour vous).
40-- **LangChain** : `OpenAIEmbeddings(base_url="http://127.0.0.1:8080/v1", api_key="unused", model="embed", check_embedding_ctx_length=False)`. Sans `check_embedding_ctx_length=False`, LangChain envoie des tableaux de tokens, que le serveur refuse.
40+- **LangChain** : `OpenAIEmbeddings(base_url="http://127.0.0.1:7920/v1", api_key="unused", model="embed", check_embedding_ctx_length=False)`. Sans `check_embedding_ctx_length=False`, LangChain envoie des tableaux de tokens, que le serveur refuse.
4141 - **Textes longs** : un texte plus long que ce qu'accepte le modèle (512 tokens pour bge-small) donne un 400 qui le nomme. Découpez d'abord vos documents.
4242 - **Préfixes de requête** : les modèles qui attendent un préfixe (`query: `, `search_query: `, une instruction) doivent le recevoir dans votre texte ; le serveur n'ajoute rien.
4343 - **Chat et embeddings ensemble** : réglez `limits.max_loaded_models: 2` pour que les deux modèles restent chargés.
@@ -26,7 +26,7 @@ Déclaré, il apparaît avec `"kind": "embedding"` dans `/v1/models`, et une req
26 ```python26 ```python
27 from openai import OpenAI27 from openai import OpenAI
28 28
29-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")29+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
30 result = client.embeddings.create(model="embed", input=["The cat sits on the mat.", "A feline rests on a rug."])30 result = client.embeddings.create(model="embed", input=["The cat sits on the mat.", "A feline rests on a rug."])
31 vectors = [item.embedding for item in result.data]31 vectors = [item.embedding for item in result.data]
32 ```32 ```
@@ -37,7 +37,7 @@ Les vecteurs sont normalisés : leur produit scalaire est leur similarité cosin
37 37
38 - **Vecteurs plus courts** : `dimensions=256` garde les 256 premières valeurs et les renormalise. Pertinent pour les modèles Matryoshka (Qwen3-Embedding, nomic…) ; pour les autres, la qualité baisse.38 - **Vecteurs plus courts** : `dimensions=256` garde les 256 premières valeurs et les renormalise. Pertinent pour les modèles Matryoshka (Qwen3-Embedding, nomic…) ; pour les autres, la qualité baisse.
39 - **Réponses plus légères** : `encoding_format="base64"` (la bibliothèque openai le demande par défaut et le décode pour vous).39 - **Réponses plus légères** : `encoding_format="base64"` (la bibliothèque openai le demande par défaut et le décode pour vous).
40-- **LangChain** : `OpenAIEmbeddings(base_url="http://127.0.0.1:8080/v1", api_key="unused", model="embed", check_embedding_ctx_length=False)`. Sans `check_embedding_ctx_length=False`, LangChain envoie des tableaux de tokens, que le serveur refuse.40+- **LangChain** : `OpenAIEmbeddings(base_url="http://127.0.0.1:7920/v1", api_key="unused", model="embed", check_embedding_ctx_length=False)`. Sans `check_embedding_ctx_length=False`, LangChain envoie des tableaux de tokens, que le serveur refuse.
41 - **Textes longs** : un texte plus long que ce qu'accepte le modèle (512 tokens pour bge-small) donne un 400 qui le nomme. Découpez d'abord vos documents.41 - **Textes longs** : un texte plus long que ce qu'accepte le modèle (512 tokens pour bge-small) donne un 400 qui le nomme. Découpez d'abord vos documents.
42 - **Préfixes de requête** : les modèles qui attendent un préfixe (`query: `, `search_query: `, une instruction) doivent le recevoir dans votre texte ; le serveur n'ajoute rien.42 - **Préfixes de requête** : les modèles qui attendent un préfixe (`query: `, `search_query: `, une instruction) doivent le recevoir dans votre texte ; le serveur n'ajoute rien.
43 - **Chat et embeddings ensemble** : réglez `limits.max_loaded_models: 2` pour que les deux modèles restent chargés.43 - **Chat et embeddings ensemble** : réglez `limits.max_loaded_models: 2` pour que les deux modèles restent chargés.
modified docs/fr/how-to/developper-depuis-une-sandbox.md +1 -1
@@ -52,7 +52,7 @@ Le code de sortie du script est celui de la commande sur le Mac : on peut l'ench
5252
5353 ## Limites
5454
55-- `host.sh run` n'a pas de terminal et attend la fin de la commande : ne l'utilisez pas pour `rzb serve`. Tuer `host.sh` dans la sandbox n'arrête pas le serveur sur le Mac, et host-runner répond alors 409 à tout jusqu'à ce que vous arrêtiez `rzb serve` sur le Mac. Démarrez plutôt le serveur dans un terminal du Mac ; la sandbox le joint à `http://host.docker.internal:8080/v1` (autorisez-le une fois avec `sbx policy allow network localhost:8080`).
55+- `host.sh run` n'a pas de terminal et attend la fin de la commande : ne l'utilisez pas pour `rzb serve`. Tuer `host.sh` dans la sandbox n'arrête pas le serveur sur le Mac, et host-runner répond alors 409 à tout jusqu'à ce que vous arrêtiez `rzb serve` sur le Mac. Démarrez plutôt le serveur dans un terminal du Mac ; la sandbox le joint à `http://host.docker.internal:7920/v1` (autorisez-le une fois avec `sbx policy allow network localhost:7920`).
5656 - host-runner lance une commande à la fois (une deuxième requête reçoit HTTP 409) et ne connaît que `list`, `build`, `test`, `run`, `resolve` et `clean`, sur `.` ou `experiments/<nom>`.
5757 - Les modèles sont téléchargés dans le cache Hugging Face **du Mac** ; la sandbox ne le voit pas.
5858
@@ -52,7 +52,7 @@ Le code de sortie du script est celui de la commande sur le Mac : on peut l'ench
52 52
53 ## Limites53 ## Limites
54 54
55-- `host.sh run` n'a pas de terminal et attend la fin de la commande : ne l'utilisez pas pour `rzb serve`. Tuer `host.sh` dans la sandbox n'arrête pas le serveur sur le Mac, et host-runner répond alors 409 à tout jusqu'à ce que vous arrêtiez `rzb serve` sur le Mac. Démarrez plutôt le serveur dans un terminal du Mac ; la sandbox le joint à `http://host.docker.internal:8080/v1` (autorisez-le une fois avec `sbx policy allow network localhost:8080`).55+- `host.sh run` n'a pas de terminal et attend la fin de la commande : ne l'utilisez pas pour `rzb serve`. Tuer `host.sh` dans la sandbox n'arrête pas le serveur sur le Mac, et host-runner répond alors 409 à tout jusqu'à ce que vous arrêtiez `rzb serve` sur le Mac. Démarrez plutôt le serveur dans un terminal du Mac ; la sandbox le joint à `http://host.docker.internal:7920/v1` (autorisez-le une fois avec `sbx policy allow network localhost:7920`).
56 - host-runner lance une commande à la fois (une deuxième requête reçoit HTTP 409) et ne connaît que `list`, `build`, `test`, `run`, `resolve` et `clean`, sur `.` ou `experiments/<nom>`.56 - host-runner lance une commande à la fois (une deuxième requête reçoit HTTP 409) et ne connaît que `list`, `build`, `test`, `run`, `resolve` et `clean`, sur `.` ou `experiments/<nom>`.
57 - Les modèles sont téléchargés dans le cache Hugging Face **du Mac** ; la sandbox ne le voit pas.57 - Les modèles sont téléchargés dans le cache Hugging Face **du Mac** ; la sandbox ne le voit pas.
58 58
modified docs/fr/how-to/lancer-les-tests.md +1 -1
@@ -42,7 +42,7 @@ Il démarre `rzb serve` sur le port 18080 avec sa propre configuration, lance `T
4242
4343 - **Sur le Mac**, le serveur fait tourner MLX : téléchargez d'abord `mlx-community/Qwen3-4B-4bit` et `BAAI/bge-small-en-v1.5`. `mlx-community/Llama-3.2-3B-Instruct-4bit`, s'il est dans le cache, ajoute les tests d'une deuxième famille d'appels d'outils. Le script recompile `rzb` (de façon incrémentale) avant de lancer les tests.
4444 - **Sur Linux**, le serveur fait tourner le moteur factice : le protocole est vérifié (formes, streaming, erreurs) et les tests qui demandent un vrai modèle sont ignorés.
45-- **Contre un serveur que vous avez démarré** : `RZB_URL=http://127.0.0.1:8080/v1 scripts/compat.sh`. Il doit déclarer les identifiants `chat` et `embed` (et éventuellement `unforced`).
45+- **Contre un serveur que vous avez démarré** : `RZB_URL=http://127.0.0.1:7920/v1 scripts/compat.sh`. Il doit déclarer les identifiants `chat` et `embed` (et éventuellement `unforced`).
4646 - Autres modèles : `RZB_COMPAT_CHAT_SOURCE`, `RZB_COMPAT_EMBED_SOURCE`, `RZB_COMPAT_UNFORCED_SOURCE`.
4747
4848 ## Lancer les tests de l'outil host-runner
@@ -42,7 +42,7 @@ Il démarre `rzb serve` sur le port 18080 avec sa propre configuration, lance `T
42 42
43 - **Sur le Mac**, le serveur fait tourner MLX : téléchargez d'abord `mlx-community/Qwen3-4B-4bit` et `BAAI/bge-small-en-v1.5`. `mlx-community/Llama-3.2-3B-Instruct-4bit`, s'il est dans le cache, ajoute les tests d'une deuxième famille d'appels d'outils. Le script recompile `rzb` (de façon incrémentale) avant de lancer les tests.43 - **Sur le Mac**, le serveur fait tourner MLX : téléchargez d'abord `mlx-community/Qwen3-4B-4bit` et `BAAI/bge-small-en-v1.5`. `mlx-community/Llama-3.2-3B-Instruct-4bit`, s'il est dans le cache, ajoute les tests d'une deuxième famille d'appels d'outils. Le script recompile `rzb` (de façon incrémentale) avant de lancer les tests.
44 - **Sur Linux**, le serveur fait tourner le moteur factice : le protocole est vérifié (formes, streaming, erreurs) et les tests qui demandent un vrai modèle sont ignorés.44 - **Sur Linux**, le serveur fait tourner le moteur factice : le protocole est vérifié (formes, streaming, erreurs) et les tests qui demandent un vrai modèle sont ignorés.
45-- **Contre un serveur que vous avez démarré** : `RZB_URL=http://127.0.0.1:8080/v1 scripts/compat.sh`. Il doit déclarer les identifiants `chat` et `embed` (et éventuellement `unforced`).45+- **Contre un serveur que vous avez démarré** : `RZB_URL=http://127.0.0.1:7920/v1 scripts/compat.sh`. Il doit déclarer les identifiants `chat` et `embed` (et éventuellement `unforced`).
46 - Autres modèles : `RZB_COMPAT_CHAT_SOURCE`, `RZB_COMPAT_EMBED_SOURCE`, `RZB_COMPAT_UNFORCED_SOURCE`.46 - Autres modèles : `RZB_COMPAT_CHAT_SOURCE`, `RZB_COMPAT_EMBED_SOURCE`, `RZB_COMPAT_UNFORCED_SOURCE`.
47 47
48 ## Lancer les tests de l'outil host-runner48 ## Lancer les tests de l'outil host-runner
modified docs/fr/how-to/obtenir-une-sortie-structuree.md +1 -1
@@ -14,7 +14,7 @@ class City(BaseModel):
1414 population: int
1515 landmarks: list[str]
1616
17-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")
17+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
1818 completion = client.beta.chat.completions.parse(
1919 model="mlx-community/Qwen3-4B-4bit",
2020 messages=[{"role": "user", "content": "Describe Lyon, France."}],
@@ -14,7 +14,7 @@ class City(BaseModel):
14 population: int14 population: int
15 landmarks: list[str]15 landmarks: list[str]
16 16
17-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")17+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
18 completion = client.beta.chat.completions.parse(18 completion = client.beta.chat.completions.parse(
19 model="mlx-community/Qwen3-4B-4bit",19 model="mlx-community/Qwen3-4B-4bit",
20 messages=[{"role": "user", "content": "Describe Lyon, France."}],20 messages=[{"role": "user", "content": "Describe Lyon, France."}],
modified docs/fr/how-to/utiliser-des-clients-openai.md +9 -9
@@ -1,14 +1,14 @@
11 # Utiliser razorbill depuis un client OpenAI
22
3-Ce guide branche des clients et frameworks OpenAI existants sur `rzb serve`. Il suppose que le serveur tourne à `http://127.0.0.1:8080` (ajoutez votre clé si vous en avez défini une).
3+Ce guide branche des clients et frameworks OpenAI existants sur `rzb serve`. Il suppose que le serveur tourne à `http://127.0.0.1:7920` (ajoutez votre clé si vous en avez défini une).
44
5-La règle est toujours la même : **URL de base** `http://127.0.0.1:8080/v1`, **clé d'API** n'importe quelle valeur non vide (ou la clé du serveur), **modèle** un `id` déclaré ou un identifiant Hugging Face.
5+La règle est toujours la même : **URL de base** `http://127.0.0.1:7920/v1`, **clé d'API** n'importe quelle valeur non vide (ou la clé du serveur), **modèle** un `id` déclaré ou un identifiant Hugging Face.
66
77 ## Python — openai
88
99 ```python
1010 from openai import OpenAI
11-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")
11+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
1212 ```
1313
1414 Les champs propres à razorbill vont dans `extra_body`, par exemple `extra_body={"reasoning_effort": "none", "thinking_budget": 256}`.
@@ -17,7 +17,7 @@ Les champs propres à razorbill vont dans `extra_body`, par exemple `extra_body=
1717
1818 ```javascript
1919 import OpenAI from "openai";
20-const client = new OpenAI({ baseURL: "http://127.0.0.1:8080/v1", apiKey: "unused" });
20+const client = new OpenAI({ baseURL: "http://127.0.0.1:7920/v1", apiKey: "unused" });
2121 const answer = await client.chat.completions.create({
2222 model: "mlx-community/Qwen3-4B-4bit",
2323 messages: [{ role: "user", content: "Hello" }],
@@ -29,8 +29,8 @@ const answer = await client.chat.completions.create({
2929 ```python
3030 from langchain_openai import ChatOpenAI, OpenAIEmbeddings
3131
32-llm = ChatOpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused", model="mlx-community/Qwen3-4B-4bit")
33-embeddings = OpenAIEmbeddings(base_url="http://127.0.0.1:8080/v1", api_key="unused",
32+llm = ChatOpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused", model="mlx-community/Qwen3-4B-4bit")
33+embeddings = OpenAIEmbeddings(base_url="http://127.0.0.1:7920/v1", api_key="unused",
3434 model="BAAI/bge-small-en-v1.5", check_embedding_ctx_length=False)
3535 ```
3636
@@ -41,13 +41,13 @@ embeddings = OpenAIEmbeddings(base_url="http://127.0.0.1:8080/v1", api_key="unus
4141 Beaucoup d'outils lisent les variables OpenAI standard :
4242
4343 ```bash
44-export OPENAI_BASE_URL=http://127.0.0.1:8080/v1
44+export OPENAI_BASE_URL=http://127.0.0.1:7920/v1
4545 export OPENAI_API_KEY=unused
4646 ```
4747
4848 ## Interfaces de chat (Open WebUI et autres)
4949
50-Ajoutez une connexion « OpenAI API » avec l'URL de base `http://127.0.0.1:8080/v1` et n'importe quelle clé. Si l'interface tourne dans Docker, `127.0.0.1` désigne le conteneur lui-même : utilisez `http://host.docker.internal:8080/v1` et démarrez le serveur avec `--host 0.0.0.0` et une clé d'API. L'interface liste les modèles de `/v1/models`.
50+Ajoutez une connexion « OpenAI API » avec l'URL de base `http://127.0.0.1:7920/v1` et n'importe quelle clé. Si l'interface tourne dans Docker, `127.0.0.1` désigne le conteneur lui-même : utilisez `http://host.docker.internal:7920/v1` et démarrez le serveur avec `--host 0.0.0.0` et une clé d'API. L'interface liste les modèles de `/v1/models`.
5151
5252 ## Outils qui utilisent l'API de complétion historique
5353
@@ -56,7 +56,7 @@ Les extensions de complétion de code et les bancs d'évaluation (lm-eval…) qu
5656 ## curl
5757
5858 ```bash
59-curl -s http://127.0.0.1:8080/v1/chat/completions -H "Content-Type: application/json" \
59+curl -s http://127.0.0.1:7920/v1/chat/completions -H "Content-Type: application/json" \
6060 -H "Authorization: Bearer $RZB_API_KEY" \
6161 -d '{"model": "mlx-community/Qwen3-4B-4bit", "messages": [{"role": "user", "content": "Hello"}]}'
6262 ```
@@ -1,14 +1,14 @@
1 # Utiliser razorbill depuis un client OpenAI1 # Utiliser razorbill depuis un client OpenAI
2 2
3-Ce guide branche des clients et frameworks OpenAI existants sur `rzb serve`. Il suppose que le serveur tourne à `http://127.0.0.1:8080` (ajoutez votre clé si vous en avez défini une).3+Ce guide branche des clients et frameworks OpenAI existants sur `rzb serve`. Il suppose que le serveur tourne à `http://127.0.0.1:7920` (ajoutez votre clé si vous en avez défini une).
4 4
5-La règle est toujours la même : **URL de base** `http://127.0.0.1:8080/v1`, **clé d'API** n'importe quelle valeur non vide (ou la clé du serveur), **modèle** un `id` déclaré ou un identifiant Hugging Face.5+La règle est toujours la même : **URL de base** `http://127.0.0.1:7920/v1`, **clé d'API** n'importe quelle valeur non vide (ou la clé du serveur), **modèle** un `id` déclaré ou un identifiant Hugging Face.
6 6
7 ## Python — openai7 ## Python — openai
8 8
9 ```python9 ```python
10 from openai import OpenAI10 from openai import OpenAI
11-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")11+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
12 ```12 ```
13 13
14 Les champs propres à razorbill vont dans `extra_body`, par exemple `extra_body={"reasoning_effort": "none", "thinking_budget": 256}`.14 Les champs propres à razorbill vont dans `extra_body`, par exemple `extra_body={"reasoning_effort": "none", "thinking_budget": 256}`.
@@ -17,7 +17,7 @@ Les champs propres à razorbill vont dans `extra_body`, par exemple `extra_body=
17 17
18 ```javascript18 ```javascript
19 import OpenAI from "openai";19 import OpenAI from "openai";
20-const client = new OpenAI({ baseURL: "http://127.0.0.1:8080/v1", apiKey: "unused" });20+const client = new OpenAI({ baseURL: "http://127.0.0.1:7920/v1", apiKey: "unused" });
21 const answer = await client.chat.completions.create({21 const answer = await client.chat.completions.create({
22 model: "mlx-community/Qwen3-4B-4bit",22 model: "mlx-community/Qwen3-4B-4bit",
23 messages: [{ role: "user", content: "Hello" }],23 messages: [{ role: "user", content: "Hello" }],
@@ -29,8 +29,8 @@ const answer = await client.chat.completions.create({
29 ```python29 ```python
30 from langchain_openai import ChatOpenAI, OpenAIEmbeddings30 from langchain_openai import ChatOpenAI, OpenAIEmbeddings
31 31
32-llm = ChatOpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused", model="mlx-community/Qwen3-4B-4bit")32+llm = ChatOpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused", model="mlx-community/Qwen3-4B-4bit")
33-embeddings = OpenAIEmbeddings(base_url="http://127.0.0.1:8080/v1", api_key="unused",33+embeddings = OpenAIEmbeddings(base_url="http://127.0.0.1:7920/v1", api_key="unused",
34 model="BAAI/bge-small-en-v1.5", check_embedding_ctx_length=False)34 model="BAAI/bge-small-en-v1.5", check_embedding_ctx_length=False)
35 ```35 ```
36 36
@@ -41,13 +41,13 @@ embeddings = OpenAIEmbeddings(base_url="http://127.0.0.1:8080/v1", api_key="unus
41 Beaucoup d'outils lisent les variables OpenAI standard :41 Beaucoup d'outils lisent les variables OpenAI standard :
42 42
43 ```bash43 ```bash
44-export OPENAI_BASE_URL=http://127.0.0.1:8080/v144+export OPENAI_BASE_URL=http://127.0.0.1:7920/v1
45 export OPENAI_API_KEY=unused45 export OPENAI_API_KEY=unused
46 ```46 ```
47 47
48 ## Interfaces de chat (Open WebUI et autres)48 ## Interfaces de chat (Open WebUI et autres)
49 49
50-Ajoutez une connexion « OpenAI API » avec l'URL de base `http://127.0.0.1:8080/v1` et n'importe quelle clé. Si l'interface tourne dans Docker, `127.0.0.1` désigne le conteneur lui-même : utilisez `http://host.docker.internal:8080/v1` et démarrez le serveur avec `--host 0.0.0.0` et une clé d'API. L'interface liste les modèles de `/v1/models`.50+Ajoutez une connexion « OpenAI API » avec l'URL de base `http://127.0.0.1:7920/v1` et n'importe quelle clé. Si l'interface tourne dans Docker, `127.0.0.1` désigne le conteneur lui-même : utilisez `http://host.docker.internal:7920/v1` et démarrez le serveur avec `--host 0.0.0.0` et une clé d'API. L'interface liste les modèles de `/v1/models`.
51 51
52 ## Outils qui utilisent l'API de complétion historique52 ## Outils qui utilisent l'API de complétion historique
53 53
@@ -56,7 +56,7 @@ Les extensions de complétion de code et les bancs d'évaluation (lm-eval…) qu
56 ## curl56 ## curl
57 57
58 ```bash58 ```bash
59-curl -s http://127.0.0.1:8080/v1/chat/completions -H "Content-Type: application/json" \59+curl -s http://127.0.0.1:7920/v1/chat/completions -H "Content-Type: application/json" \
60 -H "Authorization: Bearer $RZB_API_KEY" \60 -H "Authorization: Bearer $RZB_API_KEY" \
61 -d '{"model": "mlx-community/Qwen3-4B-4bit", "messages": [{"role": "user", "content": "Hello"}]}'61 -d '{"model": "mlx-community/Qwen3-4B-4bit", "messages": [{"role": "user", "content": "Hello"}]}'
62 ```62 ```
modified docs/fr/how-to/utiliser-l-appel-de-fonctions.md +1 -1
@@ -25,7 +25,7 @@ tools = [{
2525 import json
2626 from openai import OpenAI
2727
28-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")
28+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
2929 messages = [{"role": "user", "content": "What's the weather like in Lyon?"}]
3030
3131 def get_weather(city):
@@ -25,7 +25,7 @@ tools = [{
25 import json25 import json
26 from openai import OpenAI26 from openai import OpenAI
27 27
28-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")28+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
29 messages = [{"role": "user", "content": "What's the weather like in Lyon?"}]29 messages = [{"role": "user", "content": "What's the weather like in Lyon?"}]
30 30
31 def get_weather(city):31 def get_weather(city):
modified docs/fr/reference/api-http.md +9 -9
@@ -8,7 +8,7 @@ Les exemples utilisent `mlx-community/Qwen3-4B-4bit` comme modèle de chat et `B
88
99 | Règle | Valeur |
1010 | --- | --- |
11-| URL de base | `http://<hôte>:<port>/v1`, par défaut `http://127.0.0.1:8080/v1` |
11+| URL de base | `http://<hôte>:<port>/v1`, par défaut `http://127.0.0.1:7920/v1` |
1212 | Corps de requête | JSON (`Content-Type: application/json`), 16 Mio au plus (au-delà : 413) |
1313 | Corps de réponse | JSON compact, clés triées ; les flux sont des Server-Sent Events |
1414 | Authentification | `Authorization: Bearer <clé>` sur toutes les routes sauf `/health` quand le serveur a une clé d'API ([`--api-key-env`](ligne-de-commande.md#rzb-serve)) ; aucune sinon |
@@ -33,7 +33,7 @@ Tout autre chemin répond 404 avec le code `unknown_url`.
3333 ## GET /health
3434
3535 ```bash
36-curl -s http://127.0.0.1:8080/health
36+curl -s http://127.0.0.1:7920/health
3737 ```
3838
3939 Réponse : `{"status":"ok"}`, statut 200, tant que le processus tourne.
@@ -41,7 +41,7 @@ Réponse : `{"status":"ok"}`, statut 200, tant que le processus tourne.
4141 ## GET /v1/models
4242
4343 ```bash
44-curl -s http://127.0.0.1:8080/v1/models
44+curl -s http://127.0.0.1:7920/v1/models
4545 ```
4646
4747 Réponse : `{"object": "list", "data": [<modèle>, …]}`. La liste contient, dans cet ordre : les modèles déclarés dans la configuration (sous leur `id`), puis les modèles chargeables du cache Hugging Face, puis les modèles chargés par leur identifiant Hugging Face qui ne sont ni l'un ni l'autre.
@@ -69,7 +69,7 @@ Tout le reste donne un 404 `model_not_found`.
6969 ## POST /v1/chat/completions
7070
7171 ```bash
72-curl -s http://127.0.0.1:8080/v1/chat/completions \
72+curl -s http://127.0.0.1:7920/v1/chat/completions \
7373 -H "Content-Type: application/json" \
7474 -d '{
7575 "model": "mlx-community/Qwen3-4B-4bit",
@@ -184,7 +184,7 @@ Quand une séquence d'arrêt termine la réponse, le moteur est interrompu avant
184184 - Avec `"strict": true`, un schéma qui utilise un mot-clé que le décodeur ne sait pas appliquer est refusé avec un 400 qui le nomme et dit où il se trouve : `not`, `if`, `then`, `else`, `dependentRequired`, `dependentSchemas`, `multipleOf`, `uniqueItems`, `contains`, `minContains`, `maxContains`. Sans `strict`, ces mots-clés sont ignorés.
185185
186186 ```bash
187-curl -s http://127.0.0.1:8080/v1/chat/completions \
187+curl -s http://127.0.0.1:7920/v1/chat/completions \
188188 -H "Content-Type: application/json" \
189189 -d '{
190190 "model": "mlx-community/Qwen3-4B-4bit",
@@ -218,7 +218,7 @@ curl -s http://127.0.0.1:8080/v1/chat/completions \
218218 - Avec `parallel_tool_calls: false`, les appels après le premier sont écartés.
219219
220220 ```bash
221-curl -s http://127.0.0.1:8080/v1/chat/completions \
221+curl -s http://127.0.0.1:7920/v1/chat/completions \
222222 -H "Content-Type: application/json" \
223223 -d '{
224224 "model": "mlx-community/Qwen3-4B-4bit",
@@ -236,7 +236,7 @@ curl -s http://127.0.0.1:8080/v1/chat/completions \
236236 L'endpoint historique de complétion de texte. Le prompt est tokenisé tel quel puis continué : pas de chat template, pas de réflexion, pas d'analyse des appels d'outils.
237237
238238 ```bash
239-curl -s http://127.0.0.1:8080/v1/completions \
239+curl -s http://127.0.0.1:7920/v1/completions \
240240 -H "Content-Type: application/json" \
241241 -d '{"model": "mlx-community/Qwen3-4B-4bit", "prompt": "The capital of France is", "max_tokens": 8, "temperature": 0}'
242242 ```
@@ -257,7 +257,7 @@ Réponse : `{"id": "cmpl-…", "object": "text_completion", "created", "model",
257257 ## POST /v1/embeddings
258258
259259 ```bash
260-curl -s http://127.0.0.1:8080/v1/embeddings \
260+curl -s http://127.0.0.1:7920/v1/embeddings \
261261 -H "Content-Type: application/json" \
262262 -d '{"model": "BAAI/bge-small-en-v1.5", "input": ["The cat sits on the mat.", "A feline rests on a rug."]}'
263263 ```
@@ -293,7 +293,7 @@ data: [DONE]
293293 - Quand le client se déconnecte, la génération s'arrête et le modèle est libéré pour la requête suivante.
294294
295295 ```bash
296-curl -sN http://127.0.0.1:8080/v1/chat/completions \
296+curl -sN http://127.0.0.1:7920/v1/chat/completions \
297297 -H "Content-Type: application/json" \
298298 -d '{"model": "mlx-community/Qwen3-4B-4bit", "messages": [{"role": "user", "content": "Count to 5."}],
299299 "stream": true, "stream_options": {"include_usage": true}, "reasoning_effort": "none"}'
@@ -8,7 +8,7 @@ Les exemples utilisent `mlx-community/Qwen3-4B-4bit` comme modèle de chat et `B
8 8
9 | Règle | Valeur |9 | Règle | Valeur |
10 | --- | --- |10 | --- | --- |
11-| URL de base | `http://<hôte>:<port>/v1`, par défaut `http://127.0.0.1:8080/v1` |11+| URL de base | `http://<hôte>:<port>/v1`, par défaut `http://127.0.0.1:7920/v1` |
12 | Corps de requête | JSON (`Content-Type: application/json`), 16 Mio au plus (au-delà : 413) |12 | Corps de requête | JSON (`Content-Type: application/json`), 16 Mio au plus (au-delà : 413) |
13 | Corps de réponse | JSON compact, clés triées ; les flux sont des Server-Sent Events |13 | Corps de réponse | JSON compact, clés triées ; les flux sont des Server-Sent Events |
14 | Authentification | `Authorization: Bearer <clé>` sur toutes les routes sauf `/health` quand le serveur a une clé d'API ([`--api-key-env`](ligne-de-commande.md#rzb-serve)) ; aucune sinon |14 | Authentification | `Authorization: Bearer <clé>` sur toutes les routes sauf `/health` quand le serveur a une clé d'API ([`--api-key-env`](ligne-de-commande.md#rzb-serve)) ; aucune sinon |
@@ -33,7 +33,7 @@ Tout autre chemin répond 404 avec le code `unknown_url`.
33 ## GET /health33 ## GET /health
34 34
35 ```bash35 ```bash
36-curl -s http://127.0.0.1:8080/health36+curl -s http://127.0.0.1:7920/health
37 ```37 ```
38 38
39 Réponse : `{"status":"ok"}`, statut 200, tant que le processus tourne.39 Réponse : `{"status":"ok"}`, statut 200, tant que le processus tourne.
@@ -41,7 +41,7 @@ Réponse : `{"status":"ok"}`, statut 200, tant que le processus tourne.
41 ## GET /v1/models41 ## GET /v1/models
42 42
43 ```bash43 ```bash
44-curl -s http://127.0.0.1:8080/v1/models44+curl -s http://127.0.0.1:7920/v1/models
45 ```45 ```
46 46
47 Réponse : `{"object": "list", "data": [<modèle>, …]}`. La liste contient, dans cet ordre : les modèles déclarés dans la configuration (sous leur `id`), puis les modèles chargeables du cache Hugging Face, puis les modèles chargés par leur identifiant Hugging Face qui ne sont ni l'un ni l'autre.47 Réponse : `{"object": "list", "data": [<modèle>, …]}`. La liste contient, dans cet ordre : les modèles déclarés dans la configuration (sous leur `id`), puis les modèles chargeables du cache Hugging Face, puis les modèles chargés par leur identifiant Hugging Face qui ne sont ni l'un ni l'autre.
@@ -69,7 +69,7 @@ Tout le reste donne un 404 `model_not_found`.
69 ## POST /v1/chat/completions69 ## POST /v1/chat/completions
70 70
71 ```bash71 ```bash
72-curl -s http://127.0.0.1:8080/v1/chat/completions \72+curl -s http://127.0.0.1:7920/v1/chat/completions \
73 -H "Content-Type: application/json" \73 -H "Content-Type: application/json" \
74 -d '{74 -d '{
75 "model": "mlx-community/Qwen3-4B-4bit",75 "model": "mlx-community/Qwen3-4B-4bit",
@@ -184,7 +184,7 @@ Quand une séquence d'arrêt termine la réponse, le moteur est interrompu avant
184 - Avec `"strict": true`, un schéma qui utilise un mot-clé que le décodeur ne sait pas appliquer est refusé avec un 400 qui le nomme et dit où il se trouve : `not`, `if`, `then`, `else`, `dependentRequired`, `dependentSchemas`, `multipleOf`, `uniqueItems`, `contains`, `minContains`, `maxContains`. Sans `strict`, ces mots-clés sont ignorés.184 - Avec `"strict": true`, un schéma qui utilise un mot-clé que le décodeur ne sait pas appliquer est refusé avec un 400 qui le nomme et dit où il se trouve : `not`, `if`, `then`, `else`, `dependentRequired`, `dependentSchemas`, `multipleOf`, `uniqueItems`, `contains`, `minContains`, `maxContains`. Sans `strict`, ces mots-clés sont ignorés.
185 185
186 ```bash186 ```bash
187-curl -s http://127.0.0.1:8080/v1/chat/completions \187+curl -s http://127.0.0.1:7920/v1/chat/completions \
188 -H "Content-Type: application/json" \188 -H "Content-Type: application/json" \
189 -d '{189 -d '{
190 "model": "mlx-community/Qwen3-4B-4bit",190 "model": "mlx-community/Qwen3-4B-4bit",
@@ -218,7 +218,7 @@ curl -s http://127.0.0.1:8080/v1/chat/completions \
218 - Avec `parallel_tool_calls: false`, les appels après le premier sont écartés.218 - Avec `parallel_tool_calls: false`, les appels après le premier sont écartés.
219 219
220 ```bash220 ```bash
221-curl -s http://127.0.0.1:8080/v1/chat/completions \221+curl -s http://127.0.0.1:7920/v1/chat/completions \
222 -H "Content-Type: application/json" \222 -H "Content-Type: application/json" \
223 -d '{223 -d '{
224 "model": "mlx-community/Qwen3-4B-4bit",224 "model": "mlx-community/Qwen3-4B-4bit",
@@ -236,7 +236,7 @@ curl -s http://127.0.0.1:8080/v1/chat/completions \
236 L'endpoint historique de complétion de texte. Le prompt est tokenisé tel quel puis continué : pas de chat template, pas de réflexion, pas d'analyse des appels d'outils.236 L'endpoint historique de complétion de texte. Le prompt est tokenisé tel quel puis continué : pas de chat template, pas de réflexion, pas d'analyse des appels d'outils.
237 237
238 ```bash238 ```bash
239-curl -s http://127.0.0.1:8080/v1/completions \239+curl -s http://127.0.0.1:7920/v1/completions \
240 -H "Content-Type: application/json" \240 -H "Content-Type: application/json" \
241 -d '{"model": "mlx-community/Qwen3-4B-4bit", "prompt": "The capital of France is", "max_tokens": 8, "temperature": 0}'241 -d '{"model": "mlx-community/Qwen3-4B-4bit", "prompt": "The capital of France is", "max_tokens": 8, "temperature": 0}'
242 ```242 ```
@@ -257,7 +257,7 @@ Réponse : `{"id": "cmpl-…", "object": "text_completion", "created", "model",
257 ## POST /v1/embeddings257 ## POST /v1/embeddings
258 258
259 ```bash259 ```bash
260-curl -s http://127.0.0.1:8080/v1/embeddings \260+curl -s http://127.0.0.1:7920/v1/embeddings \
261 -H "Content-Type: application/json" \261 -H "Content-Type: application/json" \
262 -d '{"model": "BAAI/bge-small-en-v1.5", "input": ["The cat sits on the mat.", "A feline rests on a rug."]}'262 -d '{"model": "BAAI/bge-small-en-v1.5", "input": ["The cat sits on the mat.", "A feline rests on a rug."]}'
263 ```263 ```
@@ -293,7 +293,7 @@ data: [DONE]
293 - Quand le client se déconnecte, la génération s'arrête et le modèle est libéré pour la requête suivante.293 - Quand le client se déconnecte, la génération s'arrête et le modèle est libéré pour la requête suivante.
294 294
295 ```bash295 ```bash
296-curl -sN http://127.0.0.1:8080/v1/chat/completions \296+curl -sN http://127.0.0.1:7920/v1/chat/completions \
297 -H "Content-Type: application/json" \297 -H "Content-Type: application/json" \
298 -d '{"model": "mlx-community/Qwen3-4B-4bit", "messages": [{"role": "user", "content": "Count to 5."}],298 -d '{"model": "mlx-community/Qwen3-4B-4bit", "messages": [{"role": "user", "content": "Count to 5."}],
299 "stream": true, "stream_options": {"include_usage": true}, "reasoning_effort": "none"}'299 "stream": true, "stream_options": {"include_usage": true}, "reasoning_effort": "none"}'
modified docs/fr/reference/configuration.md +2 -2
@@ -7,7 +7,7 @@ Toutes les sections sont facultatives ; un fichier vide, ou pas de fichier du to
77 ```yaml
88 server:
99 host: 127.0.0.1
10- port: 8080
10+ port: 7920
1111 api_key_env: RZB_API_KEY
1212 defaults:
1313 temperature: 0.6
@@ -45,7 +45,7 @@ Les options de la ligne de commande l'emportent sur ces clés ([`rzb serve`](lig
4545 | Clé | Type | Défaut | Description |
4646 | --- | --- | --- | --- |
4747 | `host` | chaîne non vide | `127.0.0.1` | Adresse d'écoute ; `0.0.0.0` pour toutes les interfaces |
48-| `port` | entier, 1–65535 | `8080` | Port TCP |
48+| `port` | entier, 1–65535 | `7920` | Port TCP |
4949 | `api_key_env` | chaîne non vide | `RZB_API_KEY` | Nom de la variable d'environnement qui contient la clé d'API. La clé elle-même n'est jamais dans le fichier. Quand la variable est définie et non vide, toutes les routes sauf `/health` exigent `Authorization: Bearer <clé>` |
5050 | `cors_origin` | chaîne non vide | aucune (CORS désactivé) | Origine autorisée à appeler l'API depuis un navigateur ; `*` pour toutes |
5151
@@ -7,7 +7,7 @@ Toutes les sections sont facultatives ; un fichier vide, ou pas de fichier du to
7 ```yaml7 ```yaml
8 server:8 server:
9 host: 127.0.0.19 host: 127.0.0.1
10- port: 808010+ port: 7920
11 api_key_env: RZB_API_KEY11 api_key_env: RZB_API_KEY
12 defaults:12 defaults:
13 temperature: 0.613 temperature: 0.6
@@ -45,7 +45,7 @@ Les options de la ligne de commande l'emportent sur ces clés ([`rzb serve`](lig
45 | Clé | Type | Défaut | Description |45 | Clé | Type | Défaut | Description |
46 | --- | --- | --- | --- |46 | --- | --- | --- | --- |
47 | `host` | chaîne non vide | `127.0.0.1` | Adresse d'écoute ; `0.0.0.0` pour toutes les interfaces |47 | `host` | chaîne non vide | `127.0.0.1` | Adresse d'écoute ; `0.0.0.0` pour toutes les interfaces |
48-| `port` | entier, 1–65535 | `8080` | Port TCP |48+| `port` | entier, 1–65535 | `7920` | Port TCP |
49 | `api_key_env` | chaîne non vide | `RZB_API_KEY` | Nom de la variable d'environnement qui contient la clé d'API. La clé elle-même n'est jamais dans le fichier. Quand la variable est définie et non vide, toutes les routes sauf `/health` exigent `Authorization: Bearer <clé>` |49 | `api_key_env` | chaîne non vide | `RZB_API_KEY` | Nom de la variable d'environnement qui contient la clé d'API. La clé elle-même n'est jamais dans le fichier. Quand la variable est définie et non vide, toutes les routes sauf `/health` exigent `Authorization: Bearer <clé>` |
50 | `cors_origin` | chaîne non vide | aucune (CORS désactivé) | Origine autorisée à appeler l'API depuis un navigateur ; `*` pour toutes |50 | `cors_origin` | chaîne non vide | aucune (CORS désactivé) | Origine autorisée à appeler l'API depuis un navigateur ; `*` pour toutes |
51 51
modified docs/fr/reference/erreurs.md +1 -1
@@ -36,7 +36,7 @@ Pendant un flux, une erreur survenue après le premier morceau est envoyée comm
3636 | --- | --- | --- | --- |
3737 | `invalid_api_key` | 401 | `Incorrect or missing API key. Send it as 'Authorization: Bearer <key>'.` | `Authorization: Bearer` absent ou différent de la clé du serveur |
3838 | `model_not_found` | 404 | `The model 'qwen9' does not exist.` | Ni un `id` déclaré, ni un identifiant Hugging Face `org/nom` |
39-| `unknown_url` | 404 | `Invalid URL (GET /v1/nothing)` | Endpoint inexistant |
39+| `unknown_url` | 404 | `Invalid URL (GET /v1/nothing)` | Endpoint inexistant. Sur `/`, `/v1` et `/v1/`, le message précise que `/v1` est l'URL de base, avec `GET /v1/models` et `POST /v1/chat/completions` en exemples. |
4040 | `model_not_supported` | 400 | `the model 'org/name' is not in MLX format (no .safetensors weights)` | Le dépôt du cache n'a pas de poids MLX (GGUF…) |
4141 | `queue_full` | 429 | `too many requests waiting for 'qwen3' (max_queue: 16); retry later` | Plus de `limits.max_queue` requêtes en attente |
4242 | `server_busy` | 503 | `cannot load 'qwen3': every loaded model is busy (max_loaded_models reached); retry later` | Tous les modèles chargés répondent et `max_loaded_models` est atteint |
@@ -36,7 +36,7 @@ Pendant un flux, une erreur survenue après le premier morceau est envoyée comm
36 | --- | --- | --- | --- |36 | --- | --- | --- | --- |
37 | `invalid_api_key` | 401 | `Incorrect or missing API key. Send it as 'Authorization: Bearer <key>'.` | `Authorization: Bearer` absent ou différent de la clé du serveur |37 | `invalid_api_key` | 401 | `Incorrect or missing API key. Send it as 'Authorization: Bearer <key>'.` | `Authorization: Bearer` absent ou différent de la clé du serveur |
38 | `model_not_found` | 404 | `The model 'qwen9' does not exist.` | Ni un `id` déclaré, ni un identifiant Hugging Face `org/nom` |38 | `model_not_found` | 404 | `The model 'qwen9' does not exist.` | Ni un `id` déclaré, ni un identifiant Hugging Face `org/nom` |
39-| `unknown_url` | 404 | `Invalid URL (GET /v1/nothing)` | Endpoint inexistant |39+| `unknown_url` | 404 | `Invalid URL (GET /v1/nothing)` | Endpoint inexistant. Sur `/`, `/v1` et `/v1/`, le message précise que `/v1` est l'URL de base, avec `GET /v1/models` et `POST /v1/chat/completions` en exemples. |
40 | `model_not_supported` | 400 | `the model 'org/name' is not in MLX format (no .safetensors weights)` | Le dépôt du cache n'a pas de poids MLX (GGUF…) |40 | `model_not_supported` | 400 | `the model 'org/name' is not in MLX format (no .safetensors weights)` | Le dépôt du cache n'a pas de poids MLX (GGUF…) |
41 | `queue_full` | 429 | `too many requests waiting for 'qwen3' (max_queue: 16); retry later` | Plus de `limits.max_queue` requêtes en attente |41 | `queue_full` | 429 | `too many requests waiting for 'qwen3' (max_queue: 16); retry later` | Plus de `limits.max_queue` requêtes en attente |
42 | `server_busy` | 503 | `cannot load 'qwen3': every loaded model is busy (max_loaded_models reached); retry later` | Tous les modèles chargés répondent et `max_loaded_models` est atteint |42 | `server_busy` | 503 | `cannot load 'qwen3': every loaded model is busy (max_loaded_models reached); retry later` | Tous les modèles chargés répondent et `max_loaded_models` est atteint |
modified docs/fr/reference/ligne-de-commande.md +2 -2
@@ -27,7 +27,7 @@ Démarre le serveur et tourne jusqu'à Ctrl-C ou SIGTERM ; il cesse alors d'acce
2727 | --- | --- | --- | --- |
2828 | `--config <fichier>` | chemin | aucun | Fichier de configuration du serveur ([référence](configuration.md)). Sans lui : aucun modèle déclaré, défauts intégrés |
2929 | `--host <adresse>` | chaîne non vide | `server.host`, sinon `127.0.0.1` | Adresse d'écoute ; `0.0.0.0` pour toutes les interfaces |
30-| `--port <n>` | entier, 1–65535 | `server.port`, sinon `8080` | Port TCP |
30+| `--port <n>` | entier, 1–65535 | `server.port`, sinon `7920` | Port TCP |
3131 | `--api-key-env <nom>` | chaîne | `server.api_key_env`, sinon `RZB_API_KEY` | Variable d'environnement qui contient la clé d'API. Définie et non vide : toutes les routes sauf `/health` exigent `Authorization: Bearer <clé>` |
3232 | `--cors-origin <origine>` | chaîne | `server.cors_origin`, sinon aucune | Autoriser les pages web de cette origine à appeler l'API ; `*` pour toutes |
3333
@@ -35,7 +35,7 @@ Les options l'emportent sur la section `server:` du fichier. Au démarrage, il a
3535
3636 ```
3737 config: server.yaml (2 declared models)
38-rzb 0.2.0 serving http://127.0.0.1:8080/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop
38+rzb 0.2.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop
3939 ```
4040
4141 La première ligne n'apparaît qu'avec `--config`. Des avertissements (`warning: …`) précèdent la bannière quand le serveur écoute sur une adresse réseau sans clé d'API, ou autorise toutes les origines CORS sans clé. Ensuite, une ligne de journal par requête : méthode, chemin, statut, durée, et le modèle et les nombres de tokens (`model=… tokens=<prompt>+<complétion>`, plus `cached=<n>` quand une partie du prompt a été reprise de la requête précédente) ; les prompts et les réponses ne sont jamais journalisés.
@@ -27,7 +27,7 @@ Démarre le serveur et tourne jusqu'à Ctrl-C ou SIGTERM ; il cesse alors d'acce
27 | --- | --- | --- | --- |27 | --- | --- | --- | --- |
28 | `--config <fichier>` | chemin | aucun | Fichier de configuration du serveur ([référence](configuration.md)). Sans lui : aucun modèle déclaré, défauts intégrés |28 | `--config <fichier>` | chemin | aucun | Fichier de configuration du serveur ([référence](configuration.md)). Sans lui : aucun modèle déclaré, défauts intégrés |
29 | `--host <adresse>` | chaîne non vide | `server.host`, sinon `127.0.0.1` | Adresse d'écoute ; `0.0.0.0` pour toutes les interfaces |29 | `--host <adresse>` | chaîne non vide | `server.host`, sinon `127.0.0.1` | Adresse d'écoute ; `0.0.0.0` pour toutes les interfaces |
30-| `--port <n>` | entier, 1–65535 | `server.port`, sinon `8080` | Port TCP |30+| `--port <n>` | entier, 1–65535 | `server.port`, sinon `7920` | Port TCP |
31 | `--api-key-env <nom>` | chaîne | `server.api_key_env`, sinon `RZB_API_KEY` | Variable d'environnement qui contient la clé d'API. Définie et non vide : toutes les routes sauf `/health` exigent `Authorization: Bearer <clé>` |31 | `--api-key-env <nom>` | chaîne | `server.api_key_env`, sinon `RZB_API_KEY` | Variable d'environnement qui contient la clé d'API. Définie et non vide : toutes les routes sauf `/health` exigent `Authorization: Bearer <clé>` |
32 | `--cors-origin <origine>` | chaîne | `server.cors_origin`, sinon aucune | Autoriser les pages web de cette origine à appeler l'API ; `*` pour toutes |32 | `--cors-origin <origine>` | chaîne | `server.cors_origin`, sinon aucune | Autoriser les pages web de cette origine à appeler l'API ; `*` pour toutes |
33 33
@@ -35,7 +35,7 @@ Les options l'emportent sur la section `server:` du fichier. Au démarrage, il a
35 35
36 ```36 ```
37 config: server.yaml (2 declared models)37 config: server.yaml (2 declared models)
38-rzb 0.2.0 serving http://127.0.0.1:8080/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop38+rzb 0.2.0 serving http://127.0.0.1:7920/v1 (API key from $RZB_API_KEY) — Ctrl-C to stop
39 ```39 ```
40 40
41 La première ligne n'apparaît qu'avec `--config`. Des avertissements (`warning: …`) précèdent la bannière quand le serveur écoute sur une adresse réseau sans clé d'API, ou autorise toutes les origines CORS sans clé. Ensuite, une ligne de journal par requête : méthode, chemin, statut, durée, et le modèle et les nombres de tokens (`model=… tokens=<prompt>+<complétion>`, plus `cached=<n>` quand une partie du prompt a été reprise de la requête précédente) ; les prompts et les réponses ne sont jamais journalisés.41 La première ligne n'apparaît qu'avec `--config`. Des avertissements (`warning: …`) précèdent la bannière quand le serveur écoute sur une adresse réseau sans clé d'API, ou autorise toutes les origines CORS sans clé. Ensuite, une ligne de journal par requête : méthode, chemin, statut, durée, et le modèle et les nombres de tokens (`model=… tokens=<prompt>+<complétion>`, plus `cached=<n>` quand une partie du prompt a été reprise de la requête précédente) ; les prompts et les réponses ne sont jamais journalisés.
modified docs/fr/tutorials/premiers-pas.md +5 -5
@@ -43,7 +43,7 @@ rzb serve
4343 Vous devez voir :
4444
4545 ```
46-rzb 0.2.0 serving http://127.0.0.1:8080/v1 (no API key) — Ctrl-C to stop
46+rzb 0.2.0 serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop
4747 ```
4848
4949 Le serveur tourne et n'accepte que les connexions venant de ce Mac. Laissez ce terminal ouvert, et **ouvrez un second terminal** pour la suite.
@@ -53,7 +53,7 @@ Le serveur tourne et n'accepte que les connexions venant de ce Mac. Laissez ce t
5353 Dans le second terminal, tapez :
5454
5555 ```bash
56-curl -s http://127.0.0.1:8080/health
56+curl -s http://127.0.0.1:7920/health
5757 ```
5858
5959 Vous devez voir :
@@ -65,7 +65,7 @@ Vous devez voir :
6565 Demandez-lui maintenant quels modèles il peut servir :
6666
6767 ```bash
68-curl -s http://127.0.0.1:8080/v1/models | python3 -m json.tool
68+curl -s http://127.0.0.1:7920/v1/models | python3 -m json.tool
6969 ```
7070
7171 Vous devez voir une liste qui contient le modèle téléchargé :
@@ -93,7 +93,7 @@ Vous devez voir une liste qui contient le modèle téléchargé :
9393 Tapez :
9494
9595 ```bash
96-curl -s http://127.0.0.1:8080/v1/chat/completions \
96+curl -s http://127.0.0.1:7920/v1/chat/completions \
9797 -H "Content-Type: application/json" \
9898 -d '{
9999 "model": "mlx-community/Qwen3-0.6B-4bit",
@@ -144,7 +144,7 @@ Tout programme écrit pour l'API OpenAI peut utiliser le serveur en changeant so
144144 ```python
145145 from openai import OpenAI
146146
147-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")
147+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
148148
149149 stream = client.chat.completions.create(
150150 model="mlx-community/Qwen3-0.6B-4bit",
@@ -43,7 +43,7 @@ rzb serve
43 Vous devez voir :43 Vous devez voir :
44 44
45 ```45 ```
46-rzb 0.2.0 serving http://127.0.0.1:8080/v1 (no API key) — Ctrl-C to stop46+rzb 0.2.0 serving http://127.0.0.1:7920/v1 (no API key) — Ctrl-C to stop
47 ```47 ```
48 48
49 Le serveur tourne et n'accepte que les connexions venant de ce Mac. Laissez ce terminal ouvert, et **ouvrez un second terminal** pour la suite.49 Le serveur tourne et n'accepte que les connexions venant de ce Mac. Laissez ce terminal ouvert, et **ouvrez un second terminal** pour la suite.
@@ -53,7 +53,7 @@ Le serveur tourne et n'accepte que les connexions venant de ce Mac. Laissez ce t
53 Dans le second terminal, tapez :53 Dans le second terminal, tapez :
54 54
55 ```bash55 ```bash
56-curl -s http://127.0.0.1:8080/health56+curl -s http://127.0.0.1:7920/health
57 ```57 ```
58 58
59 Vous devez voir :59 Vous devez voir :
@@ -65,7 +65,7 @@ Vous devez voir :
65 Demandez-lui maintenant quels modèles il peut servir :65 Demandez-lui maintenant quels modèles il peut servir :
66 66
67 ```bash67 ```bash
68-curl -s http://127.0.0.1:8080/v1/models | python3 -m json.tool68+curl -s http://127.0.0.1:7920/v1/models | python3 -m json.tool
69 ```69 ```
70 70
71 Vous devez voir une liste qui contient le modèle téléchargé :71 Vous devez voir une liste qui contient le modèle téléchargé :
@@ -93,7 +93,7 @@ Vous devez voir une liste qui contient le modèle téléchargé :
93 Tapez :93 Tapez :
94 94
95 ```bash95 ```bash
96-curl -s http://127.0.0.1:8080/v1/chat/completions \96+curl -s http://127.0.0.1:7920/v1/chat/completions \
97 -H "Content-Type: application/json" \97 -H "Content-Type: application/json" \
98 -d '{98 -d '{
99 "model": "mlx-community/Qwen3-0.6B-4bit",99 "model": "mlx-community/Qwen3-0.6B-4bit",
@@ -144,7 +144,7 @@ Tout programme écrit pour l'API OpenAI peut utiliser le serveur en changeant so
144 ```python144 ```python
145 from openai import OpenAI145 from openai import OpenAI
146 146
147-client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")147+client = OpenAI(base_url="http://127.0.0.1:7920/v1", api_key="unused")
148 148
149 stream = client.chat.completions.create(149 stream = client.chat.completions.create(
150 model="mlx-community/Qwen3-0.6B-4bit",150 model="mlx-community/Qwen3-0.6B-4bit",
modified examples/server.yaml +1 -1
@@ -4,7 +4,7 @@
44
55 server:
66 host: 127.0.0.1 # 0.0.0.0 serves the whole network: set an API key then
7- port: 8080
7+ port: 7920
88 api_key_env: RZB_API_KEY # the variable holding the key; the key never goes in this file
99 # cors_origin: "*" # let browser pages call the API
1010
@@ -4,7 +4,7 @@
4 4
5 server:5 server:
6 host: 127.0.0.1 # 0.0.0.0 serves the whole network: set an API key then6 host: 127.0.0.1 # 0.0.0.0 serves the whole network: set an API key then
7- port: 80807+ port: 7920
8 api_key_env: RZB_API_KEY # the variable holding the key; the key never goes in this file8 api_key_env: RZB_API_KEY # the variable holding the key; the key never goes in this file
9 # cors_origin: "*" # let browser pages call the API9 # cors_origin: "*" # let browser pages call the API
10 10
modified release-notes/v0.2.0.fr.md +1 -1
@@ -4,7 +4,7 @@ razorbill devient un serveur de modèles pour Apple Silicon : `rzb serve` fait t
44
55 ## Nouveautés
66
7-- `rzb serve` : serveur HTTP (127.0.0.1 par défaut), clé d'API facultative lue dans l'environnement, CORS, format d'erreur OpenAI, `GET /health`.
7+- `rzb serve` : serveur HTTP (127.0.0.1:7920 par défaut), clé d'API facultative lue dans l'environnement, CORS, format d'erreur OpenAI, `GET /health`.
88 - Fichier de configuration du serveur : noms et alias de modèles, `defaults`, valeurs `locked`, limites ; `rzb config validate`.
99 - Modèles chargés à la demande, une file par modèle, `keep_alive`, déchargement sous pression mémoire ; `GET /v1/models`.
1010 - `POST /v1/chat/completions`, en une fois ou en flux (SSE, `stream_options.include_usage`, annulation quand le client part).
@@ -4,7 +4,7 @@ razorbill devient un serveur de modèles pour Apple Silicon : `rzb serve` fait t
4 4
5 ## Nouveautés5 ## Nouveautés
6 6
7-- `rzb serve` : serveur HTTP (127.0.0.1 par défaut), clé d'API facultative lue dans l'environnement, CORS, format d'erreur OpenAI, `GET /health`.7+- `rzb serve` : serveur HTTP (127.0.0.1:7920 par défaut), clé d'API facultative lue dans l'environnement, CORS, format d'erreur OpenAI, `GET /health`.
8 - Fichier de configuration du serveur : noms et alias de modèles, `defaults`, valeurs `locked`, limites ; `rzb config validate`.8 - Fichier de configuration du serveur : noms et alias de modèles, `defaults`, valeurs `locked`, limites ; `rzb config validate`.
9 - Modèles chargés à la demande, une file par modèle, `keep_alive`, déchargement sous pression mémoire ; `GET /v1/models`.9 - Modèles chargés à la demande, une file par modèle, `keep_alive`, déchargement sous pression mémoire ; `GET /v1/models`.
10 - `POST /v1/chat/completions`, en une fois ou en flux (SSE, `stream_options.include_usage`, annulation quand le client part).10 - `POST /v1/chat/completions`, en une fois ou en flux (SSE, `stream_options.include_usage`, annulation quand le client part).
modified release-notes/v0.2.0.md +1 -1
@@ -4,7 +4,7 @@ razorbill becomes a model server for Apple Silicon: `rzb serve` runs MLX models
44
55 ## New
66
7-- `rzb serve`: HTTP server (127.0.0.1 by default), optional API key from the environment, CORS, OpenAI error format, `GET /health`.
7+- `rzb serve`: HTTP server (127.0.0.1:7920 by default), optional API key from the environment, CORS, OpenAI error format, `GET /health`.
88 - Server configuration file: model names and aliases, `defaults`, `locked` values, limits; `rzb config validate`.
99 - Models loaded on demand, one queue per model, `keep_alive`, eviction under memory pressure; `GET /v1/models`.
1010 - `POST /v1/chat/completions`, plain and streamed (SSE, `stream_options.include_usage`, cancellation when the client leaves).
@@ -4,7 +4,7 @@ razorbill becomes a model server for Apple Silicon: `rzb serve` runs MLX models
4 4
5 ## New5 ## New
6 6
7-- `rzb serve`: HTTP server (127.0.0.1 by default), optional API key from the environment, CORS, OpenAI error format, `GET /health`.7+- `rzb serve`: HTTP server (127.0.0.1:7920 by default), optional API key from the environment, CORS, OpenAI error format, `GET /health`.
8 - Server configuration file: model names and aliases, `defaults`, `locked` values, limits; `rzb config validate`.8 - Server configuration file: model names and aliases, `defaults`, `locked` values, limits; `rzb config validate`.
9 - Models loaded on demand, one queue per model, `keep_alive`, eviction under memory pressure; `GET /v1/models`.9 - Models loaded on demand, one queue per model, `keep_alive`, eviction under memory pressure; `GET /v1/models`.
10 - `POST /v1/chat/completions`, plain and streamed (SSE, `stream_options.include_usage`, cancellation when the client leaves).10 - `POST /v1/chat/completions`, plain and streamed (SSE, `stream_options.include_usage`, cancellation when the client leaves).
modified scripts/compat.sh +1 -1
@@ -4,7 +4,7 @@
44 #
55 # scripts/compat.sh start a server, run the suite, stop the server
66 # scripts/compat.sh -k tools extra arguments go to pytest
7-# RZB_URL=http://host:8080/v1 scripts/compat.sh use a server already running
7+# RZB_URL=http://host:7920/v1 scripts/compat.sh use a server already running
88 #
99 # On Linux the server runs the fake engine: the protocol is checked, real-model tests are skipped.
1010 # On the Mac it runs MLX with these models (pull them first with `rzb models pull`):
@@ -4,7 +4,7 @@
4 #4 #
5 # scripts/compat.sh start a server, run the suite, stop the server5 # scripts/compat.sh start a server, run the suite, stop the server
6 # scripts/compat.sh -k tools extra arguments go to pytest6 # scripts/compat.sh -k tools extra arguments go to pytest
7-# RZB_URL=http://host:8080/v1 scripts/compat.sh use a server already running7+# RZB_URL=http://host:7920/v1 scripts/compat.sh use a server already running
8 #8 #
9 # On Linux the server runs the fake engine: the protocol is checked, real-model tests are skipped.9 # On Linux the server runs the fake engine: the protocol is checked, real-model tests are skipped.
10 # On the Mac it runs MLX with these models (pull them first with `rzb models pull`):10 # On the Mac it runs MLX with these models (pull them first with `rzb models pull`):