athanor 2.4.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +9 -9
- package/README.md +53 -23
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +3 -2
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/llama.d.ts.map +1 -1
- package/dist/adapters/llama.js +15 -0
- package/dist/adapters/llama.js.map +1 -1
- package/dist/app/models.d.ts +2 -1
- package/dist/app/models.d.ts.map +1 -1
- package/dist/app/models.js +50 -16
- package/dist/app/models.js.map +1 -1
- package/dist/cli/commands.d.ts +1 -1
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +1 -1
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +24 -12
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/model-commands.d.ts.map +1 -1
- package/dist/cli/model-commands.js +14 -13
- package/dist/cli/model-commands.js.map +1 -1
- package/dist/cli/preset-commands.d.ts +16 -6
- package/dist/cli/preset-commands.d.ts.map +1 -1
- package/dist/cli/preset-commands.js +64 -32
- package/dist/cli/preset-commands.js.map +1 -1
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +3 -2
- package/dist/config/index.js.map +1 -1
- package/dist/control/server.d.ts +4 -1
- package/dist/control/server.d.ts.map +1 -1
- package/dist/control/server.js +4 -2
- package/dist/control/server.js.map +1 -1
- package/dist/discovery/scanner.d.ts +1 -0
- package/dist/discovery/scanner.d.ts.map +1 -1
- package/dist/discovery/scanner.js +1 -1
- package/dist/discovery/scanner.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/presets/compound.d.ts +22 -0
- package/dist/presets/compound.d.ts.map +1 -0
- package/dist/presets/compound.js +350 -0
- package/dist/presets/compound.js.map +1 -0
- package/dist/presets/edit.d.ts +4 -2
- package/dist/presets/edit.d.ts.map +1 -1
- package/dist/presets/edit.js +47 -11
- package/dist/presets/edit.js.map +1 -1
- package/dist/presets/recipes.d.ts +18 -11
- package/dist/presets/recipes.d.ts.map +1 -1
- package/dist/presets/recipes.js +116 -24
- package/dist/presets/recipes.js.map +1 -1
- package/dist/registry/index.d.ts +2 -1
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +36 -6
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/materialize.d.ts +1 -1
- package/dist/registry/materialize.d.ts.map +1 -1
- package/dist/registry/materialize.js +41 -7
- package/dist/registry/materialize.js.map +1 -1
- package/dist/registry/recommend.d.ts +1 -1
- package/dist/registry/recommend.d.ts.map +1 -1
- package/dist/registry/recommend.js +1 -1
- package/dist/registry/recommend.js.map +1 -1
- package/dist/router/server.d.ts.map +1 -1
- package/dist/router/server.js +10 -2
- package/dist/router/server.js.map +1 -1
- package/dist/supervisor/index.d.ts.map +1 -1
- package/dist/supervisor/index.js +24 -6
- package/dist/supervisor/index.js.map +1 -1
- package/dist/supervisor/telemetry.js +1 -1
- package/dist/supervisor/telemetry.js.map +1 -1
- package/dist/types/index.d.ts +18 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/App.js +1 -1
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/PresetEditor.d.ts +6 -0
- package/dist/ui/PresetEditor.d.ts.map +1 -1
- package/dist/ui/PresetEditor.js +330 -70
- package/dist/ui/PresetEditor.js.map +1 -1
- package/dist/ui/clipboard.d.ts +4 -0
- package/dist/ui/clipboard.d.ts.map +1 -0
- package/dist/ui/clipboard.js +77 -0
- package/dist/ui/clipboard.js.map +1 -0
- package/dist/ui/useDownloads.d.ts.map +1 -1
- package/dist/ui/useDownloads.js +3 -4
- package/dist/ui/useDownloads.js.map +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -17,15 +17,15 @@ These are load-bearing. If a change seems to need to break one, stop and ask.
|
|
|
17
17
|
3. **Preserve non-athanor pi entries.** `src/sync/pi.ts` rewrites only providers whose name starts with `athanor-`. Everything else in `~/.pi/agent/models.json` (OpenAI, Anthropic, Ollama, OpenRouter, user customs) must round-trip untouched. Same for `~/.pi/agent/settings.json` — only `defaultProvider` / `defaultModel` are touched, and only when a model is started as the active default.
|
|
18
18
|
4. **Pi sync shape follows `config.router.enabled`.** Default (`router.enabled: true`): up to two aggregator providers — `athanor-mlx` and `athanor-llama` — both pointing at the ingress `baseUrl`, each listing only models of its runtime and carrying runtime-specific compat flags (MLX sets `supportsDeveloperRole: false`; llama-server doesn't). Providers with zero exposed members are suppressed. When `router.enabled` is false: each exposed model becomes its own pi provider `athanor-<runtime>-<slug>` with one `baseUrl` per model. Never emit both shapes. The CLI verbs are `expose` / `hide`; the underlying registry field is `publish: boolean` (storage name, kept stable for backward-compat of on-disk `models.json`).
|
|
19
19
|
5. **Runtime model id matches launch argument literally.** `mlx_lm.server` compares the request's `model` field to whatever was passed as `--model` and falls back to a HuggingFace network lookup on mismatch. The pi model `id` we emit must equal the adapter's `--model` (MLX) or `--alias` (llama-server). Hub GGUF defaults to registry `id` (`author/repo:file.gguf`) unless the user set a custom `piAlias` different from `slug`. See `src/adapters/model-id.ts`, `src/sync/pi.ts`, and `src/adapters/*.ts`. pi's `/model` picker lists by `id`, not `name`.
|
|
20
|
-
6. **Pi context metadata reflects effective served context.** `src/sync/pi.ts` must advertise the model's effective runtime context window from merged runtime config (`mergedConfigFor(entry)`), not only explicit per-model
|
|
20
|
+
6. **Pi context metadata reflects effective served context.** `src/sync/pi.ts` must advertise the model's effective runtime context window from merged runtime config (`mergedConfigFor(entry)`), not only explicit per-model formula fields and not the model's theoretical maximum. pi should see what athanor will actually serve.
|
|
21
21
|
7. **MLX capability detection and flavor routing are separate axes.** Two fields live on an MLX entry:
|
|
22
22
|
- `mlxCapabilities: ("vlm")[]` — a detected *fact* about the model (does config.json advertise a vision tower?). Refreshed by `ingestDiscovered` and `pull` via `detectMlxCapabilities()` in `src/discovery/scanner.ts`. Safe to overwrite on re-scan.
|
|
23
23
|
- `mlxFlavor: "lm" | "vlm"` — user *intent* about which server binary to launch. `"vlm"` routes to `mlx_vlm.server`; `"lm"` (or absent) routes to `mlx_lm.server`. Only set by `athanor flavor <slug> lm|vlm` (`cmdFlavor` in `src/cli/commands.ts`). Discovery and ingest must never touch it.
|
|
24
24
|
|
|
25
25
|
Detection is advisory because many VLM-tagged repos run fine as text-only under `mlx_lm.server` with no torch/torchvision installed, and that's usually the preferred path. `cmdShow` surfaces the capability with a hint that points at `athanor flavor`. Do not add VLM detection anywhere other than `detectMlxCapabilities`; keep it a single source of truth.
|
|
26
26
|
8. **Supervisor default policy is `single-active`.** Starting model B stops model A unless the user opts into `multi-active-lru` (or `manual`) in `config.json`. Policies live in `src/supervisor/policies.ts`.
|
|
27
|
-
9. **
|
|
28
|
-
10. **All mutations go through helpers.** Use `
|
|
27
|
+
9. **Formulas are additive, scans are non-destructive.** `athanor scan` refreshes `path`, `sizeBytes`, and `mlxCapabilities`. `formula`, `publish`, `piAlias`, `tags`, `port`, `slug`, and `mlxFlavor` must survive re-scans. Built-in formulas are explicit; `balanced` is not shorthand for clearing a formula, and `formula clear` is the separate remove action.
|
|
28
|
+
10. **All mutations go through helpers.** Use `setFormulaFields` / `unsetFormulaFields` from `src/presets/edit.ts`, `formulaToRuntime` from `src/presets/recipes.ts`, and `updateModel` / `setModelFormula` from `src/registry/index.ts`. Do not hand-edit registry objects in commands or UI components.
|
|
29
29
|
|
|
30
30
|
## Layout
|
|
31
31
|
|
|
@@ -36,14 +36,14 @@ src/
|
|
|
36
36
|
config/ # config load + defaults
|
|
37
37
|
control/ # optional HTTP control API (opt-in)
|
|
38
38
|
discovery/ # HF cache scanner + ingest + fs.watch watcher; detectMlxCapabilities lives here
|
|
39
|
-
presets/ #
|
|
39
|
+
presets/ # formula merge, tunable-key metadata, built-in + user formulas engine
|
|
40
40
|
pull/ # HF repo inspection + `hf` download wrapper
|
|
41
41
|
registry/ # atomic models.json CRUD, slug + port allocation, dedup on load, display labels
|
|
42
42
|
router/ # optional OpenAI-compatible proxy (opt-in, single port)
|
|
43
43
|
search/ # HF Hub search + trending
|
|
44
44
|
supervisor/ # detached process lifecycle, policy, reattach, logs
|
|
45
45
|
sync/ # namespaced pi-agent catalog merge
|
|
46
|
-
ui/ # Ink TUI: App, ModelList, LogTail, PullModal, PresetEditor
|
|
46
|
+
ui/ # Ink TUI: App, ModelList, LogTail, PullModal, PresetEditor (Formula Editor)
|
|
47
47
|
types/ # shared types (ModelEntry, DiscoveredModel, etc.)
|
|
48
48
|
test/setup.ts # redirects ATHANOR_HOME and PI_HOME to a tmp dir per run
|
|
49
49
|
```
|
|
@@ -148,13 +148,13 @@ End-to-end operator flow once a model is in the registry (pulled or scanned):
|
|
|
148
148
|
|---|---|---|
|
|
149
149
|
| refresh cache | `athanor scan` | idempotent; picks up anything downloaded outside `athanor pull`, e.g. via `hf download` directly |
|
|
150
150
|
| list | `athanor ls` | empty ⇒ curated suggestions; otherwise shows slug, runtime, port, publish state, running state |
|
|
151
|
-
| inspect | `athanor show <slug>` | detected capabilities, resolved launch command, merged
|
|
151
|
+
| inspect | `athanor show <slug>` | detected capabilities, resolved launch command, merged formula, current status |
|
|
152
152
|
| start | `athanor start <slug>` | spawns a detached child on the entry's stable port; default policy (`single-active`) stops any currently-running model first |
|
|
153
153
|
| tail logs | `athanor logs <slug> -n 500` | prints the last N lines from `~/.athanor/logs/<slug>-<pid>.log`; for live follow use the TUI |
|
|
154
154
|
| verify endpoint | `curl localhost:<port>/v1/models` | OpenAI-compatible; port is printed by `ls` / `show` / `status` |
|
|
155
155
|
| runtime status | `athanor status` | pid, cpu, rss, tok/s across all running instances |
|
|
156
156
|
| stop | `athanor stop <slug>` | graceful SIGTERM; if the router is on, any in-flight stream drains up to `config.router.drainTimeoutMs` (30s default) first |
|
|
157
|
-
| restart | `athanor restart <slug>` | stop + start; useful after `athanor
|
|
157
|
+
| restart | `athanor restart <slug>` | stop + start; useful after `athanor formula set` changes |
|
|
158
158
|
|
|
159
159
|
Bare `athanor` (no args) opens the Ink TUI with the same surface. When the registry is empty, the TUI's start screen lists the curated suggestions from `src/pull/suggestions.ts`; pressing `Enter` pulls the selected one inline. Once models exist: `p` pulls, `s` scans, `Enter` toggles start/stop, `tab` hides the selector to scroll logs with `↑ ↓ / page up/down / mouse wheel`, `q` exits.
|
|
160
160
|
|
|
@@ -173,8 +173,8 @@ To make a running model available to `pi-agent` downstream, `athanor expose <slu
|
|
|
173
173
|
| Path | Purpose |
|
|
174
174
|
|---|---|
|
|
175
175
|
| `~/.athanor/config.json` | user config: scan roots, port range, supervisor policy, control API |
|
|
176
|
-
| `~/.athanor/models.json` | registry — source of truth for slugs, ports,
|
|
177
|
-
| `~/.athanor/
|
|
176
|
+
| `~/.athanor/models.json` | registry — source of truth for slugs, ports, formulas, publish state |
|
|
177
|
+
| `~/.athanor/formulas.json` | optional user formulas; overrides built-ins of the same name (with auto-migration from legacy `recipes.json`) |
|
|
178
178
|
| `~/.athanor/logs/<slug>-<pid>.log` | per-run supervisor log |
|
|
179
179
|
| `~/.athanor/state.json` | running PIDs / ports for reattach (see `src/supervisor/state.ts`) |
|
|
180
180
|
| `~/.pi/agent/models.json` | pi-agent providers; athanor namespace only |
|
package/README.md
CHANGED
|
@@ -240,7 +240,7 @@ athanor ls # now usable directly
|
|
|
240
240
|
| `runtime` | `mlx` or `llama.cpp` |
|
|
241
241
|
| `source` | `{ type: "hf", repo, [revision], [file] }` or `{ type: "local" }` |
|
|
242
242
|
| `port` | **stable** port allocated once per model, never changes |
|
|
243
|
-
| `
|
|
243
|
+
| `formula` | per-model overrides that merge on top of global runtime config |
|
|
244
244
|
| `mlxFlavor` | `"lm"` or `"vlm"` — picks which MLX binary to use (MLX only) |
|
|
245
245
|
| `publish` | whether pi-agent sees this model |
|
|
246
246
|
| `piAlias` | optional llama launch alias; when set to something other than `slug`, overrides the default runtime model id |
|
|
@@ -368,9 +368,9 @@ athanor search [q] [--mlx|--gguf|--any] [--author A] [--sort S] [--limit N]
|
|
|
368
368
|
search the HuggingFace Hub
|
|
369
369
|
athanor trending [--mlx|--gguf] [--limit N]
|
|
370
370
|
top trending MLX/GGUF models
|
|
371
|
-
athanor
|
|
372
|
-
view or modify a model's
|
|
373
|
-
athanor
|
|
371
|
+
athanor formula <slug> show|set k=v...|unset k...|clear|apply <name>|save <name>
|
|
372
|
+
view or modify a model's formula
|
|
373
|
+
athanor formulas [delete <name>] list or manage formulas in library
|
|
374
374
|
athanor flavor <slug> lm|vlm force MLX runtime flavor (lm = mlx_lm, vlm = mlx_vlm)
|
|
375
375
|
athanor expose <id|slug> include in pi-agent catalog
|
|
376
376
|
athanor hide <id|slug> remove from pi-agent catalog
|
|
@@ -398,13 +398,13 @@ athanor doctor --check-updates also compare installed versions with latest ava
|
|
|
398
398
|
| `D` | open the downloads modal |
|
|
399
399
|
| `s` | rescan and ingest new models (automatic on start and when the HF cache changes) |
|
|
400
400
|
| `p` | open the pull modal (`esc` cancels in progress) |
|
|
401
|
-
| `e` | open the
|
|
401
|
+
| `e` | open the formula editor for the highlighted model |
|
|
402
402
|
| `t` | open the telemetry modal for the highlighted model |
|
|
403
403
|
| `/` | filter the list by substring of slug or id |
|
|
404
404
|
| `tab` | hide the model selector and expand the log pane; press again to restore |
|
|
405
405
|
| `q` | quit (does **not** stop running models) |
|
|
406
406
|
|
|
407
|
-
The downloads modal shows queued/running/completed pulls. Inside it: `↑↓` selects a task, `c` cancels the selected running task, `C` clears finished tasks, and `esc` closes the modal.
|
|
407
|
+
The downloads modal shows queued/running/completed pulls. Inside it: `↑↓` selects a task, `c` cancels the selected running task, `C` clears finished tasks, and `esc` closes the modal. Inside the formula editor (`e`): `Tab` toggles between Simple and Advanced modes. In Simple mode: `↑↓` selects smart compound knobs (Context, KV Cache, Speculative, Sampling Mode, GPU Offload), `◀/▶` cycles options, and `⏎` enters custom values. In Advanced mode: keys are grouped by category with full granular control. In both modes: `1-7` applies formulas, `s` saves custom formulas, `y` copies formula config & command to clipboard, `u` unsets a field, `c` prompts confirmation to clear, `v` toggles MLX flavor (`lm`/`vlm`), and `esc` closes.
|
|
408
408
|
|
|
409
409
|
With the selector hidden (`tab`), the log pane grows to fill the space and the arrow keys switch roles:
|
|
410
410
|
|
|
@@ -472,55 +472,85 @@ Models downloaded out-of-band (`hf download` in another terminal, or pulled whil
|
|
|
472
472
|
}
|
|
473
473
|
```
|
|
474
474
|
|
|
475
|
-
### Per-model
|
|
475
|
+
### Per-model formulas
|
|
476
476
|
|
|
477
|
-
`mlx` and `llama` above are **global defaults**. Athanor
|
|
477
|
+
`mlx` and `llama` above are **global defaults**. Athanor ships a practical 64K default context baseline; built-in formulas scale that up or down by use case. Any model in the registry can override the globals with its `formula` field, which is merged on top per-runtime. Manage formulas via the CLI (preferred) or the TUI (press `e` on a highlighted model):
|
|
478
478
|
|
|
479
479
|
```bash
|
|
480
480
|
# inspect effective config, launch command, and running state
|
|
481
481
|
athanor show qwen-32b
|
|
482
482
|
|
|
483
483
|
# set / unset individual fields — kebab-case and camelCase both work
|
|
484
|
-
athanor
|
|
485
|
-
athanor
|
|
486
|
-
athanor
|
|
484
|
+
athanor formula qwen-32b set ctx-size=32768 nGpuLayers=48
|
|
485
|
+
athanor formula qwen-32b unset ctx-size
|
|
486
|
+
athanor formula qwen-32b clear
|
|
487
487
|
|
|
488
|
-
# apply a named
|
|
489
|
-
athanor
|
|
488
|
+
# apply a named formula for the model's runtime
|
|
489
|
+
athanor formula qwen-32b apply thinking
|
|
490
490
|
|
|
491
|
-
#
|
|
492
|
-
athanor
|
|
491
|
+
# save a model's current formula tuning as a reusable custom formula
|
|
492
|
+
athanor formula qwen-32b save my-reasoning-formula
|
|
493
|
+
|
|
494
|
+
# list built-in + user formulas and every tunable key per runtime
|
|
495
|
+
athanor formulas
|
|
496
|
+
|
|
497
|
+
# delete a custom formula from your library
|
|
498
|
+
athanor formulas delete my-reasoning-formula
|
|
493
499
|
```
|
|
494
500
|
|
|
495
|
-
|
|
501
|
+
*(Note: `athanor preset` and `athanor recipes` remain supported as backward-compatible aliases).*
|
|
502
|
+
|
|
503
|
+
Built-in formulas: `balanced`, `fast`, `long-context`, `q8-kv`, `thinking`, `instruct`, `mtp`.
|
|
496
504
|
|
|
497
505
|
- `balanced` — recommended default, 64K context
|
|
498
506
|
- `fast` — lower latency, 8K context
|
|
499
|
-
- `long-context` — 128K context for large documents
|
|
507
|
+
- `long-context` — 128K context for large documents (with Q8_0 KV cache and Flash Attention)
|
|
508
|
+
- `q8-kv` — Q8_0 KV cache quantization with Flash Attention for reduced memory footprint
|
|
500
509
|
- `thinking` — reasoning model sampling (temp=1.0, topP=0.95, topK=20)
|
|
501
510
|
- `instruct` — standard instruct sampling (temp=0.7, topP=0.80, presencePenalty=1.5)
|
|
502
511
|
- `mtp` — Multi-Token Prediction speculative decoding
|
|
503
512
|
|
|
504
|
-
`balanced` is an explicit
|
|
513
|
+
`balanced` is an explicit formula; clearing a formula is a separate action (`athanor formula <slug> clear`). Save your own tuning as custom named formulas via `athanor formula <slug> save <name>` or by editing `~/.athanor/formulas.json` (a plain list or `{ "formulas": [...] }`). User formulas override built-ins of the same name.
|
|
505
514
|
|
|
506
|
-
|
|
515
|
+
Formulas survive re-scans: `athanor scan` only refreshes `path`, `sizeBytes`, and — for MLX — `mlxCapabilities`. Everything else is left alone. `athanor ls` marks tuned models with `[tuned]`.
|
|
507
516
|
|
|
508
|
-
Under the hood, a
|
|
517
|
+
Under the hood, a formula looks like this in `~/.athanor/models.json` — you can edit it directly if you prefer:
|
|
509
518
|
|
|
510
519
|
```json
|
|
511
520
|
{
|
|
512
521
|
"id": "mlx-community/Qwen2.5-32B-Instruct-4bit",
|
|
513
522
|
"slug": "qwen-32b",
|
|
514
|
-
"
|
|
523
|
+
"formula": {
|
|
515
524
|
"runtime": "mlx",
|
|
516
525
|
"mlx": { "decodeConcurrency": 1, "prefillStepSize": 512, "promptCacheSize": 32768 }
|
|
517
526
|
}
|
|
518
527
|
}
|
|
519
528
|
```
|
|
520
529
|
|
|
521
|
-
Restart the model for the
|
|
530
|
+
Restart the model for the formula to take effect.
|
|
531
|
+
|
|
532
|
+
pi-agent receives the model's effective served context window from athanor's merged runtime configuration (global defaults plus any per-model formula), so pi metadata matches the actual launch settings rather than only explicit override fields.
|
|
533
|
+
|
|
534
|
+
### KV Cache Quantization & Flash Attention (llama.cpp only)
|
|
535
|
+
|
|
536
|
+
Large context windows (32K–128K+) with default FP16 KV cache can consume 10–30+ GB of memory alone. On Apple Silicon unified memory, this can trigger OS paging and swap thrashing, collapsing throughput from 15+ tok/s down to single digits.
|
|
522
537
|
|
|
523
|
-
|
|
538
|
+
Quantizing the KV cache to `q8_0` (or `q4_0`) roughly halves the KV cache memory while preserving reasoning accuracy:
|
|
539
|
+
|
|
540
|
+
```bash
|
|
541
|
+
# Halve KV cache size with Q8_0 quantization and enable Flash Attention
|
|
542
|
+
athanor preset qwen-27b set cache-type-k=q8_0 cache-type-v=q8_0 flash-attn=on
|
|
543
|
+
|
|
544
|
+
# Or apply the built-in q8-kv recipe
|
|
545
|
+
athanor preset qwen-27b apply q8-kv
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
Available keys:
|
|
549
|
+
- `cache-type-k` / `cacheTypeK` / `ctk` — KV cache key data type (`f16`, `q8_0`, `q4_0`, `q4_1`, `iq4_nl`, `q5_0`, `q5_1`, `bf16`, `f32`)
|
|
550
|
+
- `cache-type-v` / `cacheTypeV` / `ctv` — KV cache value data type (`f16`, `q8_0`, `q4_0`, etc.)
|
|
551
|
+
- `flash-attn` / `flashAttn` / `fa` — Flash Attention mode (`on`, `off`, `auto`). Required when using quantized KV cache in `llama.cpp`.
|
|
552
|
+
- `spec-draft-type-k` / `specDraftCacheTypeK` / `ctkd` — Draft model KV cache key data type
|
|
553
|
+
- `spec-draft-type-v` / `specDraftCacheTypeV` / `ctvd` — Draft model KV cache value data type
|
|
524
554
|
|
|
525
555
|
### Speculative Decoding & MTP (llama.cpp only)
|
|
526
556
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,cAAc,EACd,WAAW,EACZ,MAAM,mBAAmB,CAAA;AAM1B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,CAGxD,CAAA;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,cAAc,CAE/D;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAIvE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,cAAc,EACd,WAAW,EACZ,MAAM,mBAAmB,CAAA;AAM1B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,CAGxD,CAAA;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,cAAc,CAE/D;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAIvE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,WAAW,CAW1E;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,UAAU,GAChB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAI/D;AAMD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,UAAU,EAAE,EACrB,UAAU,EAAE,MAAM,GACjB,UAAU,GAAG,SAAS,CAQxB"}
|
package/dist/adapters/index.js
CHANGED
|
@@ -19,11 +19,12 @@ export function inferRuntime(modelPath) {
|
|
|
19
19
|
}
|
|
20
20
|
export function mergedConfigFor(entry) {
|
|
21
21
|
const cfg = loadConfig();
|
|
22
|
+
const active = entry.formula ?? entry.preset;
|
|
22
23
|
if (entry.runtime === "mlx") {
|
|
23
|
-
const override =
|
|
24
|
+
const override = active && active.runtime === "mlx" ? active.mlx : {};
|
|
24
25
|
return { ...cfg.mlx, ...override };
|
|
25
26
|
}
|
|
26
|
-
const override =
|
|
27
|
+
const override = active && active.runtime === "llama.cpp" ? active.llama : {};
|
|
27
28
|
return { ...cfg.llama, ...override };
|
|
28
29
|
}
|
|
29
30
|
export function buildCommandFor(entry) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,CAAC,MAAM,QAAQ,GAAwC;IAC3D,KAAK,EAAE,IAAI,UAAU,EAAE;IACvB,WAAW,EAAE,IAAI,YAAY,EAAE;CAChC,CAAA;AAED,MAAM,UAAU,UAAU,CAAC,OAAoB;IAC7C,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAA;AAC1B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,IAAI,SAAS,CAAC,QAAQ,CAA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,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,CACvC,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llama.d.ts","sourceRoot":"","sources":["../../src/adapters/llama.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACd,WAAW,EACZ,MAAM,mBAAmB,CAAA;AAI1B,qBAAa,YAAa,YAAW,cAAc;IACjD,IAAI,EAAE,WAAW,CAAc;IAE/B,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE;
|
|
1
|
+
{"version":3,"file":"llama.d.ts","sourceRoot":"","sources":["../../src/adapters/llama.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACd,WAAW,EACZ,MAAM,mBAAmB,CAAA;AAI1B,qBAAa,YAAa,YAAW,cAAc;IACjD,IAAI,EAAE,WAAW,CAAc;IAE/B,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE;IAkGrF,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGhC"}
|
package/dist/adapters/llama.js
CHANGED
|
@@ -41,6 +41,15 @@ export class LlamaAdapter {
|
|
|
41
41
|
if (merged.repeatLastN !== undefined) {
|
|
42
42
|
args.push("--repeat-last-n", String(merged.repeatLastN));
|
|
43
43
|
}
|
|
44
|
+
if (merged.cacheTypeK !== undefined) {
|
|
45
|
+
args.push("--cache-type-k", String(merged.cacheTypeK));
|
|
46
|
+
}
|
|
47
|
+
if (merged.cacheTypeV !== undefined) {
|
|
48
|
+
args.push("--cache-type-v", String(merged.cacheTypeV));
|
|
49
|
+
}
|
|
50
|
+
if (merged.flashAttn !== undefined) {
|
|
51
|
+
args.push("--flash-attn", String(merged.flashAttn));
|
|
52
|
+
}
|
|
44
53
|
const isMtpCapable = entry.capabilities?.includes("mtp") || false;
|
|
45
54
|
const specMode = merged.speculativeMode || "auto";
|
|
46
55
|
const mtpActive = (specMode === "enabled") || (specMode === "auto" && isMtpCapable);
|
|
@@ -73,6 +82,12 @@ export class LlamaAdapter {
|
|
|
73
82
|
if (effectiveSpecDraftNgl !== undefined) {
|
|
74
83
|
args.push("--spec-draft-ngl", String(effectiveSpecDraftNgl));
|
|
75
84
|
}
|
|
85
|
+
if (merged.specDraftCacheTypeK !== undefined) {
|
|
86
|
+
args.push("--spec-draft-type-k", String(merged.specDraftCacheTypeK));
|
|
87
|
+
}
|
|
88
|
+
if (merged.specDraftCacheTypeV !== undefined) {
|
|
89
|
+
args.push("--spec-draft-type-v", String(merged.specDraftCacheTypeV));
|
|
90
|
+
}
|
|
76
91
|
return {
|
|
77
92
|
cmd: "llama-server",
|
|
78
93
|
args
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llama.js","sourceRoot":"","sources":["../../src/adapters/llama.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,OAAO,YAAY;IACvB,IAAI,GAAgB,WAAW,CAAA;IAE/B,YAAY,CAAC,KAAiB,EAAE,MAAmB;QACjD,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;QACnC,MAAM,IAAI,GAAG;YACX,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,8DAA8D;YAC9D,wDAAwD;YACxD,SAAS,EAAE,KAAK;YAChB,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;YAC5B,QAAQ,EAAE,WAAW;YACrB,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU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;QACD,IAAI,MAAM,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;YAC7C,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,MAAM,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;YAC7C,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAA;QACtE,CAAC;QAED,OAAO;YACL,GAAG,EAAE,cAAc;YACnB,IAAI;SACL,CAAA;IACH,CAAC;IAED,SAAS,CAAC,IAAY;QACpB,OAAO,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACrC,CAAC;CACF"}
|
package/dist/app/models.d.ts
CHANGED
|
@@ -26,7 +26,8 @@ export declare function restartModel(idOrSlug: string, opts?: {
|
|
|
26
26
|
}): Promise<StartModelResult>;
|
|
27
27
|
export declare function setPublished(idOrSlug: string, publish: boolean): ModelEntry;
|
|
28
28
|
export declare function setFlavor(idOrSlug: string, mlxFlavor: ModelEntry["mlxFlavor"]): ModelEntry;
|
|
29
|
-
export declare function
|
|
29
|
+
export declare function setFormula(idOrSlug: string, formula: ModelEntry["formula"]): ModelEntry;
|
|
30
|
+
export declare const setPreset: typeof setFormula;
|
|
30
31
|
export declare function deleteModelFromDisk(idOrSlug: string): ModelEntry;
|
|
31
32
|
export declare function removeModelEntry(idOrSlug: string): void;
|
|
32
33
|
export declare function syncPiNow(activeDefault?: ActiveInstance): Promise<void>;
|
package/dist/app/models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/app/models.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,wBAAwB,CA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AE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAW5G;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,CAK3E;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,UAAU,CAK1F;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,GAAG,UAAU,CAKvF;AAED,eAAO,MAAM,SAAS,mBAAa,CAAA;AA2EnC,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAoBhE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAGvD;AAKD,wBAAsB,SAAS,CAAC,aAAa,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAG7E"}
|
package/dist/app/models.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as path from "path";
|
|
|
3
3
|
import * as os from "os";
|
|
4
4
|
import { ingestDiscovered } from "../discovery/ingest.js";
|
|
5
5
|
import { pull } from "../pull/hf.js";
|
|
6
|
-
import { getModel, removeModel, setModelFlavor,
|
|
6
|
+
import { getModel, removeModel, setModelFlavor, setModelFormula, setModelPublish } from "../registry/index.js";
|
|
7
7
|
import { loadConfig } from "../config/index.js";
|
|
8
8
|
import { supervisor } from "../supervisor/index.js";
|
|
9
9
|
import { syncPi } from "../sync/pi.js";
|
|
@@ -80,13 +80,14 @@ export function setFlavor(idOrSlug, mlxFlavor) {
|
|
|
80
80
|
syncPi({ instances: supervisor.list() });
|
|
81
81
|
return entry;
|
|
82
82
|
}
|
|
83
|
-
export function
|
|
84
|
-
const entry =
|
|
83
|
+
export function setFormula(idOrSlug, formula) {
|
|
84
|
+
const entry = setModelFormula(idOrSlug, formula);
|
|
85
85
|
if (!entry)
|
|
86
86
|
throw new Error(`unknown model: ${idOrSlug}`);
|
|
87
87
|
syncPi({ instances: supervisor.list() });
|
|
88
88
|
return entry;
|
|
89
89
|
}
|
|
90
|
+
export const setPreset = setFormula;
|
|
90
91
|
function realpathIfExists(p) {
|
|
91
92
|
try {
|
|
92
93
|
return fs.realpathSync(p);
|
|
@@ -96,36 +97,65 @@ function realpathIfExists(p) {
|
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
function isInside(parent, child) {
|
|
99
|
-
const
|
|
100
|
+
const realParent = realpathIfExists(parent) ?? path.resolve(parent);
|
|
101
|
+
const realChild = realpathIfExists(child) ?? path.resolve(child);
|
|
102
|
+
const rel = path.relative(realParent, realChild);
|
|
100
103
|
return rel !== "" && !rel.startsWith("..") && !path.isAbsolute(rel);
|
|
101
104
|
}
|
|
102
105
|
function removePathRecursive(target) {
|
|
103
106
|
fs.rmSync(target, { recursive: true, force: true });
|
|
104
107
|
}
|
|
105
108
|
function removeHfSnapshotFromEntry(entry) {
|
|
106
|
-
const
|
|
107
|
-
if (!
|
|
109
|
+
const targetPath = entry.path;
|
|
110
|
+
if (!fs.existsSync(targetPath))
|
|
108
111
|
return false;
|
|
112
|
+
const config = loadConfig();
|
|
113
|
+
const hubRoot = path.join(os.homedir(), ".cache", "huggingface", "hub");
|
|
114
|
+
const configuredRoot = realpathIfExists(config.modelDirs.mlx.replace(/^~/, os.homedir()));
|
|
115
|
+
const resolvedHubRoot = configuredRoot ?? realpathIfExists(hubRoot) ?? hubRoot;
|
|
116
|
+
const resolvedTarget = realpathIfExists(targetPath) ?? targetPath;
|
|
109
117
|
if (entry.runtime === "mlx") {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const configuredRoot = realpathIfExists(config.modelDirs.mlx.replace(/^~/, os.homedir()));
|
|
113
|
-
const resolvedHubRoot = configuredRoot ?? realpathIfExists(hubRoot) ?? hubRoot;
|
|
114
|
-
if (!isInside(resolvedHubRoot, snapshotPath)) {
|
|
115
|
-
throw new Error(`refusing to remove snapshot outside HF cache: ${snapshotPath}`);
|
|
118
|
+
if (!isInside(resolvedHubRoot, resolvedTarget) && !isInside(resolvedHubRoot, targetPath)) {
|
|
119
|
+
throw new Error(`refusing to remove snapshot outside HF cache: ${targetPath}`);
|
|
116
120
|
}
|
|
117
|
-
|
|
121
|
+
// If target is inside a models--org--repo directory, remove the entire model directory
|
|
122
|
+
const parsed = path.resolve(targetPath);
|
|
123
|
+
const parts = parsed.split(path.sep);
|
|
124
|
+
const modelDirIdx = parts.findIndex(p => p.startsWith("models--"));
|
|
125
|
+
if (modelDirIdx >= 0) {
|
|
126
|
+
const modelRepoDir = parts.slice(0, modelDirIdx + 1).join(path.sep);
|
|
127
|
+
if (isInside(resolvedHubRoot, modelRepoDir) || path.resolve(resolvedHubRoot) === path.dirname(modelRepoDir)) {
|
|
128
|
+
removePathRecursive(modelRepoDir);
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
removePathRecursive(resolvedTarget);
|
|
118
133
|
return true;
|
|
119
134
|
}
|
|
120
135
|
if (entry.source.type === "hf" && entry.source.file) {
|
|
121
|
-
|
|
136
|
+
// Single-file GGUF in HF cache: remove the underlying blob and the snapshot file
|
|
137
|
+
if (resolvedTarget && resolvedTarget !== targetPath && fs.existsSync(resolvedTarget)) {
|
|
138
|
+
removePathRecursive(resolvedTarget);
|
|
139
|
+
}
|
|
140
|
+
if (fs.existsSync(targetPath)) {
|
|
141
|
+
removePathRecursive(targetPath);
|
|
142
|
+
}
|
|
143
|
+
try {
|
|
144
|
+
const snapshotDir = path.dirname(targetPath);
|
|
145
|
+
if (fs.existsSync(snapshotDir) && fs.readdirSync(snapshotDir).length === 0) {
|
|
146
|
+
fs.rmdirSync(snapshotDir);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
// ignore rmdir cleanup errors
|
|
151
|
+
}
|
|
122
152
|
return true;
|
|
123
153
|
}
|
|
124
154
|
return false;
|
|
125
155
|
}
|
|
126
156
|
function removeLocalModelPath(entry) {
|
|
127
|
-
const target = realpathIfExists(entry.path);
|
|
128
|
-
if (!target)
|
|
157
|
+
const target = realpathIfExists(entry.path) ?? entry.path;
|
|
158
|
+
if (!fs.existsSync(target))
|
|
129
159
|
return false;
|
|
130
160
|
removePathRecursive(target);
|
|
131
161
|
return true;
|
|
@@ -134,6 +164,10 @@ export function deleteModelFromDisk(idOrSlug) {
|
|
|
134
164
|
const entry = getModel(idOrSlug);
|
|
135
165
|
if (!entry)
|
|
136
166
|
throw new Error(`unknown model: ${idOrSlug}`);
|
|
167
|
+
const running = supervisor.list().some(i => i.id === entry.id || i.slug === entry.slug);
|
|
168
|
+
if (running) {
|
|
169
|
+
throw new Error(`cannot delete model "${entry.slug}" while it is running; stop it first with 'athanor stop ${entry.slug}'`);
|
|
170
|
+
}
|
|
137
171
|
const removedPath = entry.source.type === "local"
|
|
138
172
|
? removeLocalModelPath(entry)
|
|
139
173
|
: removeHfSnapshotFromEntry(entry);
|
package/dist/app/models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/app/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AAExB,OAAO,EAAE,gBAAgB,EAAqB,MAAM,wBAAwB,CAAA;AAC5E,OAAO,EAAE,IAAI,EAAqC,MAAM,eAAe,CAAA;AACvE,OAAO,EACL,QAAQ,EACR,WAAW,EACX,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/app/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,IAA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AE,EAAE,CAAC,CAAA;IACzE,MAAM,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACxC,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,QAAQ,EAAE,CAAC,CAAA;IACzE,MAAM,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;AAC1C,CAAC;AAED,sEAAsE;AACtE,uEAAuE;AACvE,qEAAqE;AACrE,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,aAA8B;IAC5D,MAAM,+BAA+B,EAAE,CAAA;IACvC,MAAM,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;AACzD,CAAC"}
|
package/dist/cli/commands.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { cmdExpose, cmdFlavor, cmdList, cmdLogs, cmdRestart, cmdRm, cmdScan, cmdShow, cmdStart, cmdStatus, cmdStop, cmdSync } from "./model-commands.js";
|
|
2
|
-
export { cmdPresetApply, cmdPresetClear, cmdPresetSet, cmdPresetShow, cmdPresetUnset, cmdRecipes } from "./preset-commands.js";
|
|
2
|
+
export { cmdFormulaApply, cmdFormulaClear, cmdFormulaSave, cmdFormulaSet, cmdFormulaShow, cmdFormulaUnset, cmdFormulas, cmdFormulasDelete, cmdPresetApply, cmdPresetClear, cmdPresetSave, cmdPresetSet, cmdPresetShow, cmdPresetUnset, cmdRecipeDelete, cmdRecipes } from "./preset-commands.js";
|
|
3
3
|
export { cmdConfig, cmdDoctor, cmdRouter, cmdSearch } from "./system-commands.js";
|
|
4
4
|
export type { SearchCmdOpts } from "./system-commands.js";
|
|
5
5
|
export { cmdSnippet } from "./snippet-commands.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,SAAS,EACT,SAAS,EACT,OAAO,EACP,OAAO,EACP,UAAU,EACV,KAAK,EACL,OAAO,EACP,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,OAAO,EACR,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,cAAc,EACd,cAAc,EACd,YAAY,EACZ,aAAa,EACb,cAAc,EACd,UAAU,EACX,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAGtD,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsC3F"}
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,SAAS,EACT,SAAS,EACT,OAAO,EACP,OAAO,EACP,UAAU,EACV,KAAK,EACL,OAAO,EACP,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,OAAO,EACR,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,cAAc,EACd,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,cAAc,EACd,eAAe,EACf,UAAU,EACX,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAGtD,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsC3F"}
|
package/dist/cli/commands.js
CHANGED
|
@@ -4,7 +4,7 @@ import { style, sym } from "./style.js";
|
|
|
4
4
|
import { makeCliPullRenderer } from "./pull-renderer.js";
|
|
5
5
|
import { warn, dim, ok } from "./shared.js";
|
|
6
6
|
export { cmdExpose, cmdFlavor, cmdList, cmdLogs, cmdRestart, cmdRm, cmdScan, cmdShow, cmdStart, cmdStatus, cmdStop, cmdSync } from "./model-commands.js";
|
|
7
|
-
export { cmdPresetApply, cmdPresetClear, cmdPresetSet, cmdPresetShow, cmdPresetUnset, cmdRecipes } from "./preset-commands.js";
|
|
7
|
+
export { cmdFormulaApply, cmdFormulaClear, cmdFormulaSave, cmdFormulaSet, cmdFormulaShow, cmdFormulaUnset, cmdFormulas, cmdFormulasDelete, cmdPresetApply, cmdPresetClear, cmdPresetSave, cmdPresetSet, cmdPresetShow, cmdPresetUnset, cmdRecipeDelete, cmdRecipes } from "./preset-commands.js";
|
|
8
8
|
export { cmdConfig, cmdDoctor, cmdRouter, cmdSearch } from "./system-commands.js";
|
|
9
9
|
export { cmdSnippet } from "./snippet-commands.js";
|
|
10
10
|
export { cmdTelemetry } from "./telemetry-commands.js";
|
package/dist/cli/commands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS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.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAwFA,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAwF7D"}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cmdConfig, cmdDoctor, cmdExpose, cmdFlavor,
|
|
1
|
+
import { cmdConfig, cmdDoctor, cmdExpose, cmdFlavor, cmdFormulaApply, cmdFormulaClear, cmdFormulaSave, cmdFormulaSet, cmdFormulaShow, cmdFormulaUnset, cmdFormulas, cmdFormulasDelete, cmdList, cmdLogs, cmdPull, cmdRestart, cmdRm, cmdRouter, cmdScan, cmdSearch, cmdShow, cmdSnippet, cmdStart, cmdStatus, cmdStop, cmdSync, cmdTelemetry } from "./commands.js";
|
|
2
2
|
import { style } from "./style.js";
|
|
3
3
|
function usage() {
|
|
4
4
|
const rows = [
|
|
@@ -14,8 +14,8 @@ function usage() {
|
|
|
14
14
|
["pull", "<repo> [--file F] [--revision R]", ""],
|
|
15
15
|
["search", "[q] [--mlx|--gguf] [--author A] [--sort S] [--limit N]", "find models on HuggingFace"],
|
|
16
16
|
["trending", "[--mlx|--gguf] [--limit N]", "top trending MLX/GGUF models"],
|
|
17
|
-
["
|
|
18
|
-
["
|
|
17
|
+
["formula", "<slug> show|set k=v...|unset k...|clear|apply <name>|save <name>", "tune a model formula"],
|
|
18
|
+
["formulas", "[delete <name>]", "list or manage formulas + tunable keys"],
|
|
19
19
|
["flavor", "<slug> lm|vlm", "force MLX runtime flavor (lm = mlx_lm, vlm = mlx_vlm)"],
|
|
20
20
|
["expose", "<id|slug>", "include in pi-agent catalog"],
|
|
21
21
|
["hide", "<id|slug>", "remove from pi-agent catalog"],
|
|
@@ -95,31 +95,43 @@ export async function runCli(argv) {
|
|
|
95
95
|
case "snippet":
|
|
96
96
|
cmdSnippet(required(rest[0], "id|slug"));
|
|
97
97
|
return true;
|
|
98
|
-
case "
|
|
99
|
-
|
|
98
|
+
case "formulas":
|
|
99
|
+
case "recipes": {
|
|
100
|
+
if (rest[0] === "delete" || rest[0] === "rm") {
|
|
101
|
+
cmdFormulasDelete(required(rest[1], "formula-name"));
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
cmdFormulas();
|
|
100
105
|
return true;
|
|
106
|
+
}
|
|
107
|
+
case "formula":
|
|
101
108
|
case "preset": {
|
|
102
109
|
const slug = required(rest[0], "id|slug");
|
|
103
|
-
const sub = required(rest[1], "show|set|unset|clear|apply");
|
|
110
|
+
const sub = required(rest[1], "show|set|unset|clear|apply|save");
|
|
104
111
|
const tail = rest.slice(2);
|
|
105
112
|
switch (sub) {
|
|
106
113
|
case "show":
|
|
107
|
-
|
|
114
|
+
cmdFormulaShow(slug);
|
|
108
115
|
return true;
|
|
109
116
|
case "set":
|
|
110
|
-
|
|
117
|
+
cmdFormulaSet(slug, tail);
|
|
111
118
|
return true;
|
|
112
119
|
case "unset":
|
|
113
|
-
|
|
120
|
+
cmdFormulaUnset(slug, tail);
|
|
114
121
|
return true;
|
|
115
122
|
case "clear":
|
|
116
|
-
|
|
123
|
+
cmdFormulaClear(slug);
|
|
117
124
|
return true;
|
|
118
125
|
case "apply":
|
|
119
|
-
|
|
126
|
+
cmdFormulaApply(slug, required(tail[0], "formula"));
|
|
127
|
+
return true;
|
|
128
|
+
case "save":
|
|
129
|
+
case "save-formula":
|
|
130
|
+
case "save-recipe":
|
|
131
|
+
cmdFormulaSave(slug, required(tail[0], "formula-name"), tail[1]);
|
|
120
132
|
return true;
|
|
121
133
|
default:
|
|
122
|
-
console.error(`${style.red("✗")} unknown
|
|
134
|
+
console.error(`${style.red("✗")} unknown formula subcommand: ${style.bold(sub)}`);
|
|
123
135
|
process.exit(1);
|
|
124
136
|
}
|
|
125
137
|
return true;
|