scripts/install.sh: build and install rzb under /usr/local
rzb and its resource bundles go to /usr/local/lib/razorbill; /usr/local/bin/rzb is a launcher that execs it (rzb cannot be copied alone). --no-build, --prefix, --uninstall; sudo only when the prefix is not writable. Docs EN + FR, release notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fe0695f parent: a218748 modified
.memory/handoffs/2026-11-25-v0-2-server-foundation.md +5 -0 | @@ -130,3 +130,8 @@ its bundles when started through a symlink (docs say: put the folder on PATH). N | ||
| 130 | 130 | v0.4 TUI planned: #51 closed, tickets #53–#59 (start with #53 admin routes, then #54 foundation); |
| 131 | 131 | open choices are listed inside the tickets (polling vs SSE, unload while busy, forms vs $EDITOR). v1.0.0 |
| 132 | 132 | signing #52. #47 leftovers have no milestone. |
| 133 | + | |
| 134 | +## Update 2026-11-26 — v0.2.0 tagged locally, install.sh | |
| 135 | +User is now trying rzb themselves (installed with `scripts/install.sh`) before starting v0.3 (spike | |
| 136 | +#46). Expect feedback from that use first. Not run on the Mac by Claude: install.sh, release.sh, | |
| 137 | +compat.sh. Nothing pushed; tag v0.2.0 is local. | |
| @@ -130,3 +130,8 @@ its bundles when started through a symlink (docs say: put the folder on PATH). N | |||
| 130 | v0.4 TUI planned: #51 closed, tickets #53–#59 (start with #53 admin routes, then #54 foundation); | 130 | v0.4 TUI planned: #51 closed, tickets #53–#59 (start with #53 admin routes, then #54 foundation); |
| 131 | open choices are listed inside the tickets (polling vs SSE, unload while busy, forms vs $EDITOR). v1.0.0 | 131 | open choices are listed inside the tickets (polling vs SSE, unload while busy, forms vs $EDITOR). v1.0.0 |
| 132 | signing #52. #47 leftovers have no milestone. | 132 | signing #52. #47 leftovers have no milestone. |
| 133 | + | ||
| 134 | +## Update 2026-11-26 — v0.2.0 tagged locally, install.sh | ||
| 135 | +User is now trying rzb themselves (installed with `scripts/install.sh`) before starting v0.3 (spike | ||
| 136 | +#46). Expect feedback from that use first. Not run on the Mac by Claude: install.sh, release.sh, | ||
| 137 | +compat.sh. Nothing pushed; tag v0.2.0 is local. | ||
modified
.memory/history.md +11 -0 | @@ -337,3 +337,14 @@ config. Rejected: a server inside the TUI (double model memory), connecting to r | ||
| 337 | 337 | Tickets: #53 local admin routes (status, unload, reload + SIGHUP, loopback only), #54 foundation |
| 338 | 338 | (restore v0.1 terminal layer, 4 screens, HTTP client), #55 chat, #56 dashboard, #57 models, #58 |
| 339 | 339 | settings (open: forms lose YAML comments vs $EDITOR), #59 docs; #26/#28 moved into v0.4. No code. |
| 340 | + | |
| 341 | +## 2026-11-26 — scripts/install.sh, v0.2.0 tagged | |
| 342 | + | |
| 343 | +User: "ok pour v0.2", merge on main, then wants to try rzb before v0.3; asked for an install.sh | |
| 344 | +that rebuilds and copies to /usr/local/bin. Done: `scripts/install.sh` — installs the folder under | |
| 345 | +/usr/local/lib/razorbill plus a launcher /usr/local/bin/rzb, because rzb needs its bundles next to | |
| 346 | +it (copying it alone was rejected; a symlink was rejected because bundle lookup through a symlink | |
| 347 | +is unverified). Tested on Linux with `--no-build --prefix` (install, reinstall, uninstall, refusal | |
| 348 | +on a foreign rzb); not yet run on the Mac. Docs EN+FR (build guide "Install", README, release | |
| 349 | +how-to, release notes). Gate PASS, links OK. main fast-forwarded, local tag v0.2.0. The Mac run of | |
| 350 | +scripts/release.sh and scripts/compat.sh was not reported by the user. | |
| @@ -337,3 +337,14 @@ config. Rejected: a server inside the TUI (double model memory), connecting to r | |||
| 337 | Tickets: #53 local admin routes (status, unload, reload + SIGHUP, loopback only), #54 foundation | 337 | Tickets: #53 local admin routes (status, unload, reload + SIGHUP, loopback only), #54 foundation |
| 338 | (restore v0.1 terminal layer, 4 screens, HTTP client), #55 chat, #56 dashboard, #57 models, #58 | 338 | (restore v0.1 terminal layer, 4 screens, HTTP client), #55 chat, #56 dashboard, #57 models, #58 |
| 339 | settings (open: forms lose YAML comments vs $EDITOR), #59 docs; #26/#28 moved into v0.4. No code. | 339 | settings (open: forms lose YAML comments vs $EDITOR), #59 docs; #26/#28 moved into v0.4. No code. |
| 340 | + | ||
| 341 | +## 2026-11-26 — scripts/install.sh, v0.2.0 tagged | ||
| 342 | + | ||
| 343 | +User: "ok pour v0.2", merge on main, then wants to try rzb before v0.3; asked for an install.sh | ||
| 344 | +that rebuilds and copies to /usr/local/bin. Done: `scripts/install.sh` — installs the folder under | ||
| 345 | +/usr/local/lib/razorbill plus a launcher /usr/local/bin/rzb, because rzb needs its bundles next to | ||
| 346 | +it (copying it alone was rejected; a symlink was rejected because bundle lookup through a symlink | ||
| 347 | +is unverified). Tested on Linux with `--no-build --prefix` (install, reinstall, uninstall, refusal | ||
| 348 | +on a foreign rzb); not yet run on the Mac. Docs EN+FR (build guide "Install", README, release | ||
| 349 | +how-to, release notes). Gate PASS, links OK. main fast-forwarded, local tag v0.2.0. The Mac run of | ||
| 350 | +scripts/release.sh and scripts/compat.sh was not reported by the user. | ||
modified
.memory/summary.md +7 -3 | @@ -91,8 +91,8 @@ server (tutorial, 10 how-to, 4 reference incl. `http-api.md` / `api-http.md`, 5 | ||
| 91 | 91 | `BAAI/bge-small-en-v1.5` are mapped to `chat` / `embed`): keep reference examples in that form, and |
| 92 | 92 | only successful calls in ```bash blocks. v0.2 tickets #31–#45 closed; #47 (KV-cache spike) |
| 93 | 93 | moved out of the milestone (no milestone, tasks 3–6 open). Release 0.2.0 prepared 2026-11-26: version |
| 94 | -string `0.2.0`, milestone v0.2 closed, notes in `release-notes/v0.2.0.md` / `.fr.md`; not tagged yet | |
| 95 | -(the user builds the archive on the Mac first). | |
| 94 | +string `0.2.0`, milestone v0.2 closed, notes in `release-notes/v0.2.0.md` / `.fr.md`; tagged `v0.2.0` | |
| 95 | +(local tag, not pushed) on 2026-11-26 at the user's "ok pour v0.2". | |
| 96 | 96 | |
| 97 | 97 | KV cache (#47 spike, tasks 1–2 done, report = comment 1 on #47; implemented in #48): `MLXEngine` |
| 98 | 98 | keeps one KV cache per loaded model (`PromptCache`, `Sources/RazorbillMLX/PromptCache.swift`) with |
| @@ -203,7 +203,11 @@ everything but MLX; Mac: `xcodebuild test -scheme razorbill`). Xcode scheme is ` | ||
| 203 | 203 | (keep it next to `mlx-swift_Cmlx.bundle`). |
| 204 | 204 | **Release archive**: `scripts/release.sh` (Mac: Release build into `.build/release`, then |
| 205 | 205 | `dist/razorbill-<version>-macos-arm64.tar.gz` + `.sha256` with `rzb` and every `*.bundle`; refuses a |
| 206 | -dirty tree unless `--allow-dirty`; `--products <dir>` packages an existing build, also from Linux). From the sandbox: `tools/host-runner/host.sh build|test . | |
| 206 | +dirty tree unless `--allow-dirty`; `--products <dir>` packages an existing build, also from Linux). | |
| 207 | +**Install on the Mac**: `scripts/install.sh` (incremental Release build in `.build/xcode`, copies rzb + | |
| 208 | +bundles to `<prefix>/lib/razorbill`, writes a launcher `<prefix>/bin/rzb` that execs it — a copy of | |
| 209 | +rzb alone would not find its bundles; prefix `/usr/local`, sudo only if not writable; `--no-build`, | |
| 210 | +`--prefix`, `--uninstall`; never touches an rzb launcher without its marker line). From the sandbox: `tools/host-runner/host.sh build|test . | |
| 207 | 211 | razorbill`, `host.sh run . rzb <args>` (no TTY: `rzb run` only); host-runner tests run in Debug |
| 208 | 212 | (`@testable import`). Sandbox started on the Mac with `sbx env run --force` (`sbxenv.yaml`). |
| 209 | 213 | Lint: `swiftlint lint --quiet Sources Tests` and `swift-format` (4 spaces); keep wrapped |
| @@ -91,8 +91,8 @@ server (tutorial, 10 how-to, 4 reference incl. `http-api.md` / `api-http.md`, 5 | |||
| 91 | `BAAI/bge-small-en-v1.5` are mapped to `chat` / `embed`): keep reference examples in that form, and | 91 | `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) |
| 93 | moved out of the milestone (no milestone, tasks 3–6 open). Release 0.2.0 prepared 2026-11-26: version | 93 | moved out of the milestone (no milestone, tasks 3–6 open). Release 0.2.0 prepared 2026-11-26: version |
| 94 | -string `0.2.0`, milestone v0.2 closed, notes in `release-notes/v0.2.0.md` / `.fr.md`; not tagged yet | 94 | +string `0.2.0`, milestone v0.2 closed, notes in `release-notes/v0.2.0.md` / `.fr.md`; tagged `v0.2.0` |
| 95 | -(the user builds the archive on the Mac first). | 95 | +(local tag, not pushed) on 2026-11-26 at the user's "ok pour v0.2". |
| 96 | 96 | ||
| 97 | KV cache (#47 spike, tasks 1–2 done, report = comment 1 on #47; implemented in #48): `MLXEngine` | 97 | KV cache (#47 spike, tasks 1–2 done, report = comment 1 on #47; implemented in #48): `MLXEngine` |
| 98 | keeps one KV cache per loaded model (`PromptCache`, `Sources/RazorbillMLX/PromptCache.swift`) with | 98 | keeps one KV cache per loaded model (`PromptCache`, `Sources/RazorbillMLX/PromptCache.swift`) with |
| @@ -203,7 +203,11 @@ everything but MLX; Mac: `xcodebuild test -scheme razorbill`). Xcode scheme is ` | |||
| 203 | (keep it next to `mlx-swift_Cmlx.bundle`). | 203 | (keep it next to `mlx-swift_Cmlx.bundle`). |
| 204 | **Release archive**: `scripts/release.sh` (Mac: Release build into `.build/release`, then | 204 | **Release archive**: `scripts/release.sh` (Mac: Release build into `.build/release`, then |
| 205 | `dist/razorbill-<version>-macos-arm64.tar.gz` + `.sha256` with `rzb` and every `*.bundle`; refuses a | 205 | `dist/razorbill-<version>-macos-arm64.tar.gz` + `.sha256` with `rzb` and every `*.bundle`; refuses a |
| 206 | -dirty tree unless `--allow-dirty`; `--products <dir>` packages an existing build, also from Linux). From the sandbox: `tools/host-runner/host.sh build|test . | 206 | +dirty tree unless `--allow-dirty`; `--products <dir>` packages an existing build, also from Linux). |
| 207 | +**Install on the Mac**: `scripts/install.sh` (incremental Release build in `.build/xcode`, copies rzb + | ||
| 208 | +bundles to `<prefix>/lib/razorbill`, writes a launcher `<prefix>/bin/rzb` that execs it — a copy of | ||
| 209 | +rzb alone would not find its bundles; prefix `/usr/local`, sudo only if not writable; `--no-build`, | ||
| 210 | +`--prefix`, `--uninstall`; never touches an rzb launcher without its marker line). From the sandbox: `tools/host-runner/host.sh build|test . | ||
| 207 | razorbill`, `host.sh run . rzb <args>` (no TTY: `rzb run` only); host-runner tests run in Debug | 211 | razorbill`, `host.sh run . rzb <args>` (no TTY: `rzb run` only); host-runner tests run in Debug |
| 208 | (`@testable import`). Sandbox started on the Mac with `sbx env run --force` (`sbxenv.yaml`). | 212 | (`@testable import`). Sandbox started on the Mac with `sbx env run --force` (`sbxenv.yaml`). |
| 209 | Lint: `swiftlint lint --quiet Sources Tests` and `swift-format` (4 spaces); keep wrapped | 213 | Lint: `swiftlint lint --quiet Sources Tests` and `swift-format` (4 spaces); keep wrapped |
modified
.quality/history.jsonl +1 -0 | @@ -27,3 +27,4 @@ | ||
| 27 | 27 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a485576", "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": 10665, "loc": 8489}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 27, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-25T22:01:44Z"} |
| 28 | 28 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a485576", "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": 28, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-25T22:03:59Z"} |
| 29 | 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"} | |
| @@ -27,3 +27,4 @@ | |||
| 27 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a485576", "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": 10665, "loc": 8489}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 27, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-25T22:01:44Z"} | 27 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a485576", "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": 10665, "loc": 8489}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 27, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-25T22:01:44Z"} |
| 28 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a485576", "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": 28, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-25T22:03:59Z"} | 28 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "a485576", "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": 28, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-25T22:03:59Z"} |
| 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"} | ||
added
.quality/report-20261126T052118Z.md +73 -0 | new file mode 100644 | ||
| @@ -0,0 +1,73 @@ | ||
| 1 | +# Quality report — 2026-11-26T05:21:18Z | |
| 2 | + | |
| 3 | +- **Gate**: ✅ **PASS** | |
| 4 | +- **Commit**: `a218748` 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**: #30 (previous: 2026-11-26T04:34:58Z) | |
| 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 | 582 | ±0 | | |
| 32 | +| classes | 234 | ±0 | | |
| 33 | +| fields | 1209 | ±0 | | |
| 34 | +| cyclo | 604 | ±0 | | |
| 35 | +| complex | 546 | ±0 | | |
| 36 | +| lcom | 115 | ±0 | | |
| 37 | +| lines | 10669 | ±0 | | |
| 38 | +| loc | 8492 | ±0 | | |
| 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 | +| samples/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 | +| 21 | 2026-11-25T19:12:45Z | 0 | 0 | 0 | 512 | PASS | | |
| 65 | +| 22 | 2026-11-25T21:27:49Z | 4 | 1 | 0 | 538 | FAIL | | |
| 66 | +| 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS | | |
| 67 | +| 24 | 2026-11-25T21:37:24Z | 0 | 1 | 1 | 559 | FAIL | | |
| 68 | +| 25 | 2026-11-25T21:37:51Z | 0 | 1 | 0 | 544 | FAIL | | |
| 69 | +| 26 | 2026-11-25T21:38:24Z | 0 | 0 | 0 | 544 | PASS | | |
| 70 | +| 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS | | |
| 71 | +| 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | | |
| 72 | +| 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS | | |
| 73 | +| 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS | | |
| new file mode 100644 | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | +# Quality report — 2026-11-26T05:21:18Z | ||
| 2 | + | ||
| 3 | +- **Gate**: ✅ **PASS** | ||
| 4 | +- **Commit**: `a218748` 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**: #30 (previous: 2026-11-26T04:34:58Z) | ||
| 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 | 582 | ±0 | | ||
| 32 | +| classes | 234 | ±0 | | ||
| 33 | +| fields | 1209 | ±0 | | ||
| 34 | +| cyclo | 604 | ±0 | | ||
| 35 | +| complex | 546 | ±0 | | ||
| 36 | +| lcom | 115 | ±0 | | ||
| 37 | +| lines | 10669 | ±0 | | ||
| 38 | +| loc | 8492 | ±0 | | ||
| 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 | +| samples/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 | +| 21 | 2026-11-25T19:12:45Z | 0 | 0 | 0 | 512 | PASS | | ||
| 65 | +| 22 | 2026-11-25T21:27:49Z | 4 | 1 | 0 | 538 | FAIL | | ||
| 66 | +| 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS | | ||
| 67 | +| 24 | 2026-11-25T21:37:24Z | 0 | 1 | 1 | 559 | FAIL | | ||
| 68 | +| 25 | 2026-11-25T21:37:51Z | 0 | 1 | 0 | 544 | FAIL | | ||
| 69 | +| 26 | 2026-11-25T21:38:24Z | 0 | 0 | 0 | 544 | PASS | | ||
| 70 | +| 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS | | ||
| 71 | +| 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | | ||
| 72 | +| 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS | | ||
| 73 | +| 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS | | ||
modified
.quality/report-latest.md +4 -4 | @@ -1,10 +1,10 @@ | ||
| 1 | -# Quality report — 2026-11-26T04:34:58Z | |
| 1 | +# Quality report — 2026-11-26T05:21:18Z | |
| 2 | 2 | |
| 3 | 3 | - **Gate**: ✅ **PASS** |
| 4 | -- **Commit**: `17b9753` on `feature/v0.2-openai-server` | |
| 4 | +- **Commit**: `a218748` on `feature/v0.2-openai-server` | |
| 5 | 5 | - **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20) |
| 6 | 6 | - **swiftlint**: 0.65.1 (run directly, merged into lint issues) |
| 7 | -- **Run**: #29 (previous: 2026-11-25T22:03:59Z) | |
| 7 | +- **Run**: #30 (previous: 2026-11-26T04:34:58Z) | |
| 8 | 8 | |
| 9 | 9 | ## Lint issues (`qlty check`) |
| 10 | 10 | |
| @@ -61,7 +61,6 @@ _none_ | ||
| 61 | 61 | |
| 62 | 62 | | run | timestamp | error | warning | smells | complex | gate | |
| 63 | 63 | |---|---|---|---|---|---|---| |
| 64 | -| 20 | 2026-11-25T18:44:58Z | 0 | 0 | 0 | 512 | PASS | | |
| 65 | 64 | | 21 | 2026-11-25T19:12:45Z | 0 | 0 | 0 | 512 | PASS | |
| 66 | 65 | | 22 | 2026-11-25T21:27:49Z | 4 | 1 | 0 | 538 | FAIL | |
| 67 | 66 | | 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS | |
| @@ -71,3 +70,4 @@ _none_ | ||
| 71 | 70 | | 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS | |
| 72 | 71 | | 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | |
| 73 | 72 | | 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS | |
| 73 | +| 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS | | |
| @@ -1,10 +1,10 @@ | |||
| 1 | -# Quality report — 2026-11-26T04:34:58Z | 1 | +# Quality report — 2026-11-26T05:21:18Z |
| 2 | 2 | ||
| 3 | - **Gate**: ✅ **PASS** | 3 | - **Gate**: ✅ **PASS** |
| 4 | -- **Commit**: `17b9753` on `feature/v0.2-openai-server` | 4 | +- **Commit**: `a218748` 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**: #29 (previous: 2026-11-25T22:03:59Z) | 7 | +- **Run**: #30 (previous: 2026-11-26T04:34:58Z) |
| 8 | 8 | ||
| 9 | ## Lint issues (`qlty check`) | 9 | ## Lint issues (`qlty check`) |
| 10 | 10 | ||
| @@ -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 | -| 20 | 2026-11-25T18:44:58Z | 0 | 0 | 0 | 512 | PASS | | ||
| 65 | | 21 | 2026-11-25T19:12:45Z | 0 | 0 | 0 | 512 | PASS | | 64 | | 21 | 2026-11-25T19:12:45Z | 0 | 0 | 0 | 512 | PASS | |
| 66 | | 22 | 2026-11-25T21:27:49Z | 4 | 1 | 0 | 538 | FAIL | | 65 | | 22 | 2026-11-25T21:27:49Z | 4 | 1 | 0 | 538 | FAIL | |
| 67 | | 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS | | 66 | | 23 | 2026-11-25T21:28:10Z | 0 | 0 | 0 | 538 | PASS | |
| @@ -71,3 +70,4 @@ _none_ | |||
| 71 | | 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS | | 70 | | 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS | |
| 72 | | 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | | 71 | | 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | |
| 73 | | 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS | | 72 | | 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS | |
| 73 | +| 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS | | ||
modified
README.md +2 -0 | @@ -89,6 +89,8 @@ xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration | ||
| 89 | 89 | |
| 90 | 90 | The first build downloads and compiles the dependencies and takes several minutes. Run `rzb` from `Build/Products/Release`: the MLX Metal library (`mlx-swift_Cmlx.bundle`) sits next to it. |
| 91 | 91 | |
| 92 | +`scripts/install.sh` builds and installs `rzb` under `/usr/local` (launcher in `/usr/local/bin`), so it runs from any folder: see [Build rzb on the Mac](docs/en/how-to/build-on-the-mac.md#install). | |
| 93 | + | |
| 92 | 94 | `scripts/release.sh` builds and packages a release archive (`dist/razorbill-<version>-macos-arm64.tar.gz`): see [Package a release](docs/en/how-to/package-a-release.md). |
| 93 | 95 | |
| 94 | 96 | ## Run the tests |
| @@ -89,6 +89,8 @@ xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration | |||
| 89 | 89 | ||
| 90 | The first build downloads and compiles the dependencies and takes several minutes. Run `rzb` from `Build/Products/Release`: the MLX Metal library (`mlx-swift_Cmlx.bundle`) sits next to it. | 90 | The first build downloads and compiles the dependencies and takes several minutes. Run `rzb` from `Build/Products/Release`: the MLX Metal library (`mlx-swift_Cmlx.bundle`) sits next to it. |
| 91 | 91 | ||
| 92 | +`scripts/install.sh` builds and installs `rzb` under `/usr/local` (launcher in `/usr/local/bin`), so it runs from any folder: see [Build rzb on the Mac](docs/en/how-to/build-on-the-mac.md#install). | ||
| 93 | + | ||
| 92 | `scripts/release.sh` builds and packages a release archive (`dist/razorbill-<version>-macos-arm64.tar.gz`): see [Package a release](docs/en/how-to/package-a-release.md). | 94 | `scripts/release.sh` builds and packages a release archive (`dist/razorbill-<version>-macos-arm64.tar.gz`): see [Package a release](docs/en/how-to/package-a-release.md). |
| 93 | 95 | ||
| 94 | ## Run the tests | 96 | ## Run the tests |
modified
docs/en/how-to/build-on-the-mac.md +19 -0 | @@ -28,6 +28,25 @@ The executable is `.build/xcode/Build/Products/Release/rzb`. Keep it in that fol | ||
| 28 | 28 | # rzb 0.2.0 (engines: fake, mlx) |
| 29 | 29 | ``` |
| 30 | 30 | |
| 31 | +## Install | |
| 32 | + | |
| 33 | +To run `rzb` from any folder, build and install in one command: | |
| 34 | + | |
| 35 | +```bash | |
| 36 | +scripts/install.sh | |
| 37 | +rzb version | |
| 38 | +``` | |
| 39 | + | |
| 40 | +It builds in Release (incrementally, in `.build/xcode`), copies `rzb` and its bundles to `/usr/local/lib/razorbill`, and writes `/usr/local/bin/rzb`, a two-line launcher that runs it from there; `rzb` cannot be copied alone into `/usr/local/bin` because it loads its bundles from its own folder. It asks for your password through `sudo` when `/usr/local` is not writable. Run it again after each `git pull` to update. | |
| 41 | + | |
| 42 | +| Option | Effect | | |
| 43 | +| --- | --- | | |
| 44 | +| `--no-build` | Install the last build without rebuilding. | | |
| 45 | +| `--prefix <dir>` | Install under `<dir>/lib/razorbill` and `<dir>/bin` instead of `/usr/local` (e.g. `~/.local`, no `sudo`). | | |
| 46 | +| `--uninstall` | Remove what the script installed. | | |
| 47 | + | |
| 48 | +The script never overwrites or removes an `rzb` launcher it did not write. | |
| 49 | + | |
| 31 | 50 | ## Variants |
| 32 | 51 | |
| 33 | 52 | - **Debug build**: replace `-configuration Release` with `-configuration Debug`; the executable is then in `Build/Products/Debug`. Generation is much slower. |
| @@ -28,6 +28,25 @@ The executable is `.build/xcode/Build/Products/Release/rzb`. Keep it in that fol | |||
| 28 | # rzb 0.2.0 (engines: fake, mlx) | 28 | # rzb 0.2.0 (engines: fake, mlx) |
| 29 | ``` | 29 | ``` |
| 30 | 30 | ||
| 31 | +## Install | ||
| 32 | + | ||
| 33 | +To run `rzb` from any folder, build and install in one command: | ||
| 34 | + | ||
| 35 | +```bash | ||
| 36 | +scripts/install.sh | ||
| 37 | +rzb version | ||
| 38 | +``` | ||
| 39 | + | ||
| 40 | +It builds in Release (incrementally, in `.build/xcode`), copies `rzb` and its bundles to `/usr/local/lib/razorbill`, and writes `/usr/local/bin/rzb`, a two-line launcher that runs it from there; `rzb` cannot be copied alone into `/usr/local/bin` because it loads its bundles from its own folder. It asks for your password through `sudo` when `/usr/local` is not writable. Run it again after each `git pull` to update. | ||
| 41 | + | ||
| 42 | +| Option | Effect | | ||
| 43 | +| --- | --- | | ||
| 44 | +| `--no-build` | Install the last build without rebuilding. | | ||
| 45 | +| `--prefix <dir>` | Install under `<dir>/lib/razorbill` and `<dir>/bin` instead of `/usr/local` (e.g. `~/.local`, no `sudo`). | | ||
| 46 | +| `--uninstall` | Remove what the script installed. | | ||
| 47 | + | ||
| 48 | +The script never overwrites or removes an `rzb` launcher it did not write. | ||
| 49 | + | ||
| 31 | ## Variants | 50 | ## Variants |
| 32 | 51 | ||
| 33 | - **Debug build**: replace `-configuration Release` with `-configuration Debug`; the executable is then in `Build/Products/Debug`. Generation is much slower. | 52 | - **Debug build**: replace `-configuration Release` with `-configuration Debug`; the executable is then in `Build/Products/Debug`. Generation is much slower. |
modified
docs/en/how-to/package-a-release.md +1 -1 | @@ -30,7 +30,7 @@ This guide builds the release archive of razorbill: `rzb` and the resource bundl | ||
| 30 | 30 | | `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | The other resource bundles of the dependencies. The script copies every `*.bundle` of the build. | |
| 31 | 31 | | `INSTALL.txt` | Where to put the folder, how to add it to `PATH`, how to clear the quarantine. | |
| 32 | 32 | |
| 33 | -The bundles must stay next to `rzb`: put the whole folder on `PATH` rather than copying `rzb` alone into `/usr/local/bin`. | |
| 33 | +The bundles must stay next to `rzb`: put the whole folder on `PATH` rather than copying `rzb` alone into `/usr/local/bin`. On a Mac with the sources, `scripts/install.sh` does this for you ([Build rzb on the Mac](build-on-the-mac.md#install)). | |
| 34 | 34 | |
| 35 | 35 | ## Variants |
| 36 | 36 | |
| @@ -30,7 +30,7 @@ This guide builds the release archive of razorbill: `rzb` and the resource bundl | |||
| 30 | | `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | The other resource bundles of the dependencies. The script copies every `*.bundle` of the build. | | 30 | | `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | The other resource bundles of the dependencies. The script copies every `*.bundle` of the build. | |
| 31 | | `INSTALL.txt` | Where to put the folder, how to add it to `PATH`, how to clear the quarantine. | | 31 | | `INSTALL.txt` | Where to put the folder, how to add it to `PATH`, how to clear the quarantine. | |
| 32 | 32 | ||
| 33 | -The bundles must stay next to `rzb`: put the whole folder on `PATH` rather than copying `rzb` alone into `/usr/local/bin`. | 33 | +The bundles must stay next to `rzb`: put the whole folder on `PATH` rather than copying `rzb` alone into `/usr/local/bin`. On a Mac with the sources, `scripts/install.sh` does this for you ([Build rzb on the Mac](build-on-the-mac.md#install)). |
| 34 | 34 | ||
| 35 | ## Variants | 35 | ## Variants |
| 36 | 36 | ||
modified
docs/fr/how-to/compiler-sur-le-mac.md +19 -0 | @@ -28,6 +28,25 @@ L'exécutable est `.build/xcode/Build/Products/Release/rzb`. Laissez-le dans ce | ||
| 28 | 28 | # rzb 0.2.0 (engines: fake, mlx) |
| 29 | 29 | ``` |
| 30 | 30 | |
| 31 | +## Installer | |
| 32 | + | |
| 33 | +Pour lancer `rzb` depuis n'importe quel dossier, compilez et installez en une commande : | |
| 34 | + | |
| 35 | +```bash | |
| 36 | +scripts/install.sh | |
| 37 | +rzb version | |
| 38 | +``` | |
| 39 | + | |
| 40 | +Le script compile en Release (de façon incrémentale, dans `.build/xcode`), copie `rzb` et ses bundles dans `/usr/local/lib/razorbill`, et écrit `/usr/local/bin/rzb`, un lanceur de deux lignes qui l'exécute depuis ce dossier ; `rzb` ne peut pas être copié seul dans `/usr/local/bin`, car il charge ses bundles depuis son propre dossier. Il demande votre mot de passe via `sudo` quand `/usr/local` n'est pas accessible en écriture. Relancez-le après chaque `git pull` pour mettre à jour. | |
| 41 | + | |
| 42 | +| Option | Effet | | |
| 43 | +| --- | --- | | |
| 44 | +| `--no-build` | Installe la dernière compilation sans recompiler. | | |
| 45 | +| `--prefix <dossier>` | Installe dans `<dossier>/lib/razorbill` et `<dossier>/bin` au lieu de `/usr/local` (par exemple `~/.local`, sans `sudo`). | | |
| 46 | +| `--uninstall` | Retire ce que le script a installé. | | |
| 47 | + | |
| 48 | +Le script n'écrase ni ne supprime jamais un lanceur `rzb` qu'il n'a pas écrit. | |
| 49 | + | |
| 31 | 50 | ## Variantes |
| 32 | 51 | |
| 33 | 52 | - **Compilation Debug** : remplacez `-configuration Release` par `-configuration Debug` ; l'exécutable est alors dans `Build/Products/Debug`. La génération est beaucoup plus lente. |
| @@ -28,6 +28,25 @@ L'exécutable est `.build/xcode/Build/Products/Release/rzb`. Laissez-le dans ce | |||
| 28 | # rzb 0.2.0 (engines: fake, mlx) | 28 | # rzb 0.2.0 (engines: fake, mlx) |
| 29 | ``` | 29 | ``` |
| 30 | 30 | ||
| 31 | +## Installer | ||
| 32 | + | ||
| 33 | +Pour lancer `rzb` depuis n'importe quel dossier, compilez et installez en une commande : | ||
| 34 | + | ||
| 35 | +```bash | ||
| 36 | +scripts/install.sh | ||
| 37 | +rzb version | ||
| 38 | +``` | ||
| 39 | + | ||
| 40 | +Le script compile en Release (de façon incrémentale, dans `.build/xcode`), copie `rzb` et ses bundles dans `/usr/local/lib/razorbill`, et écrit `/usr/local/bin/rzb`, un lanceur de deux lignes qui l'exécute depuis ce dossier ; `rzb` ne peut pas être copié seul dans `/usr/local/bin`, car il charge ses bundles depuis son propre dossier. Il demande votre mot de passe via `sudo` quand `/usr/local` n'est pas accessible en écriture. Relancez-le après chaque `git pull` pour mettre à jour. | ||
| 41 | + | ||
| 42 | +| Option | Effet | | ||
| 43 | +| --- | --- | | ||
| 44 | +| `--no-build` | Installe la dernière compilation sans recompiler. | | ||
| 45 | +| `--prefix <dossier>` | Installe dans `<dossier>/lib/razorbill` et `<dossier>/bin` au lieu de `/usr/local` (par exemple `~/.local`, sans `sudo`). | | ||
| 46 | +| `--uninstall` | Retire ce que le script a installé. | | ||
| 47 | + | ||
| 48 | +Le script n'écrase ni ne supprime jamais un lanceur `rzb` qu'il n'a pas écrit. | ||
| 49 | + | ||
| 31 | ## Variantes | 50 | ## Variantes |
| 32 | 51 | ||
| 33 | - **Compilation Debug** : remplacez `-configuration Release` par `-configuration Debug` ; l'exécutable est alors dans `Build/Products/Debug`. La génération est beaucoup plus lente. | 52 | - **Compilation Debug** : remplacez `-configuration Release` par `-configuration Debug` ; l'exécutable est alors dans `Build/Products/Debug`. La génération est beaucoup plus lente. |
modified
docs/fr/how-to/preparer-une-release.md +1 -1 | @@ -30,7 +30,7 @@ Ce guide fabrique l'archive de release de razorbill : `rzb` et les bundles de re | ||
| 30 | 30 | | `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | Les autres bundles de ressources des dépendances. Le script copie tous les `*.bundle` de la compilation. | |
| 31 | 31 | | `INSTALL.txt` | Où placer le dossier, comment l'ajouter au `PATH`, comment lever la quarantaine. | |
| 32 | 32 | |
| 33 | -Les bundles doivent rester à côté de `rzb` : mettez le dossier entier dans le `PATH` plutôt que de copier `rzb` seul dans `/usr/local/bin`. | |
| 33 | +Les bundles doivent rester à côté de `rzb` : mettez le dossier entier dans le `PATH` plutôt que de copier `rzb` seul dans `/usr/local/bin`. Sur un Mac avec les sources, `scripts/install.sh` le fait pour vous ([Compiler rzb sur le Mac](compiler-sur-le-mac.md#installer)). | |
| 34 | 34 | |
| 35 | 35 | ## Variantes |
| 36 | 36 | |
| @@ -30,7 +30,7 @@ Ce guide fabrique l'archive de release de razorbill : `rzb` et les bundles de re | |||
| 30 | | `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | Les autres bundles de ressources des dépendances. Le script copie tous les `*.bundle` de la compilation. | | 30 | | `swift-transformers_Hub.bundle`, `swift-nio_*.bundle`, `swift-crypto_Crypto.bundle` | Les autres bundles de ressources des dépendances. Le script copie tous les `*.bundle` de la compilation. | |
| 31 | | `INSTALL.txt` | Où placer le dossier, comment l'ajouter au `PATH`, comment lever la quarantaine. | | 31 | | `INSTALL.txt` | Où placer le dossier, comment l'ajouter au `PATH`, comment lever la quarantaine. | |
| 32 | 32 | ||
| 33 | -Les bundles doivent rester à côté de `rzb` : mettez le dossier entier dans le `PATH` plutôt que de copier `rzb` seul dans `/usr/local/bin`. | 33 | +Les bundles doivent rester à côté de `rzb` : mettez le dossier entier dans le `PATH` plutôt que de copier `rzb` seul dans `/usr/local/bin`. Sur un Mac avec les sources, `scripts/install.sh` le fait pour vous ([Compiler rzb sur le Mac](compiler-sur-le-mac.md#installer)). |
| 34 | 34 | ||
| 35 | ## Variantes | 35 | ## Variantes |
| 36 | 36 | ||
modified
release-notes/v0.2.0.fr.md +1 -1 | @@ -14,7 +14,7 @@ razorbill devient un serveur de modèles pour Apple Silicon : `rzb serve` fait t | ||
| 14 | 14 | - Le cache KV de la requête précédente est réutilisé quand le prompt suivant commence pareil (`usage.prompt_tokens_details.cached_tokens`) : une longue conversation ne relit plus tout son historique. |
| 15 | 15 | - Échantillonnage : `top_k`, `min_p`, `repetition_penalty`, `repetition_context_size` en plus des champs d'OpenAI. |
| 16 | 16 | - Suite de compatibilité OpenAI (`scripts/compat.sh` : bibliothèque `openai`, LangChain, `curl`). |
| 17 | -- `scripts/release.sh` : archive de release avec empreinte. | |
| 17 | +- `scripts/release.sh` : archive de release avec empreinte ; `scripts/install.sh` : compilation et installation sous `/usr/local`. | |
| 18 | 18 | |
| 19 | 19 | ## Installation |
| 20 | 20 | |
| @@ -14,7 +14,7 @@ razorbill devient un serveur de modèles pour Apple Silicon : `rzb serve` fait t | |||
| 14 | - Le cache KV de la requête précédente est réutilisé quand le prompt suivant commence pareil (`usage.prompt_tokens_details.cached_tokens`) : une longue conversation ne relit plus tout son historique. | 14 | - Le cache KV de la requête précédente est réutilisé quand le prompt suivant commence pareil (`usage.prompt_tokens_details.cached_tokens`) : une longue conversation ne relit plus tout son historique. |
| 15 | - Échantillonnage : `top_k`, `min_p`, `repetition_penalty`, `repetition_context_size` en plus des champs d'OpenAI. | 15 | - Échantillonnage : `top_k`, `min_p`, `repetition_penalty`, `repetition_context_size` en plus des champs d'OpenAI. |
| 16 | - Suite de compatibilité OpenAI (`scripts/compat.sh` : bibliothèque `openai`, LangChain, `curl`). | 16 | - Suite de compatibilité OpenAI (`scripts/compat.sh` : bibliothèque `openai`, LangChain, `curl`). |
| 17 | -- `scripts/release.sh` : archive de release avec empreinte. | 17 | +- `scripts/release.sh` : archive de release avec empreinte ; `scripts/install.sh` : compilation et installation sous `/usr/local`. |
| 18 | 18 | ||
| 19 | ## Installation | 19 | ## Installation |
| 20 | 20 | ||
modified
release-notes/v0.2.0.md +1 -1 | @@ -14,7 +14,7 @@ razorbill becomes a model server for Apple Silicon: `rzb serve` runs MLX models | ||
| 14 | 14 | - The KV cache of the previous request is reused when the next prompt starts the same way (`usage.prompt_tokens_details.cached_tokens`): long conversations no longer re-read their whole history. |
| 15 | 15 | - Sampling: `top_k`, `min_p`, `repetition_penalty`, `repetition_context_size` besides OpenAI's fields. |
| 16 | 16 | - OpenAI compatibility suite (`scripts/compat.sh`: `openai` library, LangChain, `curl`). |
| 17 | -- `scripts/release.sh`: release archive with checksum. | |
| 17 | +- `scripts/release.sh`: release archive with checksum; `scripts/install.sh`: build and install under `/usr/local`. | |
| 18 | 18 | |
| 19 | 19 | ## Install |
| 20 | 20 | |
| @@ -14,7 +14,7 @@ razorbill becomes a model server for Apple Silicon: `rzb serve` runs MLX models | |||
| 14 | - The KV cache of the previous request is reused when the next prompt starts the same way (`usage.prompt_tokens_details.cached_tokens`): long conversations no longer re-read their whole history. | 14 | - The KV cache of the previous request is reused when the next prompt starts the same way (`usage.prompt_tokens_details.cached_tokens`): long conversations no longer re-read their whole history. |
| 15 | - Sampling: `top_k`, `min_p`, `repetition_penalty`, `repetition_context_size` besides OpenAI's fields. | 15 | - Sampling: `top_k`, `min_p`, `repetition_penalty`, `repetition_context_size` besides OpenAI's fields. |
| 16 | - OpenAI compatibility suite (`scripts/compat.sh`: `openai` library, LangChain, `curl`). | 16 | - OpenAI compatibility suite (`scripts/compat.sh`: `openai` library, LangChain, `curl`). |
| 17 | -- `scripts/release.sh`: release archive with checksum. | 17 | +- `scripts/release.sh`: release archive with checksum; `scripts/install.sh`: build and install under `/usr/local`. |
| 18 | 18 | ||
| 19 | ## Install | 19 | ## Install |
| 20 | 20 | ||
added
scripts/install.sh +88 -0 | new file mode 100755 | ||
| @@ -0,0 +1,88 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# Build rzb in Release and install it, so that `rzb` works from any folder. | |
| 3 | +# | |
| 4 | +# scripts/install.sh # build, then install under /usr/local | |
| 5 | +# scripts/install.sh --no-build # install the last build as is | |
| 6 | +# scripts/install.sh --prefix ~/.local # install elsewhere (no sudo needed) | |
| 7 | +# scripts/install.sh --uninstall # remove what this script installed | |
| 8 | +# | |
| 9 | +# rzb loads mlx-swift_Cmlx.bundle (the MLX Metal library) and its other resource bundles from | |
| 10 | +# its own folder, so it cannot be copied alone into bin/. The build goes to <prefix>/lib/razorbill | |
| 11 | +# and <prefix>/bin/rzb is a two-line launcher that runs it from there. sudo is used only when the | |
| 12 | +# prefix is not writable. | |
| 13 | +set -euo pipefail | |
| 14 | +cd "$(dirname "$0")/.." | |
| 15 | + | |
| 16 | +prefix=/usr/local | |
| 17 | +build=true | |
| 18 | +uninstall=false | |
| 19 | +while [[ $# -gt 0 ]]; do | |
| 20 | + case "$1" in | |
| 21 | + --prefix) prefix="${2:?--prefix needs a directory}"; shift 2 ;; | |
| 22 | + --no-build) build=false; shift ;; | |
| 23 | + --uninstall) uninstall=true; shift ;; | |
| 24 | + -h|--help) sed -n '2,12p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;; | |
| 25 | + *) echo "install.sh: unknown option $1 (see --help)" >&2; exit 2 ;; | |
| 26 | + esac | |
| 27 | +done | |
| 28 | + | |
| 29 | +fail() { echo "install.sh: $*" >&2; exit 1; } | |
| 30 | + | |
| 31 | +products=.build/xcode/Build/Products/Release | |
| 32 | +home="$prefix/lib/razorbill" | |
| 33 | +launcher="$prefix/bin/rzb" | |
| 34 | +marker="# razorbill launcher (scripts/install.sh)" | |
| 35 | + | |
| 36 | +# Runs a command with sudo only when the prefix cannot be written as the current user. | |
| 37 | +as_owner() { | |
| 38 | + if mkdir -p "$prefix" 2>/dev/null && [[ -w "$prefix" ]]; then "$@"; else sudo "$@"; fi | |
| 39 | +} | |
| 40 | + | |
| 41 | +# Refuses to overwrite or remove an rzb this script did not install. | |
| 42 | +check_launcher() { | |
| 43 | + if [[ -e "$launcher" ]] && ! grep -qF "$marker" "$launcher" 2>/dev/null; then | |
| 44 | + fail "$launcher exists and was not installed by this script: remove it first" | |
| 45 | + fi | |
| 46 | +} | |
| 47 | + | |
| 48 | +if [[ "$uninstall" == true ]]; then | |
| 49 | + check_launcher | |
| 50 | + as_owner rm -rf "$home" "$launcher" | |
| 51 | + echo "removed $home and $launcher" | |
| 52 | + exit 0 | |
| 53 | +fi | |
| 54 | + | |
| 55 | +if [[ "$build" == true ]]; then | |
| 56 | + [[ "$(uname -s)" == Darwin && "$(uname -m)" == arm64 ]] \ | |
| 57 | + || fail "building needs a Mac with Apple Silicon (or pass --no-build)" | |
| 58 | + # Same folder as the development build: incremental, so a reinstall only compiles what changed. | |
| 59 | + xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ | |
| 60 | + -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation | |
| 61 | +fi | |
| 62 | + | |
| 63 | +[[ -x "$products/rzb" ]] || fail "$products/rzb not found: build first (drop --no-build)" | |
| 64 | +[[ -d "$products/mlx-swift_Cmlx.bundle" ]] \ | |
| 65 | + || fail "$products/mlx-swift_Cmlx.bundle not found (the MLX Metal library)" | |
| 66 | +check_launcher | |
| 67 | + | |
| 68 | +staging=$(mktemp -d) | |
| 69 | +trap 'rm -rf "$staging"' EXIT | |
| 70 | +cp "$products/rzb" "$staging/" | |
| 71 | +for bundle in "$products"/*.bundle; do | |
| 72 | + cp -R "$bundle" "$staging/" | |
| 73 | +done | |
| 74 | +printf '#!/bin/sh\n%s\nexec "%s/rzb" "$@"\n' "$marker" "$home" > "$staging/launcher" | |
| 75 | + | |
| 76 | +as_owner mkdir -p "$prefix/lib" "$prefix/bin" | |
| 77 | +as_owner rm -rf "$home" | |
| 78 | +as_owner mkdir "$home" | |
| 79 | +as_owner cp -R "$staging"/rzb "$staging"/*.bundle "$home/" | |
| 80 | +as_owner install -m 755 "$staging/launcher" "$launcher" | |
| 81 | + | |
| 82 | +echo "installed $home, launcher $launcher" | |
| 83 | +if [[ "$(uname -s)" == Darwin ]]; then | |
| 84 | + "$launcher" version | |
| 85 | +fi | |
| 86 | +if [[ "$(command -v rzb || true)" != "$launcher" ]]; then | |
| 87 | + echo "note: \`rzb\` does not resolve to $launcher; check that $prefix/bin comes first in PATH" | |
| 88 | +fi | |
| new file mode 100755 | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | +#!/usr/bin/env bash | ||
| 2 | +# Build rzb in Release and install it, so that `rzb` works from any folder. | ||
| 3 | +# | ||
| 4 | +# scripts/install.sh # build, then install under /usr/local | ||
| 5 | +# scripts/install.sh --no-build # install the last build as is | ||
| 6 | +# scripts/install.sh --prefix ~/.local # install elsewhere (no sudo needed) | ||
| 7 | +# scripts/install.sh --uninstall # remove what this script installed | ||
| 8 | +# | ||
| 9 | +# rzb loads mlx-swift_Cmlx.bundle (the MLX Metal library) and its other resource bundles from | ||
| 10 | +# its own folder, so it cannot be copied alone into bin/. The build goes to <prefix>/lib/razorbill | ||
| 11 | +# and <prefix>/bin/rzb is a two-line launcher that runs it from there. sudo is used only when the | ||
| 12 | +# prefix is not writable. | ||
| 13 | +set -euo pipefail | ||
| 14 | +cd "$(dirname "$0")/.." | ||
| 15 | + | ||
| 16 | +prefix=/usr/local | ||
| 17 | +build=true | ||
| 18 | +uninstall=false | ||
| 19 | +while [[ $# -gt 0 ]]; do | ||
| 20 | + case "$1" in | ||
| 21 | + --prefix) prefix="${2:?--prefix needs a directory}"; shift 2 ;; | ||
| 22 | + --no-build) build=false; shift ;; | ||
| 23 | + --uninstall) uninstall=true; shift ;; | ||
| 24 | + -h|--help) sed -n '2,12p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;; | ||
| 25 | + *) echo "install.sh: unknown option $1 (see --help)" >&2; exit 2 ;; | ||
| 26 | + esac | ||
| 27 | +done | ||
| 28 | + | ||
| 29 | +fail() { echo "install.sh: $*" >&2; exit 1; } | ||
| 30 | + | ||
| 31 | +products=.build/xcode/Build/Products/Release | ||
| 32 | +home="$prefix/lib/razorbill" | ||
| 33 | +launcher="$prefix/bin/rzb" | ||
| 34 | +marker="# razorbill launcher (scripts/install.sh)" | ||
| 35 | + | ||
| 36 | +# Runs a command with sudo only when the prefix cannot be written as the current user. | ||
| 37 | +as_owner() { | ||
| 38 | + if mkdir -p "$prefix" 2>/dev/null && [[ -w "$prefix" ]]; then "$@"; else sudo "$@"; fi | ||
| 39 | +} | ||
| 40 | + | ||
| 41 | +# Refuses to overwrite or remove an rzb this script did not install. | ||
| 42 | +check_launcher() { | ||
| 43 | + if [[ -e "$launcher" ]] && ! grep -qF "$marker" "$launcher" 2>/dev/null; then | ||
| 44 | + fail "$launcher exists and was not installed by this script: remove it first" | ||
| 45 | + fi | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +if [[ "$uninstall" == true ]]; then | ||
| 49 | + check_launcher | ||
| 50 | + as_owner rm -rf "$home" "$launcher" | ||
| 51 | + echo "removed $home and $launcher" | ||
| 52 | + exit 0 | ||
| 53 | +fi | ||
| 54 | + | ||
| 55 | +if [[ "$build" == true ]]; then | ||
| 56 | + [[ "$(uname -s)" == Darwin && "$(uname -m)" == arm64 ]] \ | ||
| 57 | + || fail "building needs a Mac with Apple Silicon (or pass --no-build)" | ||
| 58 | + # Same folder as the development build: incremental, so a reinstall only compiles what changed. | ||
| 59 | + xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ | ||
| 60 | + -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation | ||
| 61 | +fi | ||
| 62 | + | ||
| 63 | +[[ -x "$products/rzb" ]] || fail "$products/rzb not found: build first (drop --no-build)" | ||
| 64 | +[[ -d "$products/mlx-swift_Cmlx.bundle" ]] \ | ||
| 65 | + || fail "$products/mlx-swift_Cmlx.bundle not found (the MLX Metal library)" | ||
| 66 | +check_launcher | ||
| 67 | + | ||
| 68 | +staging=$(mktemp -d) | ||
| 69 | +trap 'rm -rf "$staging"' EXIT | ||
| 70 | +cp "$products/rzb" "$staging/" | ||
| 71 | +for bundle in "$products"/*.bundle; do | ||
| 72 | + cp -R "$bundle" "$staging/" | ||
| 73 | +done | ||
| 74 | +printf '#!/bin/sh\n%s\nexec "%s/rzb" "$@"\n' "$marker" "$home" > "$staging/launcher" | ||
| 75 | + | ||
| 76 | +as_owner mkdir -p "$prefix/lib" "$prefix/bin" | ||
| 77 | +as_owner rm -rf "$home" | ||
| 78 | +as_owner mkdir "$home" | ||
| 79 | +as_owner cp -R "$staging"/rzb "$staging"/*.bundle "$home/" | ||
| 80 | +as_owner install -m 755 "$staging/launcher" "$launcher" | ||
| 81 | + | ||
| 82 | +echo "installed $home, launcher $launcher" | ||
| 83 | +if [[ "$(uname -s)" == Darwin ]]; then | ||
| 84 | + "$launcher" version | ||
| 85 | +fi | ||
| 86 | +if [[ "$(command -v rzb || true)" != "$launcher" ]]; then | ||
| 87 | + echo "note: \`rzb\` does not resolve to $launcher; check that $prefix/bin comes first in PATH" | ||
| 88 | +fi | ||