athanor 3.4.0 → 3.5.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 +17 -11
- package/README.md +112 -711
- package/dist/supervisor/index.d.ts +15 -1
- package/dist/supervisor/index.d.ts.map +1 -1
- package/dist/supervisor/index.js +36 -3
- package/dist/supervisor/index.js.map +1 -1
- package/package.json +4 -1
package/AGENTS.md
CHANGED
|
@@ -10,9 +10,9 @@ Not a library. Not a daemon. No network listeners except the runtime children th
|
|
|
10
10
|
|
|
11
11
|
## Invariants
|
|
12
12
|
|
|
13
|
-
These are
|
|
13
|
+
These invariants are mandatory. Do not change them without an explicit user decision.
|
|
14
14
|
|
|
15
|
-
1. **Stable port per model.** Ports are allocated on first discovery from `config.portRange` and persisted on the registry entry
|
|
15
|
+
1. **Stable port per model.** Ports are allocated on first discovery from `config.portRange` and persisted on the registry entry. A model's port does not change after allocation; pi-agent provider URLs must remain stable across restarts.
|
|
16
16
|
2. **Atomic registry writes.** `~/.athanor/models.json` is always written via temp-file + rename in `src/registry/index.ts`. Never partial-write it, never keep it open across awaits.
|
|
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`).
|
|
@@ -22,7 +22,7 @@ These are load-bearing. If a change seems to need to break one, stop and ask.
|
|
|
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
|
-
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
|
|
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 the sole detection function.
|
|
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
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
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.
|
|
@@ -30,12 +30,15 @@ These are load-bearing. If a change seems to need to break one, stop and ask.
|
|
|
30
30
|
## Layout
|
|
31
31
|
|
|
32
32
|
```
|
|
33
|
+
docs/ # deep-dive user guides: setup, formulas, architecture, tui, troubleshooting
|
|
33
34
|
src/
|
|
34
35
|
adapters/ # mlx_lm + mlx_vlm + llama-server command builders, health probes, runtime model ids (model-id.ts)
|
|
36
|
+
app/ # application orchestration (model operations, preflight, sync side-effects)
|
|
35
37
|
cli/ # dispatcher (index.ts), commands.ts, doctor, formatting
|
|
36
38
|
config/ # config load + defaults
|
|
37
39
|
control/ # optional HTTP control API (opt-in)
|
|
38
40
|
discovery/ # HF cache scanner + ingest + fs.watch watcher; detectMlxCapabilities lives here
|
|
41
|
+
machine/ # Apple Silicon hardware profiling, bandwidth constants, memory estimation
|
|
39
42
|
presets/ # formula merge, tunable-key metadata, built-in + user formulas engine
|
|
40
43
|
pull/ # HF repo inspection + `hf` download wrapper
|
|
41
44
|
registry/ # atomic models.json CRUD, slug + port allocation, dedup on load, display labels
|
|
@@ -66,6 +69,8 @@ Context discipline:
|
|
|
66
69
|
|
|
67
70
|
## Development
|
|
68
71
|
|
|
72
|
+
Requires Node.js ≥ 22 on Apple Silicon (macOS 13.5+).
|
|
73
|
+
|
|
69
74
|
```bash
|
|
70
75
|
npm install
|
|
71
76
|
npx tsc --noEmit # typecheck — must be clean
|
|
@@ -89,7 +94,7 @@ When a user opens this repo with an agent and asks to "set up athanor", work in
|
|
|
89
94
|
|
|
90
95
|
### CLI install modes
|
|
91
96
|
|
|
92
|
-
`bin/athanor` resolves `../
|
|
97
|
+
`bin/athanor` resolves `../dist/index.js` (the compiled entry), so the binary only works after a build. Pick one:
|
|
93
98
|
|
|
94
99
|
| Mode | Setup | Invocation |
|
|
95
100
|
|---|---|---|
|
|
@@ -101,10 +106,10 @@ Linked mode does not auto-rebuild. Re-run `npm run build` after pulling changes
|
|
|
101
106
|
|
|
102
107
|
### External binaries
|
|
103
108
|
|
|
104
|
-
Run `athanor doctor` first — it prints presence, installed versions, and paths for each dependency
|
|
109
|
+
Run `athanor doctor` first — it prints presence, installed versions, and paths for each dependency. When you specifically need to check staleness, run `athanor doctor --check-updates` as well:
|
|
105
110
|
|
|
106
111
|
- `mlx_lm.server` — required for MLX text models. `uv tool install mlx-lm` (or `pipx install mlx-lm`).
|
|
107
|
-
- `mlx_vlm.server` — optional, for vision MLX models. `uv tool install mlx-vlm --with torch --with torchvision`. The torch/torchvision extras are
|
|
112
|
+
- `mlx_vlm.server` — optional, for vision MLX models. `uv tool install mlx-vlm --with torch --with torchvision`. The torch/torchvision extras are required: `mlx-vlm` itself doesn't depend on them, but the `transformers` VLM processors it imports do, so installing `mlx-vlm` alone passes `athanor doctor` and then fails at request time with `Qwen3VLVideoProcessor requires the PyTorch library but it was not found in your environment`. Equivalent forms: `pipx install mlx-vlm && pipx inject mlx-vlm torch torchvision`, or `pip install -U mlx-vlm torch torchvision` in an active venv.
|
|
108
113
|
- `llama-server` — optional, for GGUF models. `brew install llama.cpp` or build from source.
|
|
109
114
|
- `hf` — required for `athanor pull`. `uv tool install huggingface_hub --with hf_transfer` (or `pip install -U huggingface_hub[cli]`).
|
|
110
115
|
|
|
@@ -138,7 +143,7 @@ Quantization reading:
|
|
|
138
143
|
- **MLX:** prefer `mlx-community/*` — they carry the right conversion manifest. Suffix `-4bit` is the default; `-6bit` / `-8bit` cost ~1.5×/2× disk and memory for modest quality gains; `-bf16` is rarely worth it for serving on a Mac.
|
|
139
144
|
- **GGUF:** `Q4_K_M` is the balanced default, `Q5_K_M` / `Q6_K` trade size for quality, `Q8_0` is near-lossless but large. Avoid `Q2_*` and `Q3_*` except on tight memory.
|
|
140
145
|
|
|
141
|
-
After pull, `athanor show <slug>` shows detected capabilities, resolved launch command, and merged preset. For MLX entries where `caps` includes `vlm`, only flip `athanor flavor <slug> vlm` if the user actually needs image input — most VLM repos serve text fine under `mlx_lm.server` without the torch install (see invariant #
|
|
146
|
+
After pull, `athanor show <slug>` shows detected capabilities, resolved launch command, and merged preset. For MLX entries where `caps` includes `vlm`, only flip `athanor flavor <slug> vlm` if the user actually needs image input — most VLM repos serve text fine under `mlx_lm.server` without the torch install (see invariant #7).
|
|
142
147
|
|
|
143
148
|
### Running a model
|
|
144
149
|
|
|
@@ -173,8 +178,9 @@ To make a running model available to `pi-agent` downstream, `athanor expose <slu
|
|
|
173
178
|
| Path | Purpose |
|
|
174
179
|
|---|---|
|
|
175
180
|
| `~/.athanor/config.json` | user config: scan roots, port range, supervisor policy, control API |
|
|
176
|
-
| `~/.athanor/models.json` | registry —
|
|
181
|
+
| `~/.athanor/models.json` | registry — storage for slugs, ports, formulas, publish state |
|
|
177
182
|
| `~/.athanor/formulas.json` | optional user formulas; overrides built-ins of the same name (with auto-migration from legacy `recipes.json`) |
|
|
183
|
+
| `~/.athanor/telemetry.json` | persistent generation telemetry history (tok/s, prompt eval, latency) |
|
|
178
184
|
| `~/.athanor/logs/<slug>-<pid>.log` | per-run supervisor log |
|
|
179
185
|
| `~/.athanor/state.json` | running PIDs / ports for reattach (see `src/supervisor/state.ts`) |
|
|
180
186
|
| `~/.pi/agent/models.json` | pi-agent providers; athanor namespace only |
|
|
@@ -185,15 +191,15 @@ To make a running model available to `pi-agent` downstream, `athanor expose <slu
|
|
|
185
191
|
|
|
186
192
|
- TypeScript strict; no `any` unless unavoidable. Prefer `unknown` at boundaries and narrow.
|
|
187
193
|
- Functions named after what they do, not how. Side-effecting helpers end in verbs (`ingestDiscovered`, `updateModel`, `syncPi`).
|
|
188
|
-
-
|
|
194
|
+
- Keep comments concise. Do not annotate obvious code or explain the rationale for a change inside a comment — that belongs in the PR.
|
|
189
195
|
- No new files unless necessary. Prefer editing an existing module. Especially: do not create new top-level docs (`*.md`) without being asked.
|
|
190
|
-
-
|
|
196
|
+
- Format command output clearly. Tables go through `format.ts`. Errors exit non-zero with a one-line message plus, when useful, a hint on the next line.
|
|
191
197
|
|
|
192
198
|
## Roadmap
|
|
193
199
|
|
|
194
200
|
### Router — completed capabilities
|
|
195
201
|
|
|
196
|
-
The router in `src/router/server.ts` is live (see invariant #4 and
|
|
202
|
+
The router in `src/router/server.ts` is live (see invariant #4, `README.md`, and `docs/architecture.md`). Headless mode (`athanor router` subcommand), in-flight stream safety (`src/supervisor/inflight.ts` + `supervisor.stop()` drain before SIGTERM, bounded by `config.router.drainTimeoutMs`), and live token accounting via passthrough Transform (`SSETokenCounter` feeding `src/supervisor/metrics.ts` `updateLiveRouterStats` and consumed by CLI/TUI) are all complete.
|
|
197
203
|
|
|
198
204
|
## License
|
|
199
205
|
|
package/README.md
CHANGED
|
@@ -1,769 +1,170 @@
|
|
|
1
1
|
# athanor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A local LLM workbench for Apple Silicon. Discover, run, configure, and switch between MLX and `llama.cpp` (GGUF) models from a TUI or CLI, while keeping an OpenAI-compatible HTTP ingress active for tools like [pi-agent](https://github.com/badlogic/pi-mono).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- **Discovers** MLX models in your HuggingFace cache and GGUF files in `~/.models`.
|
|
8
|
-
- **Downloads** new models from HuggingFace via the `hf` CLI.
|
|
9
|
-
- **Runs** them via `mlx_lm.server` or `llama-server`, one or more at a time, each on a stable port.
|
|
10
|
-
- **Supervises** the processes as detached children with per-process log files and automatic reattach.
|
|
11
|
-
- **Publishes** exposed models to pi-agent (`~/.pi/agent/models.json`) — by default via ingress-backed `athanor-mlx` / `athanor-llama` aggregators — leaving your other (cloud, Ollama, etc.) providers alone.
|
|
12
|
-
- **Exposes** an optional local control API so other tools can ask athanor to activate a model on demand.
|
|
13
|
-
|
|
14
|
-
## Prerequisites
|
|
15
|
-
|
|
16
|
-
- macOS on Apple Silicon
|
|
17
|
-
- Node.js ≥ 18
|
|
18
|
-
- `mlx_lm.server` (from [`mlx-lm`](https://github.com/ml-explore/mlx-lm)) — text-only MLX models
|
|
19
|
-
- `mlx_vlm.server` (from [`mlx-vlm`](https://github.com/Blaizzy/mlx-vlm)) — vision/multimodal MLX models; optional if you never run VLMs
|
|
20
|
-
- `llama-server` (from [`llama.cpp`](https://github.com/ggml-org/llama.cpp))
|
|
21
|
-
- `hf` (from [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/guides/cli)) — only required for `athanor pull`
|
|
22
|
-
|
|
23
|
-
Run `athanor doctor` at any point to verify all four are on your `PATH`.
|
|
24
|
-
|
|
25
|
-
## Agent-assisted setup
|
|
26
|
-
|
|
27
|
-
If you use an AI coding agent (Claude Code, Cursor, Aider, etc.), the fastest path is to open this repo in the agent and ask it to set athanor up for you. `AGENTS.md` has an **Onboarding a user** section written for that case: it tells the agent how to install the CLI (`npm start` vs `npm link`), run `athanor doctor`, install any missing runtime binaries, profile the host (Apple Silicon check, unified memory via `vm_stat`, HF cache size), and pick a starter model sized for the machine.
|
|
5
|
+
---
|
|
28
6
|
|
|
29
|
-
|
|
7
|
+
## What It Does
|
|
30
8
|
|
|
31
|
-
|
|
9
|
+
- **Unified Runtimes**: Runs Apple MLX (`mlx_lm.server`, `mlx_vlm.server`) and GGUF (`llama-server`) models with Metal acceleration.
|
|
10
|
+
- **Zero Daemon**: No persistent background service. Runtimes run as detached child processes bound to stable ports that persist across restarts.
|
|
11
|
+
- **OpenAI-Compatible Ingress**: Single-port reverse proxy (`http://127.0.0.1:40879/v1`) with on-demand model activation and stream-drain safety.
|
|
12
|
+
- **Pi-Agent Integration**: Synchronizes exposed models to `~/.pi/agent/models.json` via aggregator providers (`athanor-mlx` and `athanor-llama`) while leaving non-athanor providers (OpenAI, Anthropic, Ollama, etc.) untouched.
|
|
13
|
+
- **Terminal UI & Scriptable CLI**: Switch models, tail logs, adjust formulas, and monitor token throughput from an Ink TUI or CLI.
|
|
32
14
|
|
|
33
|
-
|
|
15
|
+
---
|
|
34
16
|
|
|
35
|
-
##
|
|
17
|
+
## Quick Install
|
|
36
18
|
|
|
37
|
-
|
|
19
|
+
### Prerequisites
|
|
38
20
|
|
|
39
|
-
|
|
21
|
+
- **Hardware**: macOS on Apple Silicon (M1/M2/M3/M4)
|
|
22
|
+
- **Runtime**: Node.js ≥ 22
|
|
23
|
+
- **External Binaries**: `mlx_lm.server`, `llama-server`, `hf`
|
|
40
24
|
|
|
41
|
-
|
|
25
|
+
### 1-Minute Setup
|
|
42
26
|
|
|
43
27
|
```bash
|
|
44
|
-
#
|
|
45
|
-
brew install uv
|
|
28
|
+
# Install external runtimes
|
|
29
|
+
brew install uv llama.cpp
|
|
46
30
|
uv tool install mlx-lm
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
# or with pipx
|
|
50
|
-
brew install pipx
|
|
51
|
-
pipx install mlx-lm
|
|
52
|
-
|
|
53
|
-
# or with a plain venv
|
|
54
|
-
python3 -m venv ~/.venvs/mlx && source ~/.venvs/mlx/bin/activate
|
|
55
|
-
pip install -U mlx-lm
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Verify:
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
mlx_lm.server --help
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
MLX requires Apple Silicon and macOS 13.5+. Models are downloaded to `~/.cache/huggingface/hub` on first use.
|
|
65
|
-
|
|
66
|
-
### mlx-vlm (MLX vision/multimodal runtime)
|
|
67
|
-
|
|
68
|
-
Required only if you flip a model to `mlxFlavor: "vlm"` to feed it actual image input. Athanor defaults every MLX entry to `mlx_lm.server`, which handles text-only chat for most VLM-tagged repos (Qwen2-VL, Qwen2.5-VL, Qwen3-VL, LLaVA, etc.) without torch. Only install this when you actually need vision — and then opt in per model with `athanor flavor <slug> vlm`.
|
|
69
|
-
|
|
70
|
-
`mlx_vlm.server` imports `transformers`' VLM processors, which in turn import PyTorch and Torchvision. Installing `mlx-vlm` alone is not enough; `torch` and `torchvision` must be present in the same environment. With `uv`:
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
uv tool install mlx-vlm --with torch --with torchvision
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Or with pipx:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
pipx install mlx-vlm
|
|
80
|
-
pipx inject mlx-vlm torch torchvision
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Or with pip into the same venv you used for mlx-lm:
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
pip install -U mlx-vlm torch torchvision
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Verify:
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
mlx_vlm.server --help
|
|
93
|
-
python3 -c "import torch, torchvision; print(torch.__version__, torchvision.__version__)"
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
If `mlx_vlm.server` starts but a request fails with `Qwen3VLVideoProcessor requires the PyTorch library` (or similar), torch/torchvision are missing or installed into a different interpreter than `mlx_vlm.server` is using. Re-run the install above into the right environment.
|
|
97
|
-
|
|
98
|
-
### llama.cpp (GGUF runtime)
|
|
99
|
-
|
|
100
|
-
The easiest path on macOS is Homebrew — the bottle is built with Metal enabled, so GPU acceleration works out of the box:
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
brew install llama.cpp
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
You can also build from source if you want a specific revision or custom flags:
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
git clone https://github.com/ggml-org/llama.cpp
|
|
110
|
-
cd llama.cpp
|
|
111
|
-
cmake -B build
|
|
112
|
-
cmake --build build --config Release -j
|
|
113
|
-
# copy or symlink build/bin/llama-server onto your PATH
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Verify:
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
llama-server --help
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### hf (HuggingFace CLI — only for `athanor pull`)
|
|
123
|
-
|
|
124
|
-
Needed only if you want athanor to download new models from the Hub. Skip if you'll populate `~/.cache/huggingface/hub` by other means (e.g. `mlx_lm.server --model <repo>` auto-downloads on first use).
|
|
125
|
-
|
|
126
|
-
The Hugging Face Hub team has replaced the legacy `huggingface-cli` command with a new CLI called `hf`. Athanor invokes `hf download`. The recommended install path is the standalone installer, which drops a self-contained `hf` binary onto your `PATH` without touching system Python:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
curl -LsSf https://hf.co/cli/install.sh | bash
|
|
130
|
-
```
|
|
31
|
+
uv tool install huggingface_hub
|
|
131
32
|
|
|
132
|
-
|
|
33
|
+
# Clone and install athanor
|
|
34
|
+
git clone https://github.com/MylesBorins/athanor.git
|
|
35
|
+
cd athanor
|
|
36
|
+
npm install && npm run build && npm link
|
|
133
37
|
|
|
134
|
-
|
|
135
|
-
# Homebrew
|
|
136
|
-
brew install hf
|
|
137
|
-
|
|
138
|
-
# via uvx — runs the latest release on demand, no install step
|
|
139
|
-
uvx hf --help
|
|
140
|
-
|
|
141
|
-
# via pip (the `hf` entry point ships with huggingface_hub ≥ 0.34)
|
|
142
|
-
pip install -U huggingface_hub
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Verify:
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
hf --help
|
|
149
|
-
# optional: log in if you need access to gated/private repos
|
|
150
|
-
hf auth login
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
### Final check
|
|
154
|
-
|
|
155
|
-
```bash
|
|
38
|
+
# Verify dependencies
|
|
156
39
|
athanor doctor
|
|
157
|
-
# mlx_lm.server: /Users/you/.local/bin/mlx_lm.server version 0.31.3 (uv)
|
|
158
|
-
# mlx_vlm.server: /Users/you/.local/bin/mlx_vlm.server version 0.4.4 (uv)
|
|
159
|
-
# llama-server: /opt/homebrew/bin/llama-server version 9010 (brew)
|
|
160
|
-
# hf: /Users/you/.local/bin/hf version 1.13.0 (uv)
|
|
161
|
-
|
|
162
|
-
athanor doctor --check-updates
|
|
163
|
-
# ... latest <version> up to date
|
|
164
|
-
# ... or latest <version> update available
|
|
165
|
-
# ... hint uv tool upgrade <tool>
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
## Quick start
|
|
169
|
-
|
|
170
|
-
### Fastest path
|
|
171
|
-
|
|
172
|
-
If you want one working local text model quickly on a typical 16 GB+ Apple Silicon Mac:
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
npm install
|
|
176
|
-
npm start -- doctor
|
|
177
|
-
npm start -- pull mlx-community/Qwen3.5-9B-MLX-4bit
|
|
178
|
-
npm start -- start qwen3-5-9b-mlx-4bit
|
|
179
|
-
npm start -- expose qwen3-5-9b-mlx-4bit
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
Then in pi-agent, select provider `athanor-mlx-qwen3-5-9b-mlx-4bit` and model `mlx-community/Qwen3.5-9B-MLX-4bit`.
|
|
183
|
-
|
|
184
|
-
If you only want text chat, you do **not** need `mlx_vlm.server`; `mlx_lm.server` is enough even for many VLM-tagged repos when used as text-only models.
|
|
185
|
-
|
|
186
|
-
### Full quick start
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
npm install
|
|
190
|
-
|
|
191
|
-
# verify external runtime binaries are on PATH
|
|
192
|
-
npm start -- doctor
|
|
193
|
-
|
|
194
|
-
# one-time: ingest whatever's already on disk
|
|
195
|
-
npm start -- scan
|
|
196
|
-
|
|
197
|
-
# see what's in the registry — if empty, this prints curated
|
|
198
|
-
# starter models with reviewed 8 / 16 / 32 GB memory tiers and task tags
|
|
199
|
-
# that you can copy the `athanor pull ...` line from
|
|
200
|
-
npm start -- ls
|
|
201
|
-
|
|
202
|
-
# pull one and start it (by slug)
|
|
203
|
-
npm start -- pull mlx-community/Qwen3.5-9B-MLX-4bit
|
|
204
|
-
npm start -- start qwen3-5-9b-mlx-4bit
|
|
205
|
-
|
|
206
|
-
# or drop into the TUI (no args) — the empty state has the same
|
|
207
|
-
# suggestions with memory tiers/task tags and pulls them inline when you press Enter
|
|
208
|
-
npm start
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
`npm start` runs the app via `tsx`, so no build step is needed for development. For a live development loop, use:
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
npm run dev
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
That runs a small custom watcher (`scripts/dev-watch.mjs`) which watches only `src/**/*.ts` and `src/**/*.tsx`, then respawns `tsx src/index.tsx` with `ATHANOR_DEV_TUI=1`. This avoids `tsx watch`'s stdin/restart behavior, which can interfere with Ink/TUI key handling in tmux. In this dev mode athanor still starts the real ingress path (router when needed, control API if enabled) so pi-agent integration behaves like the normal app, but it skips the alt-screen/cursor toggles to make UI iteration safer in split panes. The TUI also collapses to compact/minimal layouts in short or narrow terminals so model selection stays usable in tmux splits. Router-driven model switches are reflected in the TUI by polling persisted live instance state, not only the local process's in-memory supervisor map. For one-shot runs without the dev safeguards, keep using `npm start`.
|
|
218
|
-
|
|
219
|
-
If you want a compiled build or to install the `athanor` binary globally:
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
npm run build # emit dist/
|
|
223
|
-
npm link # expose `athanor` on PATH
|
|
224
|
-
athanor ls # now usable directly
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
`bin/athanor` imports `dist/index.js`, so `npm link` requires a prior `npm run build`. Linked mode does not auto-rebuild; re-run the build after pulling changes or stay on `npm start` for the dev loop.
|
|
228
|
-
|
|
229
|
-
## Concepts
|
|
230
|
-
|
|
231
|
-
### Registry
|
|
232
|
-
|
|
233
|
-
`~/.athanor/models.json` is the source of truth. Every model has:
|
|
234
|
-
|
|
235
|
-
| field | purpose |
|
|
236
|
-
| ----------- | ------------------------------------------------------------- |
|
|
237
|
-
| `id` | stable canonical id (HF repo, repo+file, or `local:…`) |
|
|
238
|
-
| `slug` | short user-editable handle (`qwen-32b`) |
|
|
239
|
-
| `path` | on-disk location athanor passes to the runtime |
|
|
240
|
-
| `runtime` | `mlx` or `llama.cpp` |
|
|
241
|
-
| `source` | `{ type: "hf", repo, [revision], [file] }` or `{ type: "local" }` |
|
|
242
|
-
| `port` | **stable** port allocated once per model, never changes |
|
|
243
|
-
| `formula` | per-model overrides that merge on top of global runtime config |
|
|
244
|
-
| `mlxFlavor` | `"lm"` or `"vlm"` — picks which MLX binary to use (MLX only) |
|
|
245
|
-
| `publish` | whether pi-agent sees this model |
|
|
246
|
-
| `piAlias` | optional llama launch alias; when set to something other than `slug`, overrides the default runtime model id |
|
|
247
|
-
| `tags` | free-form labels (`chat`, `coder`, …) |
|
|
248
|
-
|
|
249
|
-
### Stable per-model ports
|
|
250
|
-
|
|
251
|
-
Each model is bound to a port at first ingest and keeps it forever. This means pi-agent's catalog is configured **once per model**; switching which model is active does not change pi's URLs, only the `status` field athanor writes into each entry.
|
|
252
|
-
|
|
253
|
-
Port range is configurable (`portRange` in `~/.athanor/config.json`, default 40880–40979).
|
|
254
|
-
|
|
255
|
-
On load, athanor collapses duplicate registry rows that share the same normalized on-disk path (keeping the HF-sourced entry when present) and upgrades local GGUF paths under `org--repo/` directories to HF source metadata when possible.
|
|
256
|
-
|
|
257
|
-
### MLX capabilities and flavor routing
|
|
258
|
-
|
|
259
|
-
MLX entries track two independent axes:
|
|
260
|
-
|
|
261
|
-
- `mlxCapabilities` — *what the model advertises*. Detected from the snapshot's `config.json` at scan and pull time, primarily by looking for a `vision_config` block, with fallbacks for known VLM `model_type` values (`qwen2_vl`, `qwen2_5_vl`, `llava*`, `mllama`, `pixtral`, `idefics2/3`, `phi3_v`) and architecture-name patterns such as `Qwen2VLForConditionalGeneration`. Today the only capability is `"vlm"`. Capabilities are refreshed on every scan.
|
|
262
|
-
- `mlxFlavor` — *which server binary to launch*. `"lm"` routes to `mlx_lm.server` (the default, no torch/torchvision required); `"vlm"` routes to `mlx_vlm.server` (requires torch + torchvision; needed for actual image input). Never set automatically — you choose with `athanor flavor <slug> lm|vlm`.
|
|
263
|
-
|
|
264
|
-
The split is deliberate: many VLM-tagged repos (e.g. Qwen2.5-VL, Qwen3-VL-MLX) run fine as text-only under `mlx_lm.server`, which is lighter, faster to load, and doesn't need a PyTorch install. Auto-routing every VLM-capable repo to `mlx_vlm.server` would silently break text-only workflows whenever torch isn't available. So athanor defaults everything to `lm` and leaves the upgrade to you.
|
|
265
|
-
|
|
266
|
-
In `athanor ls` and `athanor show`, entries with `mlxFlavor: "vlm"` display `mlx-vlm` in the runtime column; `athanor show` also prints a `caps` row and, for vision-capable entries still on `lm`, a hint pointing at `athanor flavor <slug> vlm`. In the TUI model list, hub-backed entries show the HF repo as the primary label with the slug dimmed after it; local entries show the slug only. In pi-agent, VLM-flavored entries render as `[mlx-vlm] <repo> (athanor)`; the provider id stays `athanor-mlx-<slug>` regardless of flavor, so pi URLs don't churn if a model's flavor is toggled later.
|
|
267
|
-
|
|
268
|
-
### Supervisor and policies
|
|
269
|
-
|
|
270
|
-
The runtime supervisor manages N concurrent child processes. Three policies:
|
|
271
|
-
|
|
272
|
-
- `single-active` (default) — starting a model stops any others.
|
|
273
|
-
- `multi-active-lru` — keep up to `supervisor.maxConcurrent` running; evict the least-recently-started.
|
|
274
|
-
- `manual` — never auto-stop; you decide.
|
|
275
|
-
|
|
276
|
-
Children are started with `detached: true`, stdio redirected to `~/.athanor/logs/<slug>-<pid>.log`, and `unref()`ed so the CLI/TUI can exit without killing them. On next launch athanor reattaches via PID.
|
|
277
|
-
|
|
278
|
-
Readiness is detected by polling the runtime's health endpoint (`/health` for llama.cpp, `/v1/models` for mlx_lm.server), not by matching stdout strings.
|
|
279
|
-
|
|
280
|
-
### Observability
|
|
281
|
-
|
|
282
|
-
The TUI banner shows a second line with system CPU and RAM bars plus the 1-minute load average, refreshed once a second. Each running row in the model list gets a compact suffix `CPU% · RSS · tok/s` (e.g. `340% · 4.2G · 22.5 tok/s`). The CLI mirrors this: `athanor status` adds CPU, RSS, and tok/s columns for every running instance.
|
|
283
|
-
|
|
284
|
-
Caveats worth knowing:
|
|
285
|
-
|
|
286
|
-
- **CPU% is per-core, not per-machine**, matching `ps` and Activity Monitor. A runtime using 8 cores reads as ~800%. Divide by `os.cpus().length` yourself if you want a whole-machine number.
|
|
287
|
-
- **RSS is resident set size**, not reserved allocation. On Apple Silicon's unified memory this is the honest "how much of my RAM is this model currently pinning" number.
|
|
288
|
-
- **tok/s is post-request, not live.** Athanor does not sit in the request path — clients connect directly to each runtime's port. The number is parsed from the per-completion timing line the runtime already writes to its log (`eval time = … tokens per second` for llama.cpp, `Generation: … tokens, … tokens-per-sec` for mlx_lm / mlx_vlm), and updates once a generation finishes. While a request is streaming, the most recent completed request's rate is shown. If no completion has happened yet, the column is blank.
|
|
289
|
-
- Sampling is best-effort — if `ps` fails, the log format changes, or timing lines are not yet present, the affected column is hidden rather than showing a wrong number.
|
|
290
|
-
|
|
291
|
-
### Pi-agent sync
|
|
292
|
-
|
|
293
|
-
Athanor publishes into pi-agent's [custom providers](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/models.md) system. On every state change it rewrites `~/.pi/agent/models.json`.
|
|
294
|
-
|
|
295
|
-
**Default shape (ingress on):** pi sees up to two aggregator providers — `athanor-mlx` and `athanor-llama` — both pointing at the ingress port (`127.0.0.1:40879/v1` by default). Each lists only exposed models of that runtime. See [Ingress](#ingress) for lifecycle and request routing.
|
|
296
|
-
|
|
297
|
-
**Direct shape (`router.enabled: false`):** each exposed model becomes **its own pi provider** named `athanor-<runtime>-<slug>` (e.g. `athanor-mlx-qwen3-32b`), with `baseUrl` pointing at that model's stable port. One provider per model is required because a pi provider has exactly one `baseUrl` and each athanor model runs on its own port.
|
|
298
|
-
|
|
299
|
-
Common rules for both shapes:
|
|
300
|
-
|
|
301
|
-
- Providers whose name does **not** start with `athanor-` are preserved untouched — your OpenAI, Anthropic, Ollama, OpenRouter, etc. entries are safe.
|
|
302
|
-
- Each athanor provider uses `api: "openai-completions"`, a placeholder `apiKey: "athanor"`, and runtime-appropriate `compat` flags.
|
|
303
|
-
- pi's `/model` picker lists models by **`id`**, not `name`. The `name` field is advisory detail text. Athanor sets both so they stay aligned with what each runtime was launched with:
|
|
304
|
-
- **MLX HF-sourced models** — launched with `--model <repo>`; pi `id` is that repo string.
|
|
305
|
-
- **MLX local models** — launched with `--model <path>`; pi `id` is that path.
|
|
306
|
-
- **llama.cpp HF GGUF** — launched with `--alias <registry-id>` where the id is `author/repo:file.gguf`; pi `id` matches. This keeps hub source visible in pi the same way MLX repos are. Slug and canonical id remain valid request aliases via the ingress resolver.
|
|
307
|
-
- **llama.cpp local / custom alias** — launched with `--alias <piAlias|slug>` when you've set an explicit `piAlias` different from `slug`; pi `id` is that alias.
|
|
308
|
-
- Hub-backed entries use `[runtime] <repo> (athanor)` for the pi `name` field regardless of runtime.
|
|
309
|
-
- `~/.pi/agent/settings.json` is only touched when an athanor model is started as the active default.
|
|
310
|
-
|
|
311
|
-
Example aggregator model entry (llama GGUF, HF-sourced):
|
|
312
|
-
|
|
313
|
-
```json
|
|
314
|
-
{
|
|
315
|
-
"id": "unsloth/Qwen3.6-27B-GGUF:Qwen3.6-27B-Q4_K_M.gguf",
|
|
316
|
-
"name": "[llama.cpp] unsloth/Qwen3.6-27B-GGUF (athanor)",
|
|
317
|
-
"input": ["text"],
|
|
318
|
-
"contextWindow": 32768
|
|
319
|
-
}
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
Example direct provider (MLX, HF-sourced):
|
|
323
|
-
|
|
324
|
-
```json
|
|
325
|
-
{
|
|
326
|
-
"providers": {
|
|
327
|
-
"athanor-mlx-qwen3-32b": {
|
|
328
|
-
"baseUrl": "http://127.0.0.1:40880/v1",
|
|
329
|
-
"api": "openai-completions",
|
|
330
|
-
"apiKey": "athanor",
|
|
331
|
-
"compat": {
|
|
332
|
-
"supportsDeveloperRole": false,
|
|
333
|
-
"supportsReasoningEffort": false
|
|
334
|
-
},
|
|
335
|
-
"models": [
|
|
336
|
-
{
|
|
337
|
-
"id": "mlx-community/Qwen3-32B-4bit",
|
|
338
|
-
"name": "[mlx] mlx-community/Qwen3-32B-4bit (athanor)",
|
|
339
|
-
"input": ["text"],
|
|
340
|
-
"contextWindow": 32768
|
|
341
|
-
}
|
|
342
|
-
]
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
After upgrading athanor or changing runtime ids, run `athanor sync` and **restart** affected llama models so `--alias` matches what pi expects. pi reloads `models.json` when you open `/model`.
|
|
349
|
-
|
|
350
|
-
Disable athanor's sync entirely with `"enablePiSync": false` in `~/.athanor/config.json`.
|
|
351
|
-
|
|
352
|
-
## CLI reference
|
|
353
|
-
|
|
354
|
-
```
|
|
355
|
-
athanor launch the TUI
|
|
356
|
-
athanor scan rescan model dirs and update registry
|
|
357
|
-
athanor ls list registry entries (with live status)
|
|
358
|
-
athanor status list running instances
|
|
359
|
-
athanor show <id|slug> inspect a model: runtime, effective config, launch command
|
|
360
|
-
athanor snippet <id|slug> generate OpenAI API and pi-agent integration code snippets
|
|
361
|
-
athanor start <id|slug> [-y|--yes]
|
|
362
|
-
start a model (bypassing confirmation with -y)
|
|
363
|
-
athanor stop [<id|slug>|--all]
|
|
364
|
-
stop one or all
|
|
365
|
-
athanor restart <id|slug> [-y|--yes]
|
|
366
|
-
stop + start (bypassing confirmation with -y)
|
|
367
|
-
athanor logs <id|slug> [-n N] tail last N lines of a running model's log
|
|
368
|
-
athanor pull <repo> [--file F] [--revision R]
|
|
369
|
-
download from HuggingFace and register
|
|
370
|
-
athanor search [q] [--mlx|--gguf|--any] [--author A] [--sort S] [--limit N]
|
|
371
|
-
search the HuggingFace Hub
|
|
372
|
-
athanor trending [--mlx|--gguf] [--limit N]
|
|
373
|
-
top trending MLX/GGUF models
|
|
374
|
-
athanor formula [show|set|unset|clear|apply|save] [<slug>] [k=v...]
|
|
375
|
-
view or modify a model's formula (accepts either slug-first or subcommand-first)
|
|
376
|
-
athanor formulas [delete <name>] list or manage formulas in library
|
|
377
|
-
athanor flavor <slug> lm|vlm force MLX runtime flavor (lm = mlx_lm, vlm = mlx_vlm)
|
|
378
|
-
athanor expose <id|slug> include in pi-agent catalog
|
|
379
|
-
athanor hide <id|slug> remove from pi-agent catalog
|
|
380
|
-
athanor rm <id|slug> remove from registry (must be stopped)
|
|
381
|
-
athanor sync manually rewrite pi catalog
|
|
382
|
-
athanor router [--host H] [--port P] [--verbose]
|
|
383
|
-
run the ingress server in the foreground
|
|
384
|
-
athanor config print resolved config and its path
|
|
385
|
-
athanor doctor check that required binaries are on PATH and show installed versions
|
|
386
|
-
athanor doctor --check-updates also compare installed versions with latest available and print upgrade hints
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
`<id|slug>` accepts either the canonical id or the short slug.
|
|
390
|
-
|
|
391
|
-
## TUI key bindings
|
|
392
|
-
|
|
393
|
-
| key | action |
|
|
394
|
-
| ---------- | --------------------------------------------------- |
|
|
395
|
-
| `↑` / `↓` / wheel | move selection (one entry per wheel notch) |
|
|
396
|
-
| `⏎` | start (if idle) / stop (if running) the highlighted model |
|
|
397
|
-
| `r` | restart the highlighted model |
|
|
398
|
-
| `k` | kill the highlighted model |
|
|
399
|
-
| `P` | toggle pi-agent visibility (expose/hide) |
|
|
400
|
-
| `d` | remove the highlighted entry from the registry |
|
|
401
|
-
| `D` | open the downloads modal |
|
|
402
|
-
| `s` | rescan and ingest new models (automatic on start and when the HF cache changes) |
|
|
403
|
-
| `p` | open the pull modal (`esc` cancels in progress) |
|
|
404
|
-
| `e` | open the formula editor for the highlighted model |
|
|
405
|
-
| `t` | open the telemetry modal for the highlighted model |
|
|
406
|
-
| `/` | filter the list by substring of slug or id |
|
|
407
|
-
| `tab` | hide the model selector and expand the log pane; press again to restore |
|
|
408
|
-
| `q` | quit (does **not** stop running models) |
|
|
409
|
-
|
|
410
|
-
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.
|
|
411
|
-
|
|
412
|
-
With the selector hidden (`tab`), the log pane grows to fill the space and the arrow keys switch roles:
|
|
413
|
-
|
|
414
|
-
| key | action |
|
|
415
|
-
| --------------------- | ---------------------------------------------------- |
|
|
416
|
-
| mouse wheel | scroll the log (3 lines per notch) |
|
|
417
|
-
| `↑` / `↓` | scroll the log one line at a time |
|
|
418
|
-
| `PgUp` / `PgDn` | scroll by half a page |
|
|
419
|
-
| `g` / `Home` | jump to the top of the buffer |
|
|
420
|
-
| `G` / `End` | jump back to the tail (resumes live follow) |
|
|
421
|
-
|
|
422
|
-
When scrolled up, the header shows `+N ↑ paused` and the log stops auto-updating until you return to the tail. All other keys (`r`, `k`, `⏎`, `tab`) still act on the model you had selected before hiding the list.
|
|
423
|
-
|
|
424
|
-
Mouse reporting is enabled only while the TUI is running (SGR mode, `\x1b[?1000h\x1b[?1006h`) and disabled on exit, including on uncaught exceptions and `SIGTERM`/`SIGHUP`. While it's active, click-and-drag text selection in some terminals (iTerm2, Terminal.app) requires holding `⌥`/`Alt`; copy-on-select typically still works. If the process is killed with `SIGKILL`, nothing can reset the terminal — run `reset` or relaunch the TUI to restore it.
|
|
425
|
-
|
|
426
|
-
The bottom pane continuously tails the log file of whichever model is highlighted. When any model enters the running set — whether you started it, restarted it, or the router auto-started it on an incoming request — the cursor jumps to it so its logs appear immediately; if an active filter hides the newcomer, the filter is cleared.
|
|
427
|
-
|
|
428
|
-
Press `tab` for a full-screen log view that shows model details (id, runtime, port, path), live instance telemetry (pid, uptime, CPU, RSS, tok/s), and a larger log tail. It honors the same cursor-follows-active behavior, so a router-driven model swap auto-switches the view to the new active model. `tab` again returns to the split list+log layout.
|
|
429
|
-
|
|
430
|
-
Models downloaded out-of-band (`hf download` in another terminal, or pulled while the TUI was closed) are picked up automatically: every TUI start runs a scan, and while the TUI is running an `fs.watch` on `modelDirs.mlx` / `modelDirs.llama` debounces cache changes into an incremental `ingestDiscovered` call. New entries toast in the footer as `+N new: <slug>…`. Pressing `s` still works as an explicit rescan.
|
|
431
|
-
|
|
432
|
-
## Configuration
|
|
433
|
-
|
|
434
|
-
`~/.athanor/config.json`. Missing fields fall back to these defaults:
|
|
435
|
-
|
|
436
|
-
```json
|
|
437
|
-
{
|
|
438
|
-
"portRange": { "min": 40880, "max": 40979 },
|
|
439
|
-
"enablePiSync": true,
|
|
440
|
-
"modelDirs": {
|
|
441
|
-
"mlx": "~/.cache/huggingface/hub",
|
|
442
|
-
"llama": "~/.models"
|
|
443
|
-
},
|
|
444
|
-
"mlx": {
|
|
445
|
-
"prefillStepSize": 512,
|
|
446
|
-
"promptCacheSize": 32768,
|
|
447
|
-
"decodeConcurrency": 1
|
|
448
|
-
},
|
|
449
|
-
"llama": {
|
|
450
|
-
"nGpuLayers": 999,
|
|
451
|
-
"threads": 8,
|
|
452
|
-
"ctxSize": 32768,
|
|
453
|
-
"batchSize": 512,
|
|
454
|
-
"ubatchSize": 256,
|
|
455
|
-
"parallel": 1
|
|
456
|
-
},
|
|
457
|
-
"supervisor": {
|
|
458
|
-
"policy": "single-active",
|
|
459
|
-
"maxConcurrent": 1,
|
|
460
|
-
"startupTimeoutMs": 120000,
|
|
461
|
-
"healthPollIntervalMs": 500
|
|
462
|
-
},
|
|
463
|
-
"controlApi": {
|
|
464
|
-
"enabled": false,
|
|
465
|
-
"port": 40878,
|
|
466
|
-
"host": "127.0.0.1"
|
|
467
|
-
},
|
|
468
|
-
"router": {
|
|
469
|
-
"enabled": true,
|
|
470
|
-
"port": 40879,
|
|
471
|
-
"host": "127.0.0.1",
|
|
472
|
-
"drainTimeoutMs": 30000,
|
|
473
|
-
"verbose": false
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
```
|
|
477
|
-
|
|
478
|
-
### Per-model formulas
|
|
479
|
-
|
|
480
|
-
`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):
|
|
481
|
-
|
|
482
|
-
```bash
|
|
483
|
-
# inspect effective config, launch command, and running state
|
|
484
|
-
athanor show qwen-32b
|
|
485
|
-
|
|
486
|
-
# set / unset individual fields — kebab-case and camelCase both work
|
|
487
|
-
athanor formula qwen-32b set ctx-size=32768 nGpuLayers=48
|
|
488
|
-
athanor formula qwen-32b unset ctx-size
|
|
489
|
-
athanor formula qwen-32b clear
|
|
490
|
-
|
|
491
|
-
# apply a named formula for the model's runtime
|
|
492
|
-
athanor formula qwen-32b apply thinking
|
|
493
|
-
|
|
494
|
-
# save a model's current formula tuning as a reusable custom formula
|
|
495
|
-
athanor formula qwen-32b save my-reasoning-formula
|
|
496
|
-
|
|
497
|
-
# list built-in + user formulas and every tunable key per runtime
|
|
498
|
-
athanor formulas
|
|
499
|
-
|
|
500
|
-
# delete a custom formula from your library
|
|
501
|
-
athanor formulas delete my-reasoning-formula
|
|
502
40
|
```
|
|
503
41
|
|
|
504
|
-
*(
|
|
505
|
-
|
|
506
|
-
Built-in formulas: `balanced`, `fast`, `long-context`, `q8-kv`, `thinking`, `instruct`, `mtp`.
|
|
507
|
-
|
|
508
|
-
- `balanced` — recommended default, 64K context
|
|
509
|
-
- `fast` — lower latency, 8K context
|
|
510
|
-
- `long-context` — 128K context for large documents (with Q8_0 KV cache on both MLX and llama.cpp)
|
|
511
|
-
- `q8-kv` — Q8_0 KV cache quantization for reduced memory footprint across both MLX and llama.cpp
|
|
512
|
-
- `thinking` — reasoning model sampling (temp=1.0, topP=0.95, topK=20)
|
|
513
|
-
- `instruct` — standard instruct sampling (temp=0.7, topP=0.80, presencePenalty=1.5)
|
|
514
|
-
- `mtp` — Multi-Token Prediction speculative decoding (requires an MTP-capable GGUF model)
|
|
515
|
-
|
|
516
|
-
`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.
|
|
517
|
-
|
|
518
|
-
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]`.
|
|
519
|
-
|
|
520
|
-
Under the hood, a formula looks like this in `~/.athanor/models.json` — you can edit it directly if you prefer:
|
|
521
|
-
|
|
522
|
-
```json
|
|
523
|
-
{
|
|
524
|
-
"id": "mlx-community/Qwen2.5-32B-Instruct-4bit",
|
|
525
|
-
"slug": "qwen-32b",
|
|
526
|
-
"formula": {
|
|
527
|
-
"runtime": "mlx",
|
|
528
|
-
"mlx": { "decodeConcurrency": 1, "prefillStepSize": 512, "promptCacheSize": 32768 }
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
```
|
|
532
|
-
|
|
533
|
-
Restart the model for the formula to take effect.
|
|
534
|
-
|
|
535
|
-
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.
|
|
536
|
-
|
|
537
|
-
### KV Cache Quantization & Flash Attention (llama.cpp only)
|
|
538
|
-
|
|
539
|
-
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.
|
|
540
|
-
|
|
541
|
-
Quantizing the KV cache to `q8_0` (or `q4_0`) roughly halves the KV cache memory while preserving reasoning accuracy:
|
|
542
|
-
|
|
543
|
-
```bash
|
|
544
|
-
# Halve KV cache size with Q8_0 quantization and enable Flash Attention
|
|
545
|
-
athanor preset qwen-27b set cache-type-k=q8_0 cache-type-v=q8_0 flash-attn=on
|
|
546
|
-
|
|
547
|
-
# Or apply the built-in q8-kv recipe
|
|
548
|
-
athanor preset qwen-27b apply q8-kv
|
|
549
|
-
```
|
|
42
|
+
*(For detailed setup options including `pipx`, dedicated virtual environments, and MLX vision dependencies, see the [Setup Guide](docs/setup.md)).*
|
|
550
43
|
|
|
551
|
-
|
|
552
|
-
- `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`)
|
|
553
|
-
- `cache-type-v` / `cacheTypeV` / `ctv` — KV cache value data type (`f16`, `q8_0`, `q4_0`, etc.)
|
|
554
|
-
- `cache-ram` / `cacheRam` / `cram` — maximum prompt cache memory in MiB (`llama.cpp` defaults to 8192; 2048–4096 recommended on 36 GB Macs to avoid swap thrashing on long jobs)
|
|
555
|
-
- `flash-attn` / `flashAttn` / `fa` — Flash Attention mode (`on`, `off`, `auto`). Required when using quantized KV cache in `llama.cpp`.
|
|
556
|
-
- `spec-draft-type-k` / `specDraftCacheTypeK` / `ctkd` — Draft model KV cache key data type
|
|
557
|
-
- `spec-draft-type-v` / `specDraftCacheTypeV` / `ctvd` — Draft model KV cache value data type
|
|
558
|
-
|
|
559
|
-
### Speculative Decoding & MTP (llama.cpp only)
|
|
560
|
-
|
|
561
|
-
Recent builds of `llama.cpp` support speculative decoding and Multi-Token Prediction (MTP) draft decoding. This can speed up token generation by 1.5–2× on Apple Silicon.
|
|
562
|
-
|
|
563
|
-
Configure these parameters on a GGUF model via a preset:
|
|
564
|
-
|
|
565
|
-
```bash
|
|
566
|
-
# Example 1: Multi-Token Prediction (MTP) for models with built-in draft heads
|
|
567
|
-
# (MTP draft heads are baked into the model weights, so spec-draft-model is NOT required)
|
|
568
|
-
athanor preset deepseek-coder set spec-type=draft-mtp spec-draft-ngl=32
|
|
569
|
-
|
|
570
|
-
# Example 2: Traditional speculative decoding using a separate small draft model
|
|
571
|
-
athanor preset llama-3 set spec-type=draft spec-draft-model=~/.models/llama-3-draft.gguf spec-draft-ngl=32
|
|
572
|
-
```
|
|
573
|
-
|
|
574
|
-
Available keys:
|
|
575
|
-
- `spec-type` / `specType` — Speculative decoding type (`draft-mtp`, `draft`, `draft-simple`, `ngram-simple`, etc.)
|
|
576
|
-
- `spec-draft-model` / `specDraftModel` — Path/repo/file of the separate draft model (not required for `draft-mtp`)
|
|
577
|
-
- `spec-draft-ngl` / `specDraftNgl` / `ngl-draft` — Number of draft model GPU layers to offload to Metal (highly recommended on Apple Silicon so draft evaluation runs on GPU)
|
|
578
|
-
- `spec-draft-n-max` / `specDraftNMax` — Max tokens to draft per step (default: 3)
|
|
579
|
-
- `spec-draft-n-min` / `specDraftNMin` — Min tokens to draft per step
|
|
580
|
-
- `spec-draft-p-min` / `specDraftPMin` — Min draft confidence threshold (default: 0.00)
|
|
581
|
-
- `spec-draft-p-split` / `specDraftPSplit` — Split probability (default: 0.10)
|
|
582
|
-
|
|
583
|
-
Athanor performs cross-field validation on these settings during `athanor show <slug>` and alerts you of potential issues (e.g., if you configure draft options without a `spec-type`, or if you specify a draft model for `draft-mtp` where it is ignored).
|
|
584
|
-
|
|
585
|
-
### Reasoning Effort (llama.cpp only)
|
|
586
|
-
|
|
587
|
-
Models with thinking/reasoning templates (e.g. Qwen3.8-27B) consume a `reasoning_effort` parameter (`xhigh`, `medium`, `low`). Stock templates default to `xhigh`, which can lead to expensive 20+ minute generations and 20,000+ reasoning tokens.
|
|
588
|
-
|
|
589
|
-
Athanor provides first-class, model-validated reasoning effort support:
|
|
590
|
-
|
|
591
|
-
```bash
|
|
592
|
-
# Set reasoning effort via formula
|
|
593
|
-
athanor formula qwen3.8-27b set reasoning-effort=medium
|
|
594
|
-
|
|
595
|
-
# Or using aliases: reasoningEffort, reasoning_effort, effort
|
|
596
|
-
athanor formula qwen3.8-27b set effort=low
|
|
597
|
-
```
|
|
598
|
-
|
|
599
|
-
Features:
|
|
600
|
-
- **Write-time validation:** Rejects invalid effort strings or attempts to configure reasoning effort on unsupported models before modifying processes.
|
|
601
|
-
- **Enforced safe default:** When registering models whose templates default to `xhigh`, Athanor automatically sets a formula default of `medium`.
|
|
602
|
-
- **Dynamic proxy handling:** Injects the model's formula default on chat completions when omitted by the client, validates client-supplied overrides against the model's allowed enum (returning 400 Bad Request if invalid), and strips reasoning effort for unsupported models to prevent template crashes in `llama-server`.
|
|
603
|
-
- **TUI integration:** The Preset Editor includes a compound knob for Reasoning Effort on supported models.
|
|
604
|
-
|
|
605
|
-
### Environment variables
|
|
606
|
-
|
|
607
|
-
- `ATHANOR_HOME` — overrides `~/.athanor`. Useful for running multiple profiles side by side or for tests.
|
|
608
|
-
- `PI_HOME` — overrides `~/.pi`.
|
|
44
|
+
---
|
|
609
45
|
|
|
610
|
-
##
|
|
46
|
+
## Quick Start
|
|
611
47
|
|
|
612
|
-
|
|
48
|
+
### 1. Using the CLI
|
|
613
49
|
|
|
614
50
|
```bash
|
|
615
|
-
#
|
|
616
|
-
athanor
|
|
51
|
+
# 1. Download a starter model from Hugging Face
|
|
52
|
+
athanor pull mlx-community/Qwen3.5-9B-MLX-4bit
|
|
617
53
|
|
|
618
|
-
#
|
|
619
|
-
athanor
|
|
620
|
-
athanor search llama --gguf
|
|
54
|
+
# 2. Start the model (binds to its stable port and activates the ingress proxy)
|
|
55
|
+
athanor start qwen3-5-9b-mlx-4bit
|
|
621
56
|
|
|
622
|
-
#
|
|
623
|
-
athanor
|
|
624
|
-
athanor search --author bartowski --gguf --sort likes
|
|
57
|
+
# 3. Expose to pi-agent
|
|
58
|
+
athanor expose qwen3-5-9b-mlx-4bit
|
|
625
59
|
|
|
626
|
-
#
|
|
627
|
-
athanor
|
|
628
|
-
athanor trending --mlx --limit 15
|
|
60
|
+
# 4. Inspect status and generation metrics
|
|
61
|
+
athanor status
|
|
629
62
|
```
|
|
630
63
|
|
|
631
|
-
|
|
64
|
+
In **pi-agent**, select provider **`athanor-mlx`** and model **`mlx-community/Qwen3.5-9B-MLX-4bit`**.
|
|
632
65
|
|
|
633
|
-
|
|
66
|
+
### 2. Using the Interactive TUI
|
|
634
67
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
```
|
|
638
|
-
→ athanor pull <repo> # MLX: downloads the whole repo
|
|
639
|
-
→ athanor pull <repo> --file F.gguf # GGUF: pick one file
|
|
640
|
-
```
|
|
641
|
-
|
|
642
|
-
## HuggingFace pull
|
|
68
|
+
Launch athanor without arguments to enter the TUI:
|
|
643
69
|
|
|
644
70
|
```bash
|
|
645
|
-
athanor
|
|
646
|
-
athanor pull bartowski/Meta-Llama-3.1-8B-Instruct-GGUF \
|
|
647
|
-
--file Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf
|
|
71
|
+
athanor
|
|
648
72
|
```
|
|
649
73
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
1. `GET https://huggingface.co/api/models/<repo>` is used to list siblings and decide runtime.
|
|
653
|
-
- any `.gguf` sibling → `llama.cpp` (you must specify `--file` if more than one exists)
|
|
654
|
-
- `tags: ["mlx"]` or `mlx` in the repo id → `mlx`
|
|
655
|
-
- `.safetensors` only, nothing matching MLX → fallback to `mlx`
|
|
656
|
-
2. `hf download` is invoked, output streamed.
|
|
657
|
-
3. On success, a registry entry is created with `publish: true`, a fresh port from `portRange`, and `piAlias: slug`.
|
|
658
|
-
|
|
659
|
-
Cancellation is safe: press `Ctrl-C` during `athanor pull` (or `Esc` in the TUI pull modal) and athanor SIGTERMs the `hf` child — escalating to SIGKILL after 3s if it ignores the signal — and exits with code 130. No registry entry is written on abort, so you can re-run the same `pull` later without cleanup.
|
|
660
|
-
|
|
74
|
+
Press `Enter` to start/stop the highlighted model, `p` to pull new models, `e` to tune parameters, or `tab` to inspect full-screen streaming logs.
|
|
661
75
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
When `controlApi.enabled` is `true`, athanor exposes a small local HTTP server (default `127.0.0.1:40878`) that other tools can drive:
|
|
665
|
-
|
|
666
|
-
```
|
|
667
|
-
GET /status running instances + registry summary
|
|
668
|
-
POST /activate { "id": "<id|slug>" } start a model (respects supervisor policy)
|
|
669
|
-
POST /deactivate { "id": "<id|slug>" } stop a model
|
|
670
|
-
```
|
|
671
|
-
|
|
672
|
-
This is off by default. Enable it only on trusted machines.
|
|
673
|
-
|
|
674
|
-
## Ingress
|
|
675
|
-
|
|
676
|
-
Athanor exposes an OpenAI-compatible ingress (default `127.0.0.1:40879`) that fronts every exposed model on a single port. Pi-agent sees up to **two** providers — `athanor-mlx` and `athanor-llama` — both pointing at that ingress, each listing only models of its runtime. The split exists because pi's per-provider compat flags differ between engines (mlx_lm/vlm don't accept the `developer` role; llama-server does), and it also makes it obvious in pi's `/model` picker which backend is serving a given request. Switching models inside pi becomes a normal "different `model` field in the request body" swap, and athanor starts the target on demand (respecting supervisor policy) before proxying the request.
|
|
677
|
-
|
|
678
|
-
Ingress lifecycle follows active model serving state rather than the foreground TUI. When athanor is open it ensures ingress availability; when active models remain after the UI exits, the detached ingress companion stays up; when the last model stops, the detached ingress companion stops too. This lets you start a model, close the TUI, and keep pi-agent connectivity until you stop or switch models. Reopening the TUI later reattaches to the same detached runtime/ingress state and reflects ingress-driven model switches from persisted instance state.
|
|
679
|
-
|
|
680
|
-
```
|
|
681
|
-
GET /health 200 OK
|
|
682
|
-
GET /v1/models synthesised list of exposed models
|
|
683
|
-
POST /v1/chat/completions { "model": ... } activate + proxy (SSE streamed through)
|
|
684
|
-
POST /v1/completions { "model": ... } same
|
|
685
|
-
POST /v1/embeddings { "model": ... } same
|
|
686
|
-
```
|
|
687
|
-
|
|
688
|
-
The ingress config lives under `router` in `~/.athanor/config.json` for backward compatibility:
|
|
689
|
-
|
|
690
|
-
```json
|
|
691
|
-
{ "router": { "enabled": true, "port": 40879, "host": "127.0.0.1", "drainTimeoutMs": 30000, "verbose": false } }
|
|
692
|
-
```
|
|
693
|
-
|
|
694
|
-
By default, pi sync emits the ingress-backed aggregator providers (not per-model providers). If you've exposed only MLX models you'll see `athanor-mlx` alone; only GGUF, just `athanor-llama`. The `model` field in requests may be the runtime model id (HF repo for MLX; registry `author/repo:file.gguf` for hub GGUF; custom `piAlias` or slug for local llama), the athanor slug, or the canonical registry id; all resolve. Unknown models return `404`.
|
|
76
|
+
---
|
|
695
77
|
|
|
696
|
-
|
|
78
|
+
## CLI Reference
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
athanor launch the interactive TUI
|
|
82
|
+
athanor scan re-scan model dirs and update registry
|
|
83
|
+
athanor ls list registry entries with live status
|
|
84
|
+
athanor status list running instances with CPU, RSS, and tok/s
|
|
85
|
+
athanor show <id|slug> inspect a model's config and resolved launch command
|
|
86
|
+
athanor snippet <id|slug> generate integration snippets (curl, OpenAI SDK, pi)
|
|
87
|
+
athanor start <id|slug> [-y] start a model (bypassing confirmation with -y)
|
|
88
|
+
athanor stop [<id|slug>|--all] stop one or all running models
|
|
89
|
+
athanor restart <id|slug> [-y] stop + start a model
|
|
90
|
+
athanor logs <id|slug> [-n N] tail last N lines of a model's log
|
|
91
|
+
athanor pull <repo> [--file F] download from Hugging Face and register
|
|
92
|
+
athanor search [q] [--mlx|--gguf] search Hugging Face Hub
|
|
93
|
+
athanor trending [--mlx|--gguf] view trending models on Hugging Face
|
|
94
|
+
athanor formula <slug> ... tune launch flags (set, unset, clear, apply, save)
|
|
95
|
+
athanor formulas [delete <name>] list or manage custom formulas in library
|
|
96
|
+
athanor flavor <slug> lm|vlm switch MLX runtime flavor (lm = text, vlm = vision)
|
|
97
|
+
athanor expose <id|slug> include model in pi-agent catalog
|
|
98
|
+
athanor hide <id|slug> remove model from pi-agent catalog
|
|
99
|
+
athanor rm <id|slug> remove model from registry (must be stopped)
|
|
100
|
+
athanor sync manually rewrite pi-agent catalog
|
|
101
|
+
athanor router [--port P] run the ingress server in the foreground
|
|
102
|
+
athanor config print resolved configuration and file paths
|
|
103
|
+
athanor doctor [--check-updates] verify required binaries and check for updates
|
|
104
|
+
athanor telemetry [<slug>|clear] view historical generation throughput and metrics
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`<id|slug>` accepts either the canonical repository ID or the short model slug.
|
|
697
108
|
|
|
698
|
-
|
|
699
|
-
athanor router # uses config.router.host / .port
|
|
700
|
-
athanor router --port 9000 # override
|
|
701
|
-
athanor router --host 0.0.0.0 --port 40879
|
|
702
|
-
athanor router --verbose # log every request to ~/.athanor/logs/router.log
|
|
703
|
-
```
|
|
704
|
-
|
|
705
|
-
The subcommand ignores `router.enabled` — invoking it is itself the opt-in — but it still respects `127.0.0.1` as the default host.
|
|
109
|
+
---
|
|
706
110
|
|
|
707
|
-
|
|
111
|
+
## TUI Keybindings
|
|
112
|
+
|
|
113
|
+
| Key | Action |
|
|
114
|
+
|---|---|
|
|
115
|
+
| `↑` / `↓` / Wheel | Move highlighted selection |
|
|
116
|
+
| `⏎` (Enter) | Start (if idle) or stop (if running) the highlighted model |
|
|
117
|
+
| `r` | Restart highlighted model |
|
|
118
|
+
| `k` | Force kill highlighted model process |
|
|
119
|
+
| `P` | Toggle pi-agent visibility (`expose` / `hide`) |
|
|
120
|
+
| `d` | Remove entry from registry (must be stopped) |
|
|
121
|
+
| `D` | Open Downloads modal |
|
|
122
|
+
| `s` | Rescan models from cache |
|
|
123
|
+
| `p` | Open Pull modal to download a model |
|
|
124
|
+
| `e` | Open Formula Editor to adjust runtime parameters |
|
|
125
|
+
| `t` | Open Telemetry modal |
|
|
126
|
+
| `/` | Filter model list by text |
|
|
127
|
+
| `tab` | Toggle full-screen log viewer mode |
|
|
128
|
+
| `q` | Quit TUI (running models remain active in background) |
|
|
708
129
|
|
|
709
|
-
|
|
130
|
+
---
|
|
710
131
|
|
|
711
|
-
|
|
132
|
+
## Documentation Guides
|
|
712
133
|
|
|
713
|
-
-
|
|
714
|
-
- **In-flight safety.** `athanor stop` on a currently-streaming model waits briefly (up to `router.drainTimeoutMs`, default 30s) for open proxied streams to finish before SIGTERM; past that, the runtime is terminated and in-flight responses are cut.
|
|
715
|
-
- **Listen posture.** Same as the control API: `127.0.0.1` only, no auth.
|
|
134
|
+
Deep-dive documentation is available in the [`docs/`](docs/) directory:
|
|
716
135
|
|
|
717
|
-
|
|
136
|
+
- 🛠️ **[Setup & Installation Guide](docs/setup.md)**: Detailed runtime installation (`uv`, `pipx`, venvs), PyTorch extras for MLX vision models, building `llama.cpp` from source, and update checking.
|
|
137
|
+
- 🧪 **[Formulas & Model Tuning](docs/formulas.md)**: Customizing runtime flags, built-in formulas (`balanced`, `thinking`, `fast`, etc.), Quantized KV Cache (`q8_0`), Flash Attention, Speculative Decoding / MTP, and Reasoning Effort.
|
|
138
|
+
- 🏛️ **[Architecture & Ingress](docs/architecture.md)**: OpenAI-compatible ingress proxy, aggregator providers for pi-agent, stable per-model port allocation, detached supervisor lifecycle, and full `config.json` reference.
|
|
139
|
+
- 🖥️ **[Terminal User Interface (TUI)](docs/tui.md)**: Screen layout, interactive modal dialogs (Downloads, Formulas, Telemetry), log scrolling, mouse support, and tmux dev workflow.
|
|
140
|
+
- 🔍 **[Troubleshooting Guide](docs/troubleshooting.md)**: Fixing port conflicts, startup timeouts, missing PyTorch for VLMs, and pi-agent catalog synchronization.
|
|
718
141
|
|
|
719
|
-
|
|
720
|
-
- **`port already in use`.** Another process is on the model's stable port. Either stop it, or edit the entry's `port` in `~/.athanor/models.json` and restart.
|
|
721
|
-
- **Pi-agent can't see a new model.** Make sure it's exposed (CLI: `athanor expose <slug>`) and run `athanor sync`. Confirm `~/.pi/agent/models.json` contains the expected athanor provider shape (per-model when `router.enabled` is false, `athanor-mlx` / `athanor-llama` aggregators when true — the default), then open `/model` in pi (the file reloads on open). If you upgraded athanor and llama model ids changed, restart the model after syncing.
|
|
722
|
-
- **Models from other tools disappeared from pi.** They shouldn't — athanor only rewrites providers whose name starts with `athanor-`. If this happens, open an issue with the before/after of `~/.pi/agent/models.json`.
|
|
723
|
-
- **Stale PID / router state.** If a child or detached router crashed without athanor noticing, reopening athanor or running `athanor sync` / `athanor status` will reconcile persisted state and clear dead router metadata opportunistically. If a model port is still held, run `athanor stop <slug>` (a no-op when nothing is live) then `athanor start <slug>`.
|
|
724
|
-
- **`doctor` reports a missing binary.** Install `mlx_lm`, `mlx_vlm`, `llama.cpp`, or `huggingface_hub`, or adjust your shell's `PATH`. `mlx_vlm.server` is only needed if you plan to run VLM models; `athanor start` on a VLM entry will fail with a clear error if it's missing.
|
|
725
|
-
- **`doctor --check-updates` reports `update available`.** Follow the printed one-line hint. Today the built-in hints cover uv-managed Python tools (`uv tool upgrade mlx-lm`, `uv tool upgrade mlx-vlm`, `uv tool upgrade hf`) and Homebrew's `llama.cpp` formula (`brew upgrade llama.cpp`).
|
|
142
|
+
---
|
|
726
143
|
|
|
727
144
|
## Development
|
|
728
145
|
|
|
729
146
|
```bash
|
|
730
147
|
npm install
|
|
731
148
|
npx tsc --noEmit # typecheck
|
|
732
|
-
npm test # lint + vitest
|
|
733
|
-
npm run test:watch # vitest
|
|
734
|
-
npm run build #
|
|
149
|
+
npm test # lint + vitest test suite
|
|
150
|
+
npm run test:watch # vitest in watch mode
|
|
151
|
+
npm run build # compile typescript to dist/
|
|
152
|
+
npm run dev # live development loop with TUI dev watcher
|
|
735
153
|
```
|
|
736
154
|
|
|
737
|
-
Tests
|
|
155
|
+
Tests run in an isolated environment by redirecting `ATHANOR_HOME` and `PI_HOME` to temporary directories via `test/setup.ts`, ensuring your local configuration is never touched.
|
|
738
156
|
|
|
739
|
-
|
|
157
|
+
---
|
|
740
158
|
|
|
741
|
-
```
|
|
742
|
-
src/
|
|
743
|
-
adapters/ # mlx (lm + vlm) + llama.cpp command builders, health probes, runtime model ids
|
|
744
|
-
cli/ # hand-rolled CLI dispatcher, doctor, output formatting
|
|
745
|
-
config/ # config file load + defaults
|
|
746
|
-
control/ # optional HTTP control API (off by default)
|
|
747
|
-
discovery/ # HF cache scanner + registry ingest (MLX capability detection lives here)
|
|
748
|
-
presets/ # preset merge, tunable-key metadata, recipes
|
|
749
|
-
pull/ # HuggingFace repo inspection and download
|
|
750
|
-
registry/ # models.json CRUD, slug + port allocation, dedup, display labels
|
|
751
|
-
search/ # HuggingFace Hub search + trending
|
|
752
|
-
supervisor/ # detached process lifecycle, policy, reattach
|
|
753
|
-
sync/ # namespaced pi-agent catalog merge
|
|
754
|
-
ui/ # Ink TUI (list, pull modal, preset editor)
|
|
755
|
-
types/ # shared types
|
|
756
|
-
```
|
|
757
159
|
## Credits and Acknowledgements
|
|
758
160
|
|
|
759
|
-
Parts of
|
|
760
|
-
|
|
761
|
-
-
|
|
762
|
-
-
|
|
763
|
-
-
|
|
764
|
-
- **Developer Snippets Command**: The `athanor snippet` command templates for client integration (`src/cli/snippet-commands.ts`).
|
|
161
|
+
Parts of athanor's hardware profiling, context VRAM estimation equations, and developer features were inspired by and adapted from the open-source project [whichllm](https://github.com/Andyyyy64/whichllm) under the MIT License:
|
|
162
|
+
- Memory bandwidth mapping from Apple Silicon chip brand strings (`src/machine/profile.ts`).
|
|
163
|
+
- Context-aware VRAM calculations and MoE active parameter scaling (`src/registry/recommend.ts`).
|
|
164
|
+
- Search synthesis for MLX/GGUF repository variants (`src/search/hf.ts`).
|
|
165
|
+
- Developer integration snippet generation (`src/cli/snippet-commands.ts`).
|
|
765
166
|
|
|
766
|
-
We thank `@Andyyyy64` and the `whichllm` contributors for their excellent research
|
|
167
|
+
We thank `@Andyyyy64` and the `whichllm` contributors for their excellent research.
|
|
767
168
|
|
|
768
169
|
---
|
|
769
170
|
|
|
@@ -771,4 +172,4 @@ We thank `@Andyyyy64` and the `whichllm` contributors for their excellent resear
|
|
|
771
172
|
|
|
772
173
|
Copyright 2026 Myles Borins.
|
|
773
174
|
|
|
774
|
-
Licensed under the Apache License, Version 2.0. See [`LICENSE`](./LICENSE) for
|
|
175
|
+
Licensed under the Apache License, Version 2.0. See [`LICENSE`](./LICENSE) for details.
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
+
import { EventEmitter } from "events";
|
|
1
2
|
import type { ActiveInstance, ModelEntry } from "../types/index.js";
|
|
2
3
|
import { getAdapter } from "../adapters/index.js";
|
|
3
|
-
export
|
|
4
|
+
export interface SupervisorEventMap {
|
|
5
|
+
starting: (entry: ModelEntry) => void;
|
|
6
|
+
running: (instance: ActiveInstance) => void;
|
|
7
|
+
stopped: (id: string) => void;
|
|
8
|
+
exit: (id: string, code: number | null, signal: NodeJS.Signals | null) => void;
|
|
9
|
+
error: (id: string, error: Error) => void;
|
|
10
|
+
evicted: (evictedId: string, triggeringEntry: ModelEntry) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare class Supervisor extends EventEmitter {
|
|
4
13
|
private instances;
|
|
5
14
|
private readyPromise;
|
|
6
15
|
private pendingStarts;
|
|
7
16
|
private startAbortControllers;
|
|
8
17
|
constructor();
|
|
18
|
+
emit<K extends keyof SupervisorEventMap>(event: K, ...args: Parameters<SupervisorEventMap[K]>): boolean;
|
|
19
|
+
on<K extends keyof SupervisorEventMap>(event: K, listener: SupervisorEventMap[K]): this;
|
|
20
|
+
once<K extends keyof SupervisorEventMap>(event: K, listener: SupervisorEventMap[K]): this;
|
|
21
|
+
off<K extends keyof SupervisorEventMap>(event: K, listener: SupervisorEventMap[K]): this;
|
|
22
|
+
removeListener<K extends keyof SupervisorEventMap>(event: K, listener: SupervisorEventMap[K]): this;
|
|
9
23
|
ready(): Promise<void>;
|
|
10
24
|
private reattach;
|
|
11
25
|
private unmanagedInstanceError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/supervisor/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/supervisor/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAErC,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAmB,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAclE,MAAM,WAAW,kBAAkB;IAC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AKxF,cAAc,CAAC,CAAC,SAAS,MAAM,kBAAkB,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;IAKtG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3B;YAEa,QAAQ;IAWtB,OAAO,CAAC,sBAAsB;YAMhB,eAAe;YAWf,yBAAyB;IAiBvC,OAAO,CAAC,sBAAsB;IAiB9B,OAAO,CAAC,OAAO;IAIf,IAAI,IAAI,cAAc,EAAE,CAGvB;IAED,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAG1C;IAEK,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,CAqBtD;YAEa,aAAa;IA+GrB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAqCnE;IAEK,OAAO,CAAC,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAM1D;IAEK,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,CAIxD;YAEa,OAAO;CAWtB;AAED,eAAO,MAAM,UAAU,YAAmB,CAAA;AAE1C,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
package/dist/supervisor/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { spawn } from "child_process";
|
|
2
|
+
import { EventEmitter } from "events";
|
|
2
3
|
import * as fs from "fs";
|
|
3
4
|
import { buildCommandFor, getAdapter } from "../adapters/index.js";
|
|
4
5
|
import { waitForHealthy, probeHealth, probeRuntimeModelId } from "../adapters/health.js";
|
|
@@ -9,14 +10,33 @@ import { loadPersistedInstances, pidAlive, savePersistedInstances } from "./stat
|
|
|
9
10
|
import { listModels, touchModelLastUsed } from "../registry/index.js";
|
|
10
11
|
import { awaitIdle } from "./inflight.js";
|
|
11
12
|
import { recoverLiveInstances } from "./reconcile.js";
|
|
12
|
-
export class Supervisor {
|
|
13
|
+
export class Supervisor extends EventEmitter {
|
|
13
14
|
instances = new Map();
|
|
14
15
|
readyPromise;
|
|
15
16
|
pendingStarts = new Map();
|
|
16
17
|
startAbortControllers = new Map();
|
|
17
18
|
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
// Default no-op error handler prevents unhandled 'error' event exceptions
|
|
21
|
+
// when consumers haven't registered an explicit error listener.
|
|
22
|
+
this.on("error", () => { });
|
|
18
23
|
this.readyPromise = this.reattach();
|
|
19
24
|
}
|
|
25
|
+
emit(event, ...args) {
|
|
26
|
+
return super.emit(event, ...args);
|
|
27
|
+
}
|
|
28
|
+
on(event, listener) {
|
|
29
|
+
return super.on(event, listener);
|
|
30
|
+
}
|
|
31
|
+
once(event, listener) {
|
|
32
|
+
return super.once(event, listener);
|
|
33
|
+
}
|
|
34
|
+
off(event, listener) {
|
|
35
|
+
return super.off(event, listener);
|
|
36
|
+
}
|
|
37
|
+
removeListener(event, listener) {
|
|
38
|
+
return super.removeListener(event, listener);
|
|
39
|
+
}
|
|
20
40
|
async ready() {
|
|
21
41
|
await this.readyPromise;
|
|
22
42
|
}
|
|
@@ -113,11 +133,16 @@ export class Supervisor {
|
|
|
113
133
|
async startInternal(entry, abortSignal) {
|
|
114
134
|
const cfg = loadConfig();
|
|
115
135
|
const { stopBeforeStart } = decide(cfg.supervisor.policy, cfg.supervisor.maxConcurrent, this.list(), entry);
|
|
116
|
-
for (const id of stopBeforeStart)
|
|
136
|
+
for (const id of stopBeforeStart) {
|
|
137
|
+
this.emit("evicted", id, entry);
|
|
117
138
|
await this.stop(id);
|
|
139
|
+
}
|
|
118
140
|
if (await probeHealth(entry.runtime, entry.port, 500)) {
|
|
119
|
-
|
|
141
|
+
const err = new Error(`Port ${entry.port} already in use by another process; stop it or reassign the model's port.`);
|
|
142
|
+
this.emit("error", entry.id, err);
|
|
143
|
+
throw err;
|
|
120
144
|
}
|
|
145
|
+
this.emit("starting", entry);
|
|
121
146
|
const { cmd, args, env: adapterEnv } = buildCommandFor(entry);
|
|
122
147
|
const stdoutLog = openLogFile(entry.slug, process.pid);
|
|
123
148
|
try {
|
|
@@ -139,6 +164,9 @@ export class Supervisor {
|
|
|
139
164
|
throw new Error(`Failed to execute '${cmd}'${detail}`);
|
|
140
165
|
}
|
|
141
166
|
proc.unref();
|
|
167
|
+
proc.on("exit", (code, signal) => {
|
|
168
|
+
this.emit("exit", entry.id, code, signal);
|
|
169
|
+
});
|
|
142
170
|
const now = Date.now();
|
|
143
171
|
const instance = {
|
|
144
172
|
id: entry.id,
|
|
@@ -183,6 +211,7 @@ export class Supervisor {
|
|
|
183
211
|
instance.healthyAt = Date.now();
|
|
184
212
|
this.persist();
|
|
185
213
|
touchModelLastUsed(entry.id, Date.now());
|
|
214
|
+
this.emit("running", instance);
|
|
186
215
|
return instance;
|
|
187
216
|
}
|
|
188
217
|
catch (err) {
|
|
@@ -198,6 +227,8 @@ export class Supervisor {
|
|
|
198
227
|
fs.closeSync(stdoutLog.fd);
|
|
199
228
|
}
|
|
200
229
|
catch { /* already closed */ }
|
|
230
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
231
|
+
this.emit("error", entry.id, error);
|
|
201
232
|
throw err;
|
|
202
233
|
}
|
|
203
234
|
}
|
|
@@ -221,6 +252,7 @@ export class Supervisor {
|
|
|
221
252
|
}
|
|
222
253
|
this.instances.delete(id);
|
|
223
254
|
this.persist();
|
|
255
|
+
this.emit("stopped", id);
|
|
224
256
|
return true;
|
|
225
257
|
}
|
|
226
258
|
// Wait briefly for any router-proxied streams targeting this model
|
|
@@ -234,6 +266,7 @@ export class Supervisor {
|
|
|
234
266
|
await this.killPid(inst.pid);
|
|
235
267
|
this.instances.delete(id);
|
|
236
268
|
this.persist();
|
|
269
|
+
this.emit("stopped", id);
|
|
237
270
|
return true;
|
|
238
271
|
}
|
|
239
272
|
async stopAll(opts) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/supervisor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EACL,sBAAsB,EACtB,QAAQ,EACR,sBAAsB,EACvB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAErD,MAAM,OAAO,UAAU;IACb,SAAS,GAAG,IAAI,GAAG,EAA0B,CAAA;IAC7C,YAAY,CAAe;IAC3B,aAAa,GAAG,IAAI,GAAG,EAAmC,CAAA;IAC1D,qBAAqB,GAAG,IAAI,GAAG,EAA2B,CAAA;IAElE;QACE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;IACrC,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,YAAY,CAAA;IACzB,CAAC;IAEO,KAAK,CAAC,QAAQ;QACpB,MAAM,SAAS,GAAG,sBAAsB,EAAE,CAAA;QAC1C,MAAM,OAAO,GAAG,UAAU,EAAE,CAAA;QAC5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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "athanor",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Personal LLM alchemy for Apple Silicon: discover, run, and publish MLX and llama.cpp models",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"bin": {
|
|
17
17
|
"athanor": "./bin/athanor"
|
|
18
18
|
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=22"
|
|
21
|
+
},
|
|
19
22
|
"files": [
|
|
20
23
|
"dist",
|
|
21
24
|
"bin",
|