mlx-bun 0.0.7 → 0.0.9
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/README.md +112 -20
- package/docs/design/batching-v2-plan.md +515 -0
- package/docs/design/bucketing-stage.md +196 -0
- package/docs/design/compat-cli-surface-design.md +11 -11
- package/docs/design/diffusion-gemma-port.md +602 -0
- package/docs/design/docs-reorg-plan.md +1 -1
- package/docs/design/dreaming-nightly-pipeline.md +291 -0
- package/docs/design/dspark-speculative-decoding.md +106 -0
- package/docs/design/generic-model-support.md +381 -0
- package/docs/design/memory-inference-path.md +422 -0
- package/docs/design/memory-synthesis.md +287 -0
- package/docs/design/minicpm5-decode-megakernel.md +484 -0
- package/docs/design/mlx-lm-tool-parity-plan.md +535 -0
- package/docs/design/orpo-dynamic-lambda.md +41 -0
- package/docs/design/orpo-training.md +35 -5
- package/docs/design/parallel-slots.md +12 -1
- package/docs/design/parity-tier-dag.md +13 -5
- package/docs/design/spec-decode-larger-targets.md +229 -0
- package/docs/design/tauri-desktop-app.md +2 -2
- package/docs/design/the-dreaming-handoff.md +141 -0
- package/docs/design/the-dreaming-master-plan.md +446 -0
- package/docs/design/write-pipeline-entity.md +468 -0
- package/docs/investigations/curve-bisector-routing.md +1 -1
- package/docs/investigations/decode-roofline-lookagain.md +262 -0
- package/docs/investigations/dspark-handoff.md +58 -0
- package/docs/investigations/kernel-perf-review-2026-07.md +92 -0
- package/docs/planning/PRODUCT_ROADMAP.md +2 -2
- package/docs/planning/curve-sampler-research-plan.md +331 -0
- package/docs/planning/memory-docs-and-dag-plan.md +185 -0
- package/docs/planning/pi-integration-review.md +178 -0
- package/docs/planning/release-notes-v0.0.9.md +122 -0
- package/docs/planning/web-ui-pass-plan.md +213 -0
- package/docs/planning/website-readme-pass-plan.md +224 -0
- package/docs/reference/cli.md +255 -0
- package/docs/reference/embedding.md +7 -2
- package/docs/reference/library-api.md +22 -3
- package/docs/reference/memory.md +5 -5
- package/docs/reference/models.md +137 -0
- package/docs/reference/orpo-quickstart.md +6 -0
- package/docs/reference/server-api.md +187 -9
- package/docs/reference/server-config.md +40 -9
- package/docs/reference/training.md +25 -11
- package/package.json +1 -1
- package/src/anthropic.ts +22 -0
- package/src/assets/curve-designer.html +1 -1
- package/src/chat-template.ts +25 -7
- package/src/cli.ts +1029 -86
- package/src/config.ts +54 -3
- package/src/diffusion/diffusion-generate.ts +436 -0
- package/src/download.ts +99 -8
- package/src/embed.ts +77 -0
- package/src/eval/perplexity.ts +164 -0
- package/src/eval/runner.ts +19 -7
- package/src/eval/tasks/bfcl.ts +1 -1
- package/src/generate.ts +196 -19
- package/src/harness-pi.ts +43 -17
- package/src/index.ts +2 -0
- package/src/lora.ts +2 -2
- package/src/memory/article.ts +558 -0
- package/src/memory/chunk-validation.ts +150 -0
- package/src/memory/chunk.ts +305 -12
- package/src/memory/cluster.ts +344 -17
- package/src/memory/coverage.ts +134 -0
- package/src/memory/crosslink.ts +0 -0
- package/src/memory/db.ts +184 -45
- package/src/memory/entity.ts +203 -0
- package/src/memory/gate.ts +187 -0
- package/src/memory/history.ts +152 -0
- package/src/memory/ingest.ts +324 -11
- package/src/memory/model.ts +321 -0
- package/src/memory/normalize.ts +671 -0
- package/src/memory/parse.ts +22 -0
- package/src/memory/pipeline.ts +242 -30
- package/src/memory/prompts.ts +42 -0
- package/src/memory/query.ts +334 -0
- package/src/memory/reconcile.ts +734 -0
- package/src/memory/redirect.ts +108 -0
- package/src/memory/reindex.ts +325 -0
- package/src/memory/resolve.ts +307 -0
- package/src/memory/route.ts +272 -0
- package/src/memory/schedule.ts +6 -4
- package/src/memory/stages.ts +774 -0
- package/src/memory/synthesize.ts +1629 -20
- package/src/memory/tools.ts +446 -96
- package/src/memory/vault.ts +462 -35
- package/src/memory/wikify.ts +1057 -16
- package/src/mlx/ffi.ts +11 -0
- package/src/mlx/ops.ts +113 -0
- package/src/model/compiled-decode.ts +43 -8
- package/src/model/diffusion-gemma.ts +1026 -0
- package/src/model/factory.ts +35 -8
- package/src/model/flash-attention.ts +4 -2
- package/src/model/fused-decode-kernel.ts +14 -7
- package/src/model/fused-mlp-kernel.ts +169 -0
- package/src/model/fused-swiglu-kernel.ts +240 -0
- package/src/model/gemma4-base.ts +62 -6
- package/src/model/gemma4.ts +33 -2
- package/src/model/minicpm5.ts +106 -8
- package/src/model/qwen3.ts +276 -0
- package/src/model/steel-linear-kernel.ts +96 -0
- package/src/model/support.ts +45 -7
- package/src/model/universal/archs.ts +332 -0
- package/src/model/universal/dense.ts +576 -0
- package/src/model/universal/modules.ts +163 -0
- package/src/model/universal/rope.ts +366 -0
- package/src/pi-provider.ts +1 -1
- package/src/pi-terminal.ts +29 -8
- package/src/pi-web.ts +19 -2
- package/src/quantize/config-writer.ts +1 -1
- package/src/registry.ts +215 -7
- package/src/responses.ts +23 -0
- package/src/sampler.ts +220 -9
- package/src/serve/batch-scheduler.ts +272 -80
- package/src/serve/generation-gateway.ts +90 -18
- package/src/server.ts +643 -50
- package/src/spec/drafter.ts +81 -49
- package/src/spec/dspark/data-dflash.ts +156 -0
- package/src/spec/dspark/data.ts +201 -0
- package/src/spec/dspark/generate-dflash.ts +193 -0
- package/src/spec/dspark/generate.ts +290 -0
- package/src/spec/dspark/loss.ts +213 -0
- package/src/spec/dspark/module-dflash.ts +361 -0
- package/src/spec/dspark/module.ts +540 -0
- package/src/spec/dspark/sample.ts +112 -0
- package/src/spec/generate.ts +40 -19
- package/src/status-page.html +1 -1
- package/src/tokenizer.ts +7 -0
- package/src/train/diffusion-lora.ts +216 -0
- package/src/train/flash-cce.ts +70 -15
- package/src/train/fuse.ts +243 -0
- package/src/train/index.ts +3 -0
- package/src/train/job.ts +8 -0
- package/src/train/loss.ts +289 -30
- package/src/train/prefix-shared.ts +33 -5
- package/src/train/segmented.ts +67 -11
- package/src/train/trainer.ts +92 -28
- package/src/vision/diffusion-vision.ts +620 -0
- package/src/web/skills/memory/SKILL.md +40 -17
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Bucketing / Classify stage — local build plan
|
|
2
|
+
|
|
3
|
+
Status: **design**, 2026-06-26. Companion to [memory-synthesis.md](./memory-synthesis.md).
|
|
4
|
+
Grounded in a research+critique workflow over the real Lucien classify + the local
|
|
5
|
+
foundation; re-centered on the governing principle below.
|
|
6
|
+
|
|
7
|
+
## Governing principle — capacity by decomposition
|
|
8
|
+
|
|
9
|
+
**A small local model's effective capacity scales inversely with task size. You don't
|
|
10
|
+
make the model smarter; you make each task narrower.** Every stage is a *ladder of
|
|
11
|
+
atomic, single-purpose tasks*, each one a single clear question. The full pipeline:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
"what buckets should we have?" ← taxonomy (cold-start)
|
|
15
|
+
"which buckets need this chunk?" ← classify / assignment
|
|
16
|
+
"which section needs this info?" ← section routing
|
|
17
|
+
"integrate THIS chunk into THIS section" ← synthesis patch (most atomic)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
…and each rung decomposes *further* into the smallest decisive question. We never ask
|
|
21
|
+
the local model to "assign a chunk among 12 buckets and emit JSON" — that is still too
|
|
22
|
+
big. We ask **"does this chunk belong in bucket B? yes/no,"** one bucket at a time.
|
|
23
|
+
|
|
24
|
+
**Retrieval (embeddings, lexical) exists only to NARROW the candidate set so the model
|
|
25
|
+
makes the fewest, smallest, clearest calls. It never decides — the model decides, one
|
|
26
|
+
tiny question at a time.** This is the production home for the embedding work: a
|
|
27
|
+
candidate-narrower, not a classifier.
|
|
28
|
+
|
|
29
|
+
**Why brute-force decomposition is affordable: the model is LOCAL, so inference is ~free.**
|
|
30
|
+
A cloud model forces you to minimize calls (which is exactly why Lucien made one big
|
|
31
|
+
"reason over everything" call). A local model flips the economics — you can run **M×N tiny
|
|
32
|
+
binary checks** ("does chunk *i* belong in bucket *j*?" / "should chunk *i* update section
|
|
33
|
+
*j*?") where a cloud model would have to make one expensive combined decision. We trade one
|
|
34
|
+
big unreliable call for many tiny reliable ones. Local-ness is what makes radical
|
|
35
|
+
decomposition viable; retrieval just keeps M×N from getting silly.
|
|
36
|
+
|
|
37
|
+
This is adapting + improving Lucien, not duplicating it. Lucien put all 379 buckets in
|
|
38
|
+
Opus's context and let it reason globally in one shot — a capability a 1B model does not
|
|
39
|
+
have. We replace "one global decision" with "many tiny local decisions."
|
|
40
|
+
|
|
41
|
+
## What we keep from Lucien
|
|
42
|
+
|
|
43
|
+
- Classify on chunk **labels** (~49-char topic strings), not text or vectors.
|
|
44
|
+
- The `Bucketing.md` policy governs behavior, inlined into the task prompt — editing it
|
|
45
|
+
re-tunes routing with no code change.
|
|
46
|
+
- **Many-to-many** (a chunk → 0..3 buckets; empty is legal = the substance filter).
|
|
47
|
+
- **Create buckets by judgment** when nothing fits and the topic is substantive.
|
|
48
|
+
- **Existing-buckets-win** (re-scoped to global below — fix E).
|
|
49
|
+
- Idempotent set-difference resumption (`NOT IN chunk_buckets`).
|
|
50
|
+
|
|
51
|
+
## The bucketing stage, decomposed
|
|
52
|
+
|
|
53
|
+
### "which buckets need this chunk?" — assignment
|
|
54
|
+
|
|
55
|
+
For one chunk (its label):
|
|
56
|
+
1. **Narrow (no model):** embedding shortlist — cosine(label, bucket centroid) → top-K
|
|
57
|
+
candidates; PLUS a **lexical floor** (any bucket whose name token-overlaps the label)
|
|
58
|
+
so an embedding miss can't drop an obvious match [fix C].
|
|
59
|
+
2. **Decide (atomic model task, one per candidate):** *"Does this chunk — `<label>` —
|
|
60
|
+
belong in bucket `<name>: <description>`? Answer yes or no."* Run over the (few)
|
|
61
|
+
shortlisted candidates. No multi-item JSON, no batch indices → the JSON-fidelity and
|
|
62
|
+
batching failure modes (critique D) simply don't exist. A chunk can get "yes" on
|
|
63
|
+
several candidates (many-to-many falls out naturally) or none.
|
|
64
|
+
3. **New bucket (atomic task, only if every candidate was "no" AND substantive):**
|
|
65
|
+
*"This topic fits no existing bucket. Propose one Wikipedia-style bucket name (2–6
|
|
66
|
+
words) + one-line description, or answer NONE if too thin."* Then the **global gate
|
|
67
|
+
[fix E — the #1 correctness fix]:** re-embed the proposed name against the FULL bucket
|
|
68
|
+
centroid cache; if the nearest existing bucket clears a similarity threshold, downgrade
|
|
69
|
+
to it. This restores Lucien's "none of 379 fit" discipline that a shortlist-only view
|
|
70
|
+
would break (→ taxonomy explosion).
|
|
71
|
+
|
|
72
|
+
Each model call is a tiny yes/no or a single short proposal — the clear single tasks a
|
|
73
|
+
1B model can do reliably. Cost is more calls, but each is fast and reliable; embeddings
|
|
74
|
+
keep K small so it's bounded.
|
|
75
|
+
|
|
76
|
+
### "what buckets should we have?" — cold-start taxonomy (from zero)
|
|
77
|
+
|
|
78
|
+
There are **7308 distinct labels of 7316** — dedup collapses nothing, and a 1B model
|
|
79
|
+
cannot globally compress thousands of labels into a coherent 30–60-bucket taxonomy
|
|
80
|
+
(that is exactly Opus's global-reasoning ability). Decompose:
|
|
81
|
+
1. **Group (geometry, no model):** embed all labels → k-means (k∈[30,60], pick by
|
|
82
|
+
silhouette). The geometry does the grouping the model can't do globally.
|
|
83
|
+
2. **Purity-gate each group (atomic task) [fix B]:** *"Do these labels form ONE topic or
|
|
84
|
+
more than one?"* k-means optimizes cohesion and is blind to fusion (the ρ≈0.32 purity
|
|
85
|
+
blind spot we measured) — split any group the model flags before it becomes a bucket.
|
|
86
|
+
3. **Name each group (atomic task):** *"Here are ~15 representative labels. Give ONE
|
|
87
|
+
Wikipedia-style bucket name (2–6 words) + a one-line description. Be specific, not
|
|
88
|
+
generic."*
|
|
89
|
+
4. **Seed centroids from members [fix H]:** each new bucket's centroid = mean of the
|
|
90
|
+
cluster labels that birthed it (those vectors already exist) — so the first assignment
|
|
91
|
+
pass runs on strong member-based centroids, not weak name-only ones.
|
|
92
|
+
|
|
93
|
+
### later rungs (designed here, built after classify)
|
|
94
|
+
|
|
95
|
+
- **"which section needs this info?"** — the **M×N binary** pattern: for an article's
|
|
96
|
+
assigned bucket of *M* chunks and its *N* TOC sections, ask *"should chunk i update
|
|
97
|
+
section j? yes/no"* — M×N times. The "yes" pairs become atomic patches. A chunk that gets
|
|
98
|
+
**all "no" and is substantive → an atomic CREATE-NEW-SECTION task** (mirrors new-bucket).
|
|
99
|
+
(Embeddings can prune N, but with a local model you can also just run all M×N.)
|
|
100
|
+
- **"integrate THIS chunk into THIS section"** — the atomic synthesis patch (memory-synthesis.md),
|
|
101
|
+
applied to each (chunk, section) "yes" pair.
|
|
102
|
+
|
|
103
|
+
### The entities (distinct — do not conflate)
|
|
104
|
+
|
|
105
|
+
- **chunk** — one topical segment of a conversation (pointer + label).
|
|
106
|
+
- **bucket** — a single-topic GROUP OF CHUNKS (the classify output; the "Cameras and
|
|
107
|
+
Camera Gear" container you drop camera chunks into). **A bucket is NOT an article.**
|
|
108
|
+
- **article** — a synthesized wiki page. A bucket RELATES TO **one or more** articles
|
|
109
|
+
(many-to-many): the reflecting-pool-renovation bucket relates to the *Lincoln Memorial
|
|
110
|
+
Reflecting Pool* article AND a *Trump* article.
|
|
111
|
+
- **section** — a part of an article (its TOC entries).
|
|
112
|
+
|
|
113
|
+
### Hierarchical pruning (coarse gates fine)
|
|
114
|
+
|
|
115
|
+
Decompose top-down and **prune the subtree at every "no."** The levels are distinct:
|
|
116
|
+
chunk → bucket → article(s) → section(s). The coarse gate is **"does this bucket relate to
|
|
117
|
+
this article? yes/no"** — if no, skip *every* section of that article (a bucket can't
|
|
118
|
+
relate to a section of an article it doesn't relate to). So the M×N section checks run
|
|
119
|
+
*only inside the few articles a bucket relates to*, never "× every section in the wiki."
|
|
120
|
+
Same idea recursively: each coarser binary check prunes the finer ones beneath it.
|
|
121
|
+
Retrieval narrows candidates *within* a level; pruning eliminates whole levels.
|
|
122
|
+
|
|
123
|
+
### The uniform growth rule (no-match → create)
|
|
124
|
+
|
|
125
|
+
At *every* rung, "no existing candidate matched" branches on substance, it does not just
|
|
126
|
+
drop: **substantive → CREATE, trivial → drop.** A chunk that fits no bucket → new bucket;
|
|
127
|
+
a bucket that relates to no existing article → new article; a chunk that fits no section of
|
|
128
|
+
a related article → new section. Only non-substantive trivia is filtered. So substantive
|
|
129
|
+
content always lands *somewhere* — this is how the taxonomy grows new buckets, the wiki
|
|
130
|
+
grows new articles, and articles grow new sections (the Wikipedia editor adds a page or a
|
|
131
|
+
section for a fact that fits nowhere). Each create is its own atomic task, gated against
|
|
132
|
+
the existing set (the new-bucket global gate, fix E).
|
|
133
|
+
|
|
134
|
+
## Data model (`src/memory/db.ts`)
|
|
135
|
+
|
|
136
|
+
Rewrite the copy-schema to the pointer design (memory-synthesis.md; no live data):
|
|
137
|
+
`messages` (text once, `(conv, position)`), `chunks` (pointers + `label`, no text),
|
|
138
|
+
`buckets` (writable), `chunk_buckets` (M:N — the classify output). `PRAGMA foreign_keys
|
|
139
|
+
= ON` + `ON DELETE CASCADE` (fixes Lucien's 368 orphan edges / 570 dangling pointers).
|
|
140
|
+
**Keep `synthesized_bucket_chunks` per-(bucket,chunk) [fix G]** — do not rename the
|
|
141
|
+
working ledger for the unbuilt section feature; `chunk_sections` may exist as a
|
|
142
|
+
future-proof empty table only.
|
|
143
|
+
|
|
144
|
+
## Eval — embeddings as the test instrument
|
|
145
|
+
|
|
146
|
+
`scripts/experiments/bucket-cohesion-signal.ts` (mirrors `chunk-embedding-signal.ts`):
|
|
147
|
+
- **[measure FIRST — the #1 risk] shortlist recall ceiling:** is each gold bucket in its
|
|
148
|
+
chunk's embedding top-K? Report overall **and per bucket-size-bin** (122/379 buckets
|
|
149
|
+
have <5 chunks — the global number hides tail collapse [fix C]). If low, the shortlist
|
|
150
|
+
caps recall and must be re-tuned before building on it.
|
|
151
|
+
- **bucket cohesion / separation / subcluster-gap** baseline over the 379 cloud buckets.
|
|
152
|
+
- **purity (LLM judge)** on lowest-subcluster-gap buckets — embeddings can't grade purity
|
|
153
|
+
(ρ≈0.32); confirm the asymmetry so the judge stays load-bearing.
|
|
154
|
+
- **decision accuracy:** since each task is binary, eval is per-(chunk,candidate-bucket)
|
|
155
|
+
yes/no accuracy + per-chunk Jaccard vs the 8441 valid gold edges. Report **oracle-shortlist**
|
|
156
|
+
F1 (force gold into candidates → pure model judgment) vs **real-shortlist** F1 (end-to-end);
|
|
157
|
+
the gap is the retrieval tax. **The LoRA decision keys off the oracle F1 [fix F].**
|
|
158
|
+
|
|
159
|
+
## LoRA decision (staged)
|
|
160
|
+
|
|
161
|
+
- **Stage 0 — embedding-only:** top-K cosine + threshold vs the 8809 gold edges → F1/Jaccard.
|
|
162
|
+
Might end it (classify could be embedding-shaped).
|
|
163
|
+
- **Stage 1 — base MiniCPM5-1B, prompt-only, binary tasks + shortlist:** measure oracle-F1,
|
|
164
|
+
yes/no consistency. The binary framing is *much* easier for a small base model than JSON
|
|
165
|
+
multi-assignment — Stage 1 may clear the bar with no LoRA precisely because the tasks are atomic.
|
|
166
|
+
- **Stage 2 — train `memory-bucket` LoRA, only if Stage 0/1 miss.** Data from lucien.db, one
|
|
167
|
+
example per (chunk, candidate-bucket) binary decision (gold = belongs?), shortlist regime =
|
|
168
|
+
serve regime. Recipe = `chunk-finetune.ts` (sft, rank 16, lr 1e-5, seq 8192,
|
|
169
|
+
`MLX_BUN_PERF_KERNEL=0 MLX_BUN_FUSED_GELU=0`, no train-flash); adapter →
|
|
170
|
+
`~/.cache/mlx-bun/adapters/memory-bucket`; pick checkpoints by the F1 judge, not val loss.
|
|
171
|
+
**GPU-gated.**
|
|
172
|
+
|
|
173
|
+
## Build sequence
|
|
174
|
+
|
|
175
|
+
Runnable now (no GPU training, no server):
|
|
176
|
+
1. **[FIRST]** `bucket-cohesion-signal.ts` → shortlist recall ceiling (per size-bin) +
|
|
177
|
+
cohesion/sep/subcluster baseline. Verifies the shortlist foundation before any build.
|
|
178
|
+
2. Rewrite `db.ts` to the pointer schema + `foreign_keys` + helpers; in-memory test.
|
|
179
|
+
3. Stage-0 embedding-only baseline (oracle + real F1).
|
|
180
|
+
4. Purity judge on lowest-subcluster-gap buckets; confirm the asymmetry.
|
|
181
|
+
5. Implement `cluster.ts` as **atomic tasks**: shortlist → per-candidate yes/no → new-bucket
|
|
182
|
+
proposal + global gate; cold-start = cluster → purity-gate → name → member-seed.
|
|
183
|
+
6. Stage-1 eval (base, no adapter) → apply LoRA criteria.
|
|
184
|
+
|
|
185
|
+
GPU-gated (only if needed): 7. build binary SFT data · 8. train `memory-bucket` · 9. re-eval.
|
|
186
|
+
Integration: 10. wire `clusterChunks` into `pipeline.ts`.
|
|
187
|
+
|
|
188
|
+
**First command:** `bun scripts/experiments/bucket-cohesion-signal.ts`
|
|
189
|
+
|
|
190
|
+
## Open risks
|
|
191
|
+
|
|
192
|
+
- Shortlist recall ceiling (measure per size-bin first — step 1).
|
|
193
|
+
- More model calls per chunk (K binary vs 1 JSON) — bounded by K; each call is tiny/fast.
|
|
194
|
+
- Cold-start naming going generic — seed with distinctive labels + "specific not generic".
|
|
195
|
+
- Distilled labels ≠ ground truth — don't over-trust exact-match F1; use reference-free
|
|
196
|
+
silhouette + purity on divergences.
|
|
@@ -55,14 +55,14 @@ shared subset; optiq-only features are additive (marked ⊕).
|
|
|
55
55
|
| `generate` | mlx_lm.generate | ✅ `generate.ts` (no CLI verb) | wire verb + full flag set |
|
|
56
56
|
| `chat` | mlx_lm.chat | engine ✅, web chat ✅; no terminal REPL (`tui.ts` is help-formatting) | build REPL frontend over `generate` |
|
|
57
57
|
| `server` | mlx_lm.server / optiq serve | ✅ `serve` | rename flags; ⊕ `--kv-config`, `--anthropic` honored (default on) |
|
|
58
|
-
| `convert` | mlx_lm.convert + optiq convert |
|
|
58
|
+
| `convert` | mlx_lm.convert + optiq convert | ✅ `convert` (wraps `quantize/quantizer.ts`) | -q/--q-bits/--q-group-size/--mlx-path/--upload-repo parity (upload rides `hf-push.ts`); ⊕ `--target-bpw/--candidate-bits/--calibration-mix/--n-calibration` (mixed precision); no `--dtype`/`--dequantize`/plain non-quantizing convert |
|
|
59
59
|
| `lora` | mlx_lm.lora + optiq lora | serve/hot-swap ✅, train ✅ | `--train/--test`; ⊕ `--rank-scaling by_bits\|by_kl`; `lora info` |
|
|
60
|
-
| `fuse` | mlx_lm.fuse |
|
|
60
|
+
| `fuse` | mlx_lm.fuse | ✅ `fuse` (`train/fuse.ts`) | --adapter-path/--save-path parity; preserves per-module quant layout; dequant/GGUF/upload not supported (says so, exits 1) |
|
|
61
61
|
| `cache_prompt` | mlx_lm.cache_prompt | runtime ✅, CLI ❌ | precompute + save reusable KV cache file |
|
|
62
62
|
| `benchmark` | mlx_lm.benchmark / optiq benchmark | ✅ `benchmark` | flag-name parity (`-p/-g/-b/-n`); ppl half ❌ |
|
|
63
63
|
| `evaluate` | mlx_lm.evaluate / optiq eval | ❌ (`evals` = our bench viewer) | task harness; ⊕ optiq task names |
|
|
64
|
-
| `perplexity` | mlx_lm.perplexity |
|
|
65
|
-
| `upload` | mlx_lm.upload |
|
|
64
|
+
| `perplexity` | mlx_lm.perplexity | ✅ `perplexity` (`eval/perplexity.ts`) | reference methodology (pack → non-overlapping rows → f32 CE, delta-method SE); data source is a LOCAL .txt/.jsonl, not an HF dataset |
|
|
65
|
+
| `upload` | mlx_lm.upload | ✅ `upload` (wraps `hf-push.ts`, the web push engine) | --path/--upload-repo parity; ⊕ `--private`; token from hf.json/$HF_TOKEN/hf auth login |
|
|
66
66
|
| `manage` | mlx_lm.manage | ✅ `get`/`scan`/`ls` | add `--delete/--pattern/--scan` parity |
|
|
67
67
|
| `kv-cache` | optiq kv-cache | runtime ✅, profiler ❌ | per-layer sensitivity → `kv_config.json` |
|
|
68
68
|
| `latency` | optiq latency | ✅ `fit` | alias + `--calibrate` |
|
|
@@ -146,19 +146,19 @@ column; the 🟥 column is the capability matrix that fills in behind it.
|
|
|
146
146
|
| Precompute prompt cache | `cache_prompt` | 🔌 | Phase 17 |
|
|
147
147
|
| LoRA serve / hot-swap | `lora` (serve) | ✅ | done (Phase 8) |
|
|
148
148
|
| `lora info` reporting | `lora info` | 🔌 | Phase 17 |
|
|
149
|
-
| **HF→MLX convert → new model artifact** | `convert` |
|
|
150
|
-
| **Sensitivity / mixed-precision weights** | `convert`, `dynamic_quant` |
|
|
149
|
+
| **HF→MLX convert → new model artifact** | `convert` | ✅ | done (CLI verb over the native quantize pipeline) |
|
|
150
|
+
| **Sensitivity / mixed-precision weights** | `convert`, `dynamic_quant` | ✅ (`convert --target-bpw`) | done via convert; `dynamic_quant` alias 🟥 |
|
|
151
151
|
| **AWQ / DWQ / GPTQ (weights)** | `awq`/`dwq`/`gptq` | 🟥 | Model-quant |
|
|
152
152
|
| KV-cache quant: bf16 / uniform / **mixed per-layer** (kv_config.json) | `server` (`off`/`N`/`config`) | ✅ | done (Phase 9/10; config.ts reads, generate.ts applies per-layer) |
|
|
153
153
|
| KV sensitivity *profiler* (authors a NEW kv_config.json) | `kv-cache` | 🟥 | model-prep, low pri (shipped artifacts already include one) |
|
|
154
154
|
| TurboQuant — optional extra quant *method* (rotation VQ) | scheme, not a verb | 🟥 | Phase 13 (KV plumbing already exists) |
|
|
155
155
|
| **LoRA / DoRA / full training** | `lora --train` | ✅ | Training (done: Phase A MiniCPM5 + Phase B e4b) |
|
|
156
156
|
| **Sensitivity-aware rank scaling** | `lora --rank-scaling` | 🟥 | Training |
|
|
157
|
-
| **Fuse adapters (+GGUF/upload)** | `fuse` | 🟥 |
|
|
157
|
+
| **Fuse adapters (+GGUF/upload)** | `fuse` | ✅ fuse; GGUF/dequant/upload 🟥 | done (fold-into-base, quant layout preserved) |
|
|
158
158
|
| **lm-eval-harness tasks** | `evaluate` | 🟥 | Eval (new phase) |
|
|
159
159
|
| **optiq eval suite (kl/gsm8k/ifeval/bfcl/hashhop…)** | `evaluate` | 🟥 | Eval |
|
|
160
|
-
| **Perplexity** | `perplexity` |
|
|
161
|
-
| **HF upload** | `upload` |
|
|
160
|
+
| **Perplexity** | `perplexity` | ✅ | done (local text/jsonl datasets) |
|
|
161
|
+
| **HF upload** | `upload` | ✅ | done (native `hf-push.ts`; also `convert --upload-repo`) |
|
|
162
162
|
| **Distributed share** | `share` | 🟥 | Distribution (lowest pri) |
|
|
163
163
|
| **Web UI: quantize** | `lab`/UI | 🟥 | gated on Quantize |
|
|
164
164
|
| **Web UI: fine-tune** | `lab`/UI | ✅ | done (SFT/DPO workflow, loss curve, merge, export) |
|
|
@@ -181,7 +181,7 @@ does. The real capability work splits along two axes:
|
|
|
181
181
|
(Phase 13).
|
|
182
182
|
- **Training**: LoRA/DoRA/full training ✅ (shipped); `fuse` verb (adapter merge, GGUF export, upload) 🟥 remaining.
|
|
183
183
|
- **Eval**: harness + `perplexity`.
|
|
184
|
-
- **Distribution**: `upload
|
|
184
|
+
- **Distribution**: `upload` ✅ (CLI verb + `convert --upload-repo`); `share` 🟥.
|
|
185
185
|
|
|
186
186
|
The OptIQ-Lab web-UI tiles gate on these: quantize ← model-quant,
|
|
187
187
|
fine-tune ← training, training-data ← independent, chat ✅.
|
|
@@ -225,5 +225,5 @@ correctness diffs need no clean machine.
|
|
|
225
225
|
to author new configs (low pri) + the TurboQuant method (Phase 13).
|
|
226
226
|
4. Training → ✅ `lora --train` + web-UI fine-tune tile (both shipped); remaining: `fuse` verb (adapter merge, GGUF export, upload).
|
|
227
227
|
5. Eval → `evaluate`/`perplexity`.
|
|
228
|
-
6. Distribution → `upload
|
|
228
|
+
6. Distribution → `upload` ✅ (2026-07-01); `share` remaining.
|
|
229
229
|
7. Web UI training-data tile (independent of engine work).
|