Skip to content

Run frontier MoE models on hardware you already own — pure C, zero deps, experts streamed from disk. Tiny engine, immense model. 🐦

C

docs: README rewritten around the one-step setup, in all five languages

JustVugg11595fed6ab9
diff --git a/README.it.md b/README.it.md
index a35421e5..af4c1659 100644
--- a/README.it.md
+++ b/README.it.md
@@ -1,10 +1,10 @@
<p align="center">
- <img src="assets/colibri-logo.svg" width="560" alt="colibrì — motore piccolo, modello immenso">
+ <img src="assets/colibri-logo.svg" width="560" alt="colibrì: motore piccolo, modello immenso">
</p>
<p align="center">
- <a href="https://justvugg.github.io/colibri"><img src="https://img.shields.io/badge/website-justvugg.github.io%2Fcolibri-1f6feb" alt="Website"></a>
- <a href="https://github.com/JustVugg/colibri/releases"><img src="https://img.shields.io/github/v/release/JustVugg/colibri?color=2ea043" alt="Latest release"></a>
+ <a href="https://justvugg.github.io/colibri"><img src="https://img.shields.io/badge/website-justvugg.github.io%2Fcolibri-1f6feb" alt="Sito web"></a>
+ <a href="https://github.com/JustVugg/colibri/releases"><img src="https://img.shields.io/github/v/release/JustVugg/colibri?color=2ea043" alt="Ultima release"></a>
</p>
<p align="center">
@@ -13,901 +13,721 @@
<a href="README.md">English</a> · <a href="README.zh-CN.md">简体中文</a> · <a href="README.zh-TW.md">繁體中文</a> · Italiano · <a href="README.ja.md">日本語</a>
</p>
-**Motore piccolo, modello immenso.** Esegui **modelli MoE di frontiera — da 744
-miliardi a 2,8 mila miliardi di parametri** — su hardware consumer ed eterogeneo,
-in C puro e senza dipendenze del motore, trattando storage, RAM e VRAM come
-un'unica gerarchia di inferenza (multitiering della memoria per l'IA).
-
-Oggi girano dieci famiglie di modelli linguistici. Contiamo i motori, non i
-checkpoint: un file C ciascuna, la stessa interfaccia `coli chat` / `coli serve` /
-`coli web`, e alcuni motori eseguono più di un modello. **GLM-5.2/5.3** (744B),
-**GLM-5.3-Flash** (321B, con visione), **Inkling** (975B), **Kimi K3** (2,8T),
-**DeepSeek V4 Flash** (284B), **DeepSeek V4.1 Flash** (552B, con visione),
-**MiMo-V2.6 Flash** (309B, con visione; lo stesso motore esegue **MiMo-V2.6 Pro**,
-1,02T), **Qwen3.8-Flash-Next** (125B + 51B n-gram), **Qwen3.6** (35B-A3B; lo stesso
-motore esegue **Qwen3-Coder-30B-A3B** e il denso **Qwen3.8-27B**, con visione) e
-**OLMoE** (7B).
-Anche immagini: un undicesimo motore esegue **Qwen-Image-2.1**, che genera figure
-da un testo, mostrate dentro al terminale da `coli chat` e servite su
-`POST /v1/images/generations` ([qwen-image.md](docs/qwen-image.md)).
-[Elenco completo ↓](#other-supported-models)
-
-> **Colibrì è un motore di inferenza che puoi usare oggi, e una piattaforma di
-> ricerca aperta.** Il suo obiettivo principale è migliorare le prestazioni di
-> inferenza lungo l'intero confine software/hardware — formati dei modelli,
-> gerarchia di memoria, I/O dello storage, piazzamento, scheduling, kernel,
-> speculazione e sovrapposizione CPU/GPU — affinché i grandi modelli dipendano
-> meno da hardware raro e costino meno.
-
-Colibrì tratta VRAM, RAM e storage come un'unica gerarchia multilivello ed è
-intenzionalmente un luogo dove verificare idee di sistema aggressive: quindi
-**nessuno SLA sulla velocità, e una garanzia dura sulla semantica**. Gli
-esperimenti devono dimostrare il proprio valore con misure end-to-end riproducibili;
-la policy predefinita **non cambia mai silenziosamente la precisione del modello né
-la semantica del router**. Una memoria veloce insufficiente può ridurre la velocità,
-ma non ridefinire il modello di nascosto.
+**Motore piccolo, modello immenso.** colibri fa girare modelli aperti molto
+grandi sulla macchina che hai già. Un modello mixture-of-experts da centinaia di
+miliardi di parametri usa solo una piccola parte di sé per ogni token: colibri
+tiene quella parte in RAM e legge il resto, gli expert, dal disco quando il
+modello li chiede. C puro, un file per famiglia di modelli, nessuna GPU
+necessaria.
+
+Oggi girano tredici motori. Dieci sono per modelli linguistici: **GLM-5.2/5.3**,
+**GLM-5.3-Flash**, **Inkling**, **Kimi K3**, **DeepSeek V4 Flash**,
+**DeepSeek V4.1 Flash**, **MiMo-V2.6 Flash** (e Pro), **Qwen3.8-Flash-Next**,
+**Qwen3.6** (che esegue anche Qwen3-Coder e il denso Qwen3.8-27B) e
+**OLMoE**. Uno disegna immagini: **Qwen-Image-2.1**. Due prendono decisioni:
+**Laya** e **GLiNER2.5-Decide**, con un terzo modello di decisione, **Clef**, sul
+motore Qwen3.6. [Quale scegliere per la mia macchina](#which-model-for-my-machine)
```
$ ./coli chat
- 🐦 colibri v1.12.1 — GLM-5.2 · 744B MoE · int4 · streaming CPU
+ colibri v1.12.1 · GLM-5.2 · 744B MoE · int4 · streaming CPU
✓ ready in 32s · resident 9.9 GB
› ciao!
- ◆ Ciao! 😊 Come posso aiutarti oggi?
+ ◆ Ciao! Come posso aiutarti oggi?
```
-## Guardalo in azione
+<a id="get-started"></a>
+<a id="the-one-step-way"></a>
-<p align="center">
- <img src="docs/media/colibri-dashboard.png" width="900" alt="dashboard web di colibrì — metriche live, pannello hardware, livelli degli expert">
-</p>
-<p align="center"><em>La dashboard web (<code>./coli web</code>), ridisegnata nella 1.12.0: uno spazio di lavoro con un dock per la chat,
-la modalità System One, la pagina Brain e il Profiling, in tema chiaro o scuro. Qui Qwen3.6 che risponde su una macchina
-solo CPU, con gli expert letti dal disco.</em></p>
+## Inizia in un solo passo
-<p align="center">
- <img src="docs/media/colibri-brio.png" width="900" alt="la pagina System One: un documento letto una volta, una probabilità per ogni risposta ammessa, e un'entropia">
-</p>
-<p align="center"><em><strong>Modalità System One</strong>: lo stesso modello, a cui si dice di non scrivere. Gli dai un documento e le sole risposte
-che può scegliere; legge la probabilità di ciascuna, non genera niente, e riporta un'entropia che dice quando non è
-sicuro. Qui: <strong>request changes al 99.9%</strong>, entropia 0.005, 4 token letti, 0 generati.</em></p>
+Ti serve un computer con **8 GB di RAM** come minimo assoluto (meglio 16 GB o
+più), **22 GB liberi sul disco** per il modello più piccolo e una connessione a
+internet. La scheda grafica è facoltativa.
-<p align="center">
- <img src="docs/media/colibri-brain.png" width="900" alt="la pagina Brain: l'atlante misurato degli expert di GLM-5.2 disegnato come una corteccia, dieci regioni da esplorare">
-</p>
-<p align="center"><em>La pagina <strong>Brain</strong>, <strong>Explore</strong>: l'<a href="https://github.com/JustVugg/colibri/issues/175">atlante misurato degli expert</a> di GLM-5.2
-disegnato come una corteccia. 13.260 expert caratterizzati in dieci regioni (Python, SQL, matematica, poesia, legge, cinese…);
-la posizione deriva dall'affinità di routing misurata, non da un embedding appreso. Si sceglie una regione e ci si entra.
-<strong>Live routing</strong> passa al modello in esecuzione: una cella per expert, il colore è il livello di archiviazione, e ogni
-expert instradato in un turno lampeggia bianco.</em></p>
+**Windows**
-<p align="center">
- <img src="docs/media/colibri-brain-region.png" width="900" alt="dentro la regione Python: 1.142 expert, uno selezionato con le sue affinità misurate">
-</p>
-<p align="center"><em>Dentro la regione <strong>Python</strong>: 1.142 expert come una costellazione, ciascuno etichettato per layer e indice. Il pannello
-ne mostra uno, layer 17 expert 178: un generalista con entropia 3,13, la cui affinità misurata è 20,2% Python, 14,6% JSON,
-14,2% conversazione, 13,3% SQL.</em></p>
+1. In questa pagina fai clic su **Code**, poi su **Download ZIP**, ed estrai
+ l'archivio.
+2. Fai doppio clic su **`START-HERE.bat`** nella cartella estratta. Se manca
+ Python, si offre di installarlo per te.
-<p align="center">
- <img src="docs/media/colibri-profiling.png" width="900" alt="la pagina Profiling: dove il motore spende ogni turno">
-</p>
-<p align="center"><em>La pagina <strong>Profiling</strong>: dove il motore spende ogni turno, per fase, con gli ultimi 30 turni come tendenza.
-Qui Qwen3.6 su una macchina CPU: 19,0 s di tempo totale per 36 token di prompt e 55 generati, 2,9 tok/s, 11,4 s di
-servizio disco sovrapposti al calcolo.</em></p>
-
-## La missione di ricerca
-
-Con Colibrì, l'accesso privato ai modelli di frontiera non è limitato dalla
-disponibilità di hardware da hyperscaler.
-
-Con le sue funzioni di multitiering, Colibrì **rimuove le dipendenze da hardware
-proprietario ottimizzando in modo aggressivo le pipeline funzionali del motore di
-inferenza**.
-
-La nostra missione operativa comprende cambiare il modo in cui i pesi sono
-rappresentati e spostati, decidere cosa risiede in VRAM, RAM o storage, sovrapporre
-calcolo eterogeneo, ridurre i costi di avvio e sincronizzazione, sfruttare sparsità
-e riuso e verificare nuovi algoritmi di decoding. La convenzione non protegge una
-tecnica; un microbenchmark veloce non basta ad adottarla. Decide l'inferenza
-end-to-end su macchine reali, misurando correttezza e qualità insieme a throughput,
-latenza, memoria e costo.
-
-Il risultato pratico è l'**accessibilità**: eseguire un modello da 744B
-sull'hardware che già possiedi, osservare ogni expert attivarsi in tempo reale e
-modificare il codice che lo fa. Non noleggiare intelligenza dietro un'API, ma
-*possederla*: analizzarla, misurarla, migliorarla. Il motore resta volutamente
-abbastanza piccolo perché la prossima ottimizzazione utile possa arrivare da
-chiunque sia disposto a misurarla.
-
-## Tecniche fondamentali e risultati misurati
-
-- **Una gerarchia, non una soglia di memoria.** VRAM, RAM e NVMe sono livelli di
- piazzamento degli stessi pesi; poca memoria veloce cambia la velocità, non il modello.
-- **Un JIT per i pesi.** Il calore di routing misurato alimenta una LRU per layer,
- un hot-store appreso e il prefetch del layer successivo senza caricare tutti gli expert.
- Aiuta sui carichi ripetibili, ma la cronologia può sovradattarsi e il prefetch può
- perdere su alcuni host: sono policy da misurare, non promesse.
-- **L'I/O fa parte del motore.** Unione degli expert per batch, letture sovrapposte
- al calcolo, `O_DIRECT` e striping pesato su due SSD ottimizzano direttamente lo
- streaming. `O_DIRECT` dipende dal disco e il doppio SSD richiede più A/B end-to-end.
-- **Esecuzione eterogenea.** CPU, CUDA, Metal, memoria NUMA e residenza parziale o
- completa degli expert condividono un runtime; la combinazione utile dipende da
- calcolo, banda, residenza e carico.
-- **Stato compresso senza cambiare modello.** Validazione token-exact, stato MLA KV
- 57× più piccolo, conversazioni persistenti e DSA fedele vincolano l'ottimizzazione
- alla correttezza. Sono proprietà di memoria, latenza e correttezza, non una
- promessa generale di throughput.
-- **La speculazione deve meritarsi il costo.** MTP nativo e draft vincolati da
- grammatica sono misurati end-to-end e si disattivano quando l'accettazione non
- ripaga la verifica.
-
-## Ipotesi aperte, esperimenti e partecipazione
-
-Colibrì considera ogni ottimizzazione un'ipotesi finché un A/B end-to-end
-controllato non dimostra il contrario. Le domande principali sono:
-
-| ipotesi | evidenza attuale | esperimento ancora necessario |
-|---|---|---|
-| La cronologia di routing può piazzare gli expert meglio di una semplice LRU | i pin appresi migliorano carichi ripetuti, ma possono sovradattarsi al prompt | A/B cross-session su set esclusi: codice, chat, multilingua e contesti lunghi |
-| Più SSD possono trasformare banda indipendente in velocità di decode | due unità NVMe indipendenti hanno misurato +37,5% in decode; una terza unità più lenta è risultata neutra dopo lo striping pesato ([misure](docs/multidisk.md#what-has-been-measured)) | riprodurre con dischi di velocità diverse, diverse disposizioni dei controller e diversi stati della cache |
-| Un planner hardware-aware può avvicinarsi automaticamente alla configurazione migliore | oggi rileva budget RAM/VRAM e diversi backend | confrontare il piano generato con sweep controllati su laptop, workstation, NUMA e multi-GPU |
-| Rappresentazioni lossless o a qualità limitata possono ridurre abbastanza il movimento dei pesi | esistono ablation di formato e quantizzazione con gate di qualità | riprodurre insieme qualità, byte mossi, latenza e costo per token utile, non solo il rapporto di compressione |
-| La speculazione routing-aware può convenire prima della residenza quasi completa | MTP e draft grammaticali funzionano, ma MTP ha anche perso il 32% intorno all'85% di expert hit | mappare il pareggio tra accettazione, hit rate, batch union e profondità del draft |
-| La sovrapposizione CPU/GPU può nascondere trasferimenti e sincronizzazione | esistono risultati positivi CUDA e Metal, ma CPU veloci e bassa residenza possono annullarli | profili per fase e A/B a variabile singola su PCIe, memoria unificata e piena residenza |
-
-Per contribuire, scegli una riga e pubblica anche i risultati negativi. Registra
-hardware, commit, container del modello, comando esatto, prompt, stato cache,
-throughput, TTFT, expert hit, byte letti e controllo qualità; cambia una sola
-variabile, ripeti e allega i log grezzi. Parti da
-[CONTRIBUTING.md](CONTRIBUTING.md), confronta il
-[protocollo di benchmark](docs/benchmarking.md), quindi
-[apri una issue di esperimento](https://github.com/JustVugg/colibri/issues/new).
-Un fallimento controllato vale più di un numero veloce senza spiegazione.
-
-## L'idea
-
-Un modello Mixture-of-Experts da 744B attiva solo ~40B parametri per token — e
-solo ~11 GB di quelli cambiano da un token all'altro (gli expert instradati):
-
-<p align="center">
- <img src="docs/media/sparse.png" width="880" alt="solo ~5.4% dei parametri è attivo per token">
-</p>
-
-Il modello non ha bisogno di *stare* in memoria veloce — ha bisogno di essere
-**piazzato**:
-
-- la **parte densa** (attenzione, expert condivisi, embedding — ~17B parametri)
- resta **residente in RAM a int4** (~9.9 GB);
-- i **19.456 expert instradati** (75 layer MoE × 256 + la testa MTP, ~19 MB
- ciascuno a int4) stanno **su disco** (~370 GB) e vengono **caricati on demand
- in streaming**, con una cache LRU per layer, un hot-store pinnato che impara,
- e un livello VRAM opzionale.
-
-Pensa all'algoritmo di base come a **un JIT, ma per i pesi**. Un compilatore JIT
-non compila mai l'intero programma: osserva cosa viene davvero eseguito e compila i
-percorsi caldi, appena in tempo. colibrì fa la stessa scommessa su uno spazio di
-744B parametri: i parametri non sono uno stato residente da custodire, sono **dati
-da collocare** lungo una gerarchia di storage eterogenea (VRAM / RAM / NVMe),
-esattamente quando il router dimostra che servono. Il calore di routing misurato
-decide quale livello si guadagna ogni expert, il router lavora un layer in anticipo
-così il prefetch nasconde la latenza di caricamento e, come un JIT, il motore impara
-il tuo carico di lavoro: più lo usi, più si scaldano gli expert giusti. Funziona
-perché il routing ha una struttura misurabile (vedi
-l'[atlante degli expert](https://github.com/JustVugg/colibri/issues/175)), e una
-struttura si può mettere in cache.
-
-Il motore è un singolo file C (`c/colibri.c`) più header piccoli. Niente BLAS,
-niente Python a runtime, niente GPU obbligatoria.
-
-### Modalità cluster locale
-
-Il coordinatore tiene in locale la generazione dei token, il routing e lo stato KV,
-mentre worker di expert basati su disco eseguono le FFN instradate su altri Mac. La
-batch-union instradata di un layer viene inviata come un'unica richiesta TCP
-persistente, così un token non paga un round trip per ogni expert.
-
-Avvia il servizio di registrazione opzionale:
+**Linux** (Ubuntu e Debian; le altre distribuzioni hanno gli stessi pacchetti
+con i loro nomi)
```bash
-./coli cluster coordinator --host 0.0.0.0 --port 8765
+sudo apt install git python3 build-essential
+git clone https://github.com/JustVugg/colibri
+cd colibri
+./start-here.sh
```
-Su ogni worker, con lo stesso modello convertito disponibile in locale:
+**macOS** (con [Homebrew](https://brew.sh))
```bash
-./coli cluster worker --model /nvme/glm52_i4 --port 9100 \
- --coordinator http://COORDINATOR:8765 --advertise-host WORKER_IP
+xcode-select --install
+brew install libomp git python
+git clone https://github.com/JustVugg/colibri
+cd colibri
+./start-here.sh
```
-Avvia il coordinatore con la discovery, oppure passa `--cluster-workers
-HOST:PORT,...` per una configurazione statica:
+Rispondi a una sola domanda, quale modello, e Invio accetta il consiglio. Poi
+l'installazione:
+
+1. **esamina la tua macchina**: RAM, disco libero, CPU e GPU;
+2. **consiglia un modello che ci sta**: la parte del modello che resta sempre in
+ RAM, più una cache minima di expert, deve entrare nella tua RAM, e il
+ download sul tuo disco;
+3. **prepara il motore**: lo compila per la tua macchina se c'è un compilatore,
+ altrimenti scarica quello già compilato, che gira sulla CPU. Lo compila per
+ la tua GPU quando conviene: CUDA per una scheda NVIDIA su Linux se è
+ installato il CUDA toolkit, altrimenti Vulkan. Su una GPU dedicata lo fa
+ sempre; su una GPU integrata, che condivide la RAM della CPU, solo per i
+ modelli che lì sono risultati più veloci nelle misure (Qwen3.6, Qwen3-Coder
+ e Qwen3.8-Flash-Next). Se manca un pacchetto, stampa il comando esatto per
+ installarlo e prosegue con la CPU; rilancia poi l'installazione e il motore
+ viene ricompilato per la GPU;
+4. **scarica il modello** mostrando l'avanzamento e con la ripresa: interrompilo
+ quando vuoi, rilancialo e riparte da dove si era fermato;
+5. **avvia colibri e apre la dashboard** nel browser, e stampa gli indirizzi
+ che le altre app possono usare:
-```bash
-./coli serve --model /nvme/glm52_i4 \
- --cluster-coordinator http://127.0.0.1:8765
+```
+Starting colibri
+ Browser: http://127.0.0.1:8000/
+ OpenAI base URL: http://127.0.0.1:8000/v1
+ Anthropic base URL: http://127.0.0.1:8000
+ stop: press Ctrl+C here (or close this window)
```
-Il trasporto resta disattivato finché non si configurano dei worker, quindi il
-percorso esistente su una sola macchina non cambia. Lo sharding dei layer densi e i
-worker browser/WebGPU sono passi successivi separati.
+**La volta successiva**, rilancia `START-HERE.bat` o `./start-here.sh`: colibri
+parte subito, senza download e senza compilazione. `c/coli status` mostra cosa è
+installato e se è in esecuzione, `c/coli stop` lo ferma (`c\coli.cmd status` e
+`c\coli.cmd stop` su Windows).
-## Come funziona
+Le opzioni vanno dopo `./start-here.sh` o `START-HERE.bat`:
-### Il percorso di ogni token
+| Opzione | Cosa fa |
+|---|---|
+| `--list` | ogni modello confrontato con questa macchina, e il motivo per cui uno non ci sta |
+| `--model ID` | installa quel modello (gli id sono nelle [tabelle qui sotto](#which-model-for-my-machine)) |
+| `--yes` | nessuna domanda: accetta il consiglio |
+| `--dir DIR` | mette i modelli su un altro disco (predefinito `~/colibri-models`) |
+| `--backend vulkan`, `cuda` o `cpu` | scegli tu la build del motore; `--no-gpu` equivale a `--backend cpu` |
+| `--model-dir DIR` | usa un modello che hai già scaricato |
+| `--reconfigure` | per scegliere un altro modello |
-<p align="center">
- <img src="docs/media/token-path.png" width="880" alt="instrada → unione → piazza → sovrapponi → impara">
-</p>
+Cosa fa ogni passo, nel dettaglio: [docs/quickstart.md](docs/quickstart.md#the-one-step-way).
-Ogni layer di ogni token percorre gli stessi cinque passi. L'obiettivo
-progettuale è che **il piazzamento decide solo la velocità** — le decisioni
-del router e la precisione dei pesi sono identiche sia che un expert risponda
-dalla VRAM sia dal disco.
+### Se qualcosa va storto
-### Una gerarchia di memoria, non un requisito di memoria
+| Cosa vedi | Cosa fare |
+|---|---|
+| si è fermato durante il download | rilancia lo stesso comando: riprende dai byte già presenti sul disco |
+| `to use the GPU through ..., first run: <command>` | esegui quel comando, poi di nuovo l'installazione: ricompila per la GPU e non riscarica nulla |
+| `the ... build failed` durante la compilazione con CUDA, per esempio `Unsupported gpu architecture` quando il CUDA toolkit installato non supporta più la scheda | `./start-here.sh --backend vulkan` usa la scheda tramite Vulkan; `--no-gpu` resta sulla CPU |
+| `needs N GB free for the download` | `--dir` con una cartella su un disco più grande |
+| su WSL, la cartella del modello è sotto `/mnt/c` | tienila sul disco Linux (il predefinito, `~/colibri-models`): `/mnt/c` è molte volte più lento |
+| qualsiasi altra cosa | `c/coli logs -n 50` mostra il log del server e `c/coli logs --install` quello dell'installazione; apri una [issue](https://github.com/JustVugg/colibri/issues) con le ultime righe stampate dall'installazione |
-<p align="center">
- <img src="docs/media/tiers.png" width="880" alt="residenza expert a tre livelli: VRAM / RAM / NVMe">
-</p>
+### Lascia che sia il tuo assistente AI a installarlo
-<a id="dual-ssd-two-copies-of-the-model-twice-the-read-bandwidth"></a>
+Se usi un assistente AI per programmare, può fare tutto questo al posto tuo.
+Chiedigli:
-### Più SSD: leggere copie del modello da più di un disco
+> Installa colibri su questa macchina seguendo docs/AI_SETUP.md da https://github.com/JustVugg/colibri
-Quando il decode è limitato dal disco, un **secondo SSD** può aiutare: mettici una
-copia del modello e lascia che il motore legga da entrambi i dischi. Per GLM-5.2, da
-`c/` in un checkout dei sorgenti (o da una release scompattata):
+[docs/AI_SETUP.md](docs/AI_SETUP.md) dà all'assistente ogni passo sotto forma di
+comando con un risultato leggibile da una macchina, e gli dice di chiederti
+conferma prima di scaricare un modello o di installare un pacchetto di sistema.
+Gli assistenti che parlano il Model Context Protocol possono invece usare il
+server MCP di colibri: `coli mcp` offre strumenti per rilevare l'hardware,
+consigliare un modello, installarlo, avviarlo, fermarlo e controllarlo
+([docs/MCP_SERVER.md](docs/MCP_SERVER.md)).
-```bash
-COLI_MODEL_MIRROR=/second/glm52_i4 python3 ./coli chat --model /fast/glm52_i4
-```
+### Oppure a mano
-Il motore misura i dischi all'avvio per pesare la ripartizione delle letture. Le
-letture bufferizzate usano un instradamento deterministico degli expert; le letture
-dirette idonee possono distribuire un expert tra le repliche. Dischi indipendenti
-danno margine di banda, non un moltiplicatore garantito della velocità in token:
-controller condivisi, hit in cache e calcolo possono limitare il guadagno. Vedi la
-[guida multi-disco](docs/multidisk.md) per esempi in Bash e PowerShell, guadagni e
-limiti misurati e un confronto con un solo disco. Dettagli utili:
-
-- il mirror è **validato all'avvio** (dimensione di ogni file e header safetensors devono essere identici byte per byte al primario); i file divergenti o mancanti restano sul primario, quindi un **mirror parziale va bene**: un secondo SSD più piccolo può servire gli shard che contiene;
-- il mirror **non viene mai scritto**: `.coli_usage`, `.coli_kv` e tutti i sidecar restano sul primario;
-- un errore di lettura sul mirror ripiega sul primario (un avviso, nessun crash), quindi scollegare il secondo disco durante l'esecuzione degrada le prestazioni invece di far cadere il server;
-- il routing non cambia mai i token, perché le due copie sono identiche byte per byte; attiva `PROF=1` per i contatori di profilo `MIRROR:` che mostrano i GB serviti da ciascun disco.
-
-Lo stesso motore copre l'intero spettro: su un portatile da 25 GB tutto viene
-caricato dal disco in streaming (lento, ma corretto); su un host grande l'intero
-set di expert diventa residente (`CUDA_EXPERT_GB=auto PIN_GB=all`) e il disco
-esce completamente dal percorso di decode. Tra i livelli c'è una **cache che
-impara**: il motore registra quali expert il *tuo* carico di lavoro instrada
-(`.coli_usage`, aggiornato a ogni turno) e fissa automaticamente i più caldi —
-colibrì diventa letteralmente più veloce man mano che lo usi. Sugli host
-multi-socket, `COLI_NUMA=1` interlaccia i pesi residenti tra i controller di
-memoria ([#82](https://github.com/JustVugg/colibri/issues/82)).
-
-Per un secondo disco che non può contenere l'intero modello, Colibri può
-classificare un mirror parziale in base alla cronologia degli expert che già
-impara. Esegui prima qualche prompt rappresentativo, così `.coli_usage` riflette il
-carico di lavoro, poi pianifica, prepara e verifica il mirror:
+Per scegliere tu ogni passo (una release già compilata o una build dai sorgenti,
+qualsiasi modello dalle tabelle qui sotto, poi `coli chat`, `coli web` o
+`coli serve`), vedi [Installazione a mano](#install-by-hand), oppure la
+[guida Quick Start](docs/quickstart.md), passo passo per ogni piattaforma.
-```bash
-./c/coli mirror plan --model /fast/glm52_i4 --mirror /second/glm52_i4 \
- --budget-gib 200 --reserve-gib 20
-./c/coli mirror stage --model /fast/glm52_i4 --mirror /second/glm52_i4 \
- --budget-gib 200 --reserve-gib 20
-./c/coli mirror verify --model /fast/glm52_i4 --mirror /second/glm52_i4
-```
+## Cos'è colibri, e perché
-Il planner legge direttamente gli header safetensors, segue le directory di modelli
-divisi indicate in `COLI_MODEL_DIRS` e dà priorità agli shard che possono servire
-gli expert instradati più caldi. La preparazione non modifica mai il modello
-primario: copia passando per file temporanei, rispetta la riserva di spazio libero
-richiesta, verifica ogni shard con SHA-256, non cancella mai uno shard di mirror
-esistente e pubblica in modo atomico una ricevuta solo quando il mirror selezionato
-è pronto.
-
-### Mai aspettare il disco due volte
-
-I miss nella cache costano caro, quindi il motore investe la maggior parte
-della sua astuzia per evitarli e sovrapporli: le tre matrici di ogni expert sono
-memorizzate contigue e lette con un unico `pread`; un pool I/O asincrono
-limitato (`PIPE=1`, attivo per default) carica gli expert mancanti mentre quelli
-residenti calcolano; le posizioni in batch leggono ogni expert unico una sola
-volta (**batch-union**); un thread di lookahead del router (`PILOT=1`) fa il
-prefetch degli expert del layer successivo — il routing è misurabilmente
-**prevedibile al 71.6% un layer in anticipo**. Sulle GPU, la pipeline residente
-(`COLI_CUDA_PIPE=2`) mantiene il flusso residuo on-device tra i layer, così il
-loop CPU degli expert procede senza interruzioni; su Apple Silicon un backend
-[Metal](docs/metal.md) sperimentale esegue la matmul batch degli expert sulla
-GPU a memoria unificata; e un [backend Vulkan](docs/vulkan.md) porta il livello
-degli expert, le proiezioni dense e il nucleo dell'attenzione MLA su qualsiasi GPU
-con un driver Vulkan 1.2, comprese le schede AMD tramite Mesa/RADV (l'unico backend
-per le schede che gli stack dei produttori non supportano più, come la RX 580, e
-competitivo con ROCm su RDNA4: vedi [le note di benchmark](docs/vulkan.md)).
-Ogni altro motore ora apre lo stesso backend per le sue matrici residenti con
-`COLI_VULKAN=1` in una build `VK=1`; in CI è verificato contro i token della CPU, ma
-sulla prima GPU reale su cui è stato misurato, una Radeon 780M integrata, oggi è più
-lento della CPU ([gli altri motori](docs/vulkan.md#the-other-engines)).
-
-> **Su NVMe reali, misura `DIRECT=1`.** O_DIRECT scavalca la page cache e spesso è
-> un grande vantaggio sui dischi con cache DRAM e margine di banda (+34% in decode
-> misurato con `PIPE=1` su una macchina Blackwell/Windows; da 4,25 a 9,69 GB/s in
-> iobench su un GB10), ma dipende dal disco: unità QLC, senza DRAM o virtualizzate
-> possono essere neutre o peggiorare. Provalo prima; tieni ciò che il tuo hardware
-> premia.
-
-### Modello fedele, stato compresso
-
-Il forward pass è validato contro un oracle `transformers` (teacher-forcing di
-norma 30-32/32; due posizioni dell'oracle tiny sono quasi-pareggi in virgola mobile
-e dipendono dalla toolchain). L'attenzione MLA memorizza uno stato KV compresso
-(576 float/token invece di 32.768, **57× più piccolo**) e lo persiste tra i
-riavvii (`.coli_kv`): le conversazioni riaprono "calde", senza alcun re-prefill,
-byte-identiche a una sessione ininterrotta. L'attenzione sparsa DSA (il
-lightning indexer di GLM-5.2) è implementata fedelmente e validata forzando la
-selezione di tutte le chiavi per riprodurre esattamente l'attenzione densa.
-
-### Decodifica speculativa, onestamente
-
-La testa MTP nativa di GLM-5.2 propone token che il modello principale verifica
-in un unico forward batch — 2.2–2.8 token/forward quando conviene. Due regole
-conquistate a caro prezzo sono i default: la testa MTP deve essere **int8** (le
-teste int4 crollano al 0–4% di accettazione,
-[#8](https://github.com/JustVugg/colibri/issues/8)), e draft e verifica devono
-calcolare **la stessa funzione** — `SPEC_PIN=1` fissa entrambi sulla stessa
-famiglia di kernel ([#163](https://github.com/JustVugg/colibri/issues/163)
-contiene l'intera indagine forense). I draft forzati da grammatica
-([`GRAMMAR=file.gbnf`](docs/grammar-draft.md)) aggiungono accettazione quasi
-gratuita sull'output JSON vincolato. Se la speculazione conviene dipende dalla
-temperatura della cache — misura, e usa `DRAFT=0` quando non paga.
-
-I batch di verifica possono anche attivare un **nucleo di attenzione esatto** con
-`COLI_EXACT_VERIFY=1` ([#689](https://github.com/JustVugg/colibri/issues/689)): i
-prodotti scalari di score e di contesto dell'MLA-absorb su CPU accumulano prodotti
-interi e arrotondano una sola volta, così un quasi-pareggio in una riga di verifica
-si risolve allo stesso modo su ogni host, a circa 0,6x tok/s su un oracle tiny (il
-prodotto scalare in sé costa circa 5-7x il ciclo in float). Due limiti da
-conoscere: con una cache KV quantizzata (`tq1`, TQ o KV int8) il prodotto di
-contesto resta sul percorso float, quindi lì l'esattezza non è garantita; e un vero
-ribaltamento da quasi-pareggio è stato solo argomentato, non ancora osservato su
-GLM-5.2 a n=64.
-
-## Cosa ottiene
+Un modello mixture-of-experts è enorme sul disco e piccolo per token. GLM-5.2 ha
+744B parametri, ne usa circa 40B per ogni token, e solo circa 11 GB di questi
+cambiano da un token all'altro: gli expert instradati.
<p align="center">
- <img src="docs/media/ladder.png" width="880" alt="velocità di decode misurata per classe hardware">
+ <img src="docs/media/sparse.png" width="880" alt="solo circa il 5.4% dei parametri è attivo per ogni token">
</p>
-Stesso motore, stesso container int4 — cambia solo dove risiedono gli expert.
-Punti salienti dalle [tabelle benchmark complete](docs/benchmarks.md):
+Quindi il modello non deve stare in memoria veloce; deve essere **piazzato**. La
+parte densa (attenzione, expert condivisi, embedding) resta in RAM. Gli expert
+instradati restano sul disco e vengono letti quando il router li chiede,
+attraverso una cache che impara quali expert usa il tuo lavoro. Una GPU, quando
+c'è, tiene gli expert più caldi e i layer densi. Dove si trova un peso cambia la
+velocità con cui arriva la risposta, non quali pesi o quali decisioni del router
+la producono.
+
+Perché: per far girare modelli di queste dimensioni sull'hardware che le persone
+già possiedono, per guardarli lavorare (la dashboard mostra ogni expert nel
+momento in cui si attiva) e per tenere il motore abbastanza piccolo da permettere
+a chiunque di misurarlo e renderlo più veloce. colibri è anche una piattaforma di
+ricerca aperta: un'ottimizzazione si guadagna il suo posto con una misura
+end-to-end riproducibile, e la policy predefinita non cambia mai silenziosamente
+la precisione del modello né la semantica del router. Meno memoria veloce può
+costare velocità; non deve ridefinire il modello di nascosto. I dettagli sono in
+[Come funziona](#how-it-works).
+
+<a id="which-model-for-my-machine"></a>
+
+## Quale modello per la mia macchina
+
+L'installazione consiglia il modello più capace che gira dalla RAM sulla tua
+macchina, e subito sotto elenca quelli più grandi, che vengono letti dal disco in
+streaming. `./start-here.sh --list` li mostra tutti confrontati con la tua
+macchina. Le tabelle seguono il catalogo dell'installazione stessa
+([`c/setup_catalog.py`](c/setup_catalog.py)); i download sono le dimensioni che
+Hugging Face indica per ciascun repository.
+
+- **RAM** sono due numeri: sotto il primo il modello non parte, dal secondo in
+ su gira come nelle misure.
+- **GPU** è ciò che l'installazione può compilare per quel motore ([GPU](#gpus)).
+ *Anche integrata* significa che usa anche una GPU integrata, dove questi
+ motori sono risultati più veloci nelle misure; gli altri usano solo una GPU
+ dedicata.
+- **Misurato** è ciò che è stato cronometrato sulla macchina indicata: per i
+ modelli di chat, la velocità di decode. Le lettere sono le macchine elencate
+ sotto le tabelle. Una cella vuota significa che nessuno l'ha ancora misurato.
+
+**Modelli piccoli, che girano dalla RAM**
+
+| Modello | `--model` | Download | RAM | GPU | Misurato |
+|---|---|---|---|---|---|
+| **Qwen3.6-35B-A3B**: chat con thinking e tool | `qwen36-35b` | 23 GB | 10 / 20 GB | CUDA, Vulkan (anche integrata) | 6.0 tok/s sulla CPU, 9.9 con Vulkan sulla GPU integrata (A); 30.0 con CUDA (C) |
+| Qwen3-Coder-30B-A3B: codice e chiamate ai tool, senza thinking | `qwen3-coder-30b` | 19 GB | 8 / 18 GB | CUDA, Vulkan (anche integrata) | 8.5-9.6 tok/s con tutti gli expert in RAM, 5.1 con 32 per layer (A, CPU) |
+| **Qwen-Image-2.1**: da testo a immagine, licenza non commerciale | `qwen-image-2.1` | 33 GB | 12 / 18 GB | Vulkan | un'immagine 768x512 in 2 min 40 s (8 core Zen 4, CPU) |
+
+**Modelli grandi, i cui expert vengono letti dal disco in streaming** (la
+velocità la decide il disco: un NVMe veloce è ciò che aiuta di più)
+
+| Modello | `--model` | Download | RAM | GPU | Misurato |
+|---|---|---|---|---|---|
+| DeepSeek V4 Flash REAP 150B: 132 dei 256 expert | `deepseek-v4-flash-reap` | 85 GB | 16 / 32 GB | CUDA, Vulkan | |
+| **DeepSeek V4 Flash** (284B): tool | `deepseek-v4-flash` | 167 GB | 16 / 32 GB | CUDA, Vulkan | 0.93 tok/s con 32 GB (Ryzen 7 5800X), 1.24 con 63 GB (Ryzen 9 5950X), solo CPU; 1.5-1.6 con CUDA (RTX 5080, 32 GB, due NVMe) |
+| **MiMo-V2.6 Flash** (309B): visione e tool | `mimo-v2.6-flash` | 172 GB | 32 / 52 GB | Vulkan | 2.34-3.37 tok/s (A, CPU) |
+| **Qwen3.8-Flash-Next** (125B + 51B n-gram): visione e tool | `qwen38-flash-next` | 186 GB | 24 / 32 GB | CUDA, Vulkan (anche integrata) | 1.91-2.56 tok/s con 32-96 expert per layer; 3.99 con gli expert int4 opzionali (A, CPU) |
+| **GLM-5.2** (744B): il modello di riferimento, con la testa MTP | `glm-5.2` | 429 GB | 16 / 24 GB | CUDA, Vulkan | 0.05-0.1 tok/s a freddo su un portatile da 25 GB; 1.83 su un Ryzen AI Max+ 395 da 128 GB; 9.0-9.2 su 6x RTX 5090 |
+| GLM-5.3 (744B): lo stesso motore, senza testa MTP | `glm-5.3` | 419 GB | 16 / 24 GB | CUDA, Vulkan | |
+| **Inkling** (975B): expert int4, pesi densi bf16 | `inkling` | 514 GB | 120 / 128 GB così come scaricato; 25 GB dopo una [conversione della parte densa](docs/inkling.md) | CUDA, Vulkan | 0.25 tok/s (Ryzen 9 7900, 187 GB, RTX A6000) |
+| MiMo-V2.6 Pro (1.02T): visione e tool | `mimo-v2.6-pro` | 564 GB | 54 / 64 GB | Vulkan | 0.66-0.79 tok/s (A, CPU) |
+| **Kimi K3** (2.8T): il più grande | `kimi-k3` | 1.56 TB | 32 / 64 GB | CUDA, Vulkan | circa 9.4 s per token, expert letti a 6.3 GB/s |
-- **6× RTX 5090, residenza completa:** 5.8–6.8 tok/s in decode, TTFT ~13 s
- ([log dell'esperimento](docs/experiments/glm52-6x5090-2026-07-12.md));
-- **desktop solo-CPU da 128 GB:** ~1.8 tok/s a cache calda
- ([#200](https://github.com/JustVugg/colibri/issues/200));
-- **singola RTX 5070 Ti, classe laptop:** 1.07 tok/s tramite la pipeline
- GPU-residente ([#273](https://github.com/JustVugg/colibri/issues/273));
-- **macchina di sviluppo da 25 GB:** 0.05–0.1 tok/s a freddo — il punto di
- partenza dimostrato da cui è nato il progetto, e ancora oggi la baseline onesta.
+<a id="other-supported-models"></a>
-La qualità è misurata, non presunta: il costo di quantizzazione del container
-int4 e le ablazioni su granularità delle scale e rotazione sono in
-[docs/benchmarks.md](docs/benchmarks.md#quality-benchmark) e
-[#108](https://github.com/JustVugg/colibri/issues/108)/[#81](https://github.com/JustVugg/colibri/issues/81).
+**A mano: un passo di conversione o di preparazione dopo il download**
-## Per iniziare
+| Modello | Download, poi su disco | RAM | GPU | Misurato |
+|---|---|---|---|---|
+| **OLMoE** (7B): piccolo, per prendere confidenza con gli strumenti | 14 GB, 7 GB dopo la conversione in int8 | 8 GB | Vulkan | 22-23 tok/s (A, CPU) |
+| Qwen3.8-27B (denso): testo e immagini | 56 GB, 51 GB dopo la conversione | 20 GB in int4, 30 GB in int8 | Vulkan | 3.45 tok/s in int4, 2.1 in int8 (server CPU a 16 thread) |
+| **GLM-5.3-Flash** (321B): visione e tool | 328 GB, convertiti shard per shard in 195 GB | 25 GB | CUDA, Vulkan | circa 20 s per token a caldo, 44 s a freddo (6 core, 25 GB, disco normale) |
+| **DeepSeek V4.1 Flash** (552B): visione e tool, nessuna conversione ma una preparazione una tantum | 510 GB | circa 18 GB più la cache degli expert (24.8 GB di picco con 8 per layer) | Vulkan | 0.21-0.24 tok/s (server CPU a 16 thread che tiene il 68% degli expert) |
-Ti servono due cose: **il programma** (poche centinaia di KB) e **il modello**
-(429 GB). Guida passo passo per tutte le piattaforme nella
-[Quick Start](docs/quickstart.md).
+**Modelli di decisione** (rispondono alle domande di [System One](#system-one-a-decision-with-a-probability), non chattano)
-### In un solo passo
+| Modello | Download, poi su disco | RAM | GPU | Misurato |
+|---|---|---|---|---|
+| **Laya** (Convai Innovations), inglese | 0.85 GB | 1.7 GB | CPU | 219 ms per una domanda, 882 ms per tre (B) |
+| **GLiNER2.5-Decide** (fastino), inglese | 1.95 GB | 1.9 GB | CPU | 294 ms per una domanda, 897 ms per tre (B, sotto carico) |
+| **Clef** (Cloudflare): Qwen3.8-27B con una testa di decisione, sa anche chattare | 55 GB, 52 GB dopo la conversione | da 19 GB in int4 a 55 GB in f16 | CPU | 20.4 s per richiesta in int8 (A) |
+
+Le macchine:
+**A** un desktop Ryzen 7 PRO 8700GE (8 core, 61-64 GB DDR5, NVMe, Radeon 780M
+integrata);
+**B** un portatile i7-1355U;
+**C** una RTX 3070 da 8 GB in una macchina Threadripper 3945WX, con i layer densi
+e i layer DeltaNet sulla scheda (container int4 per-row).
+Ogni numero viene dalla pagina del suo modello in [docs/](docs/) o dalle
+[tabelle dei benchmark](docs/benchmarks.md), con le impostazioni esatte.
+
+Ogni famiglia ha la sua pagina: [qwen36.md](docs/qwen36.md) (Qwen3.6, Qwen3-Coder,
+Qwen3.8-27B), [qwen38.md](docs/qwen38.md), [deepseek-v4.md](docs/deepseek-v4.md),
+[deepseek-v41.md](docs/deepseek-v41.md), [mimo.md](docs/mimo.md),
+[glm53-flash.md](docs/glm53-flash.md), [inkling.md](docs/inkling.md),
+[kimi_k3.md](docs/kimi_k3.md), [qwen-image.md](docs/qwen-image.md),
+[laya.md](docs/laya.md), [gliner_decide.md](docs/gliner_decide.md),
+[clef.md](docs/clef.md), e GLM-5.2 nella [Quick Start](docs/quickstart.md#3-get-the-model).
+I checkpoint con la stessa architettura di uno supportato, come KAT-Coder v2.5
+sul motore Qwen3.6, girano senza modifiche.
+
+<a id="gpus"></a>
+
+## GPU
+
+### Nessuna GPU necessaria
+
+Ogni motore gira sulla CPU senza installare nient'altro. Una GPU è un posto più
+veloce dove tenere i pesi, non un requisito: per i modelli grandi la velocità la
+decide il disco, per quelli piccoli la RAM.
+
+### Vulkan: qualsiasi GPU
+
+Ogni motore MoE può usare qualsiasi GPU con un driver Vulkan 1.2 (AMD, Intel,
+NVIDIA, integrata o dedicata) in due modi:
+
+- **il livello degli expert**: una cache di expert instradati nella memoria
+ della GPU, riempita all'avvio con gli expert usati dalle tue conversazioni
+ passate e che si adatta mentre chatti. La GPU calcola gli expert che contiene
+ mentre la CPU calcola il resto;
+- **la catena densa**: un intero layer registrato come un unico invio alla GPU,
+ con lo stato corrente del modello tenuto sulla GPU da un layer al successivo.
+
+Misurato sulla Radeon 780M integrata della macchina A, con i file del modello
+tolti dalla page cache prima di ogni esecuzione, 100 token in decode
+([vulkan.md](docs/vulkan.md#the-chain-on-a-radeon-780m)):
+
+| | CPU | Vulkan, livello degli expert | Vulkan, livello e catena densa |
+|---|---|---|---|
+| Qwen3.6-35B-A3B, decode | 6.0 tok/s | 8.0 tok/s | **9.9 tok/s** |
+| Qwen3.6-35B-A3B, un prompt di 512 token | 35.7 s | 12.2 s | **9.5 s** |
+| Qwen3.8-Flash-Next (expert int4), decode | 3.5 tok/s | **3.8 tok/s** | 3.2 tok/s |
+| Qwen3.8-Flash-Next, un prompt di 512 token | 43.6 s | 38.7 s | **30.1 s** |
+| OLMoE, decode (a caldo) | **23.1 tok/s** | 12.8 tok/s | 17.3 tok/s |
+
+Una GPU integrata condivide la RAM della CPU. Quello che fa risparmiare è il
+lavoro e le letture dal disco degli expert che contiene: per questo conviene su
+un modello come Qwen3.6, mentre un modello piccolo i cui expert stanno già in
+RAM, come OLMoE, può perderci. Ecco perché l'installazione attiva Vulkan su una
+GPU integrata solo per Qwen3.6, Qwen3-Coder e Qwen3.8-Flash-Next, e perché ogni
+motore decide da sé se usare lì la catena densa (Qwen3.6 sì, Qwen3.8 no).
+`--backend vulkan` chiede Vulkan comunque.
+
+Su una GPU dedicata l'installazione compila Vulkan per ogni motore (prima CUDA,
+dove il motore ce l'ha e il toolkit è installato), con i layer densi sulla
+scheda. È il caso per cui il progetto è pensato, ed è **ancora da misurare:
+nessuna GPU dedicata ha ancora eseguito il livello degli expert o la catena
+densa.** (Prima di questi, il precedente percorso Vulkan di GLM-5.2 faceva
+1.7-1.8 tok/s in decode su una RX 9070 dedicata.) I numeri della tua scheda sono
+benvenuti.
+
+**Le schede senza Resizable BAR** ora funzionano. Una scheda così (tutte le
+Turing, le Ampere con il firmware di lancio, le AMD più vecchie con l'opzione
+disattivata) lascia scrivere direttamente alla CPU solo circa 256 MB della sua
+memoria; ora colibri copia i pesi passando per un buffer di staging, da solo. Il
+percorso è testato forzandolo ed emulando la finestra piccola su tre
+dispositivi, e non costa nulla di misurabile sulla 780M; non è stato misurato su
+una scheda senza Resizable BAR
+([vulkan.md](docs/vulkan.md#memory-placement-without-resizable-bar)).
+
+La CI verifica il percorso Vulkan di ogni motore contro i token della CPU su un
+driver software. La GPU somma i numeri in un ordine diverso e tiene alcune
+attivazioni in f32 dove la CPU le arrotonda, quindi una risposta lunga può
+discostarsi da quella della CPU di una parola
+([vulkan.md](docs/vulkan.md#the-other-engines)).
+
+### CUDA: schede NVIDIA
+
+L'installazione compila CUDA su Linux quando è installato il CUDA toolkit, per i
+motori che hanno un percorso CUDA: GLM-5.2/5.3, GLM-5.3-Flash, Inkling, Kimi K3,
+DeepSeek V4 Flash, Qwen3.8-Flash-Next, e Qwen3.6 con Qwen3-Coder. Su Windows il
+motore CUDA è una DLL separata ([windows.md](docs/windows.md)).
+
+- **Il livello degli expert in VRAM** tiene sulla scheda gli expert più caldi,
+ scelti in base al routing misurato; i miss vengono calcolati sulla CPU nello
+ stesso momento. Qwen3.6 su due schede da 8 GB (RTX 3070 e Quadro RTX 4000) ha
+ fatto 11.3 tok/s in decode con una cronologia calda
+ ([qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md)); GLM-5.2 su sei RTX 5090
+ con tutti gli expert residenti, 9.0-9.2 tok/s
+ ([benchmarks.md](docs/benchmarks.md)); DeepSeek V4 Flash su una RTX 5080,
+ 1.5-1.6 tok/s e un prompt di 3,324 token in 90 s
+ ([deepseek-v4.md](docs/deepseek-v4.md)).
+- **Novità per Qwen3.6: i layer DeltaNet sulla scheda** (`Q36_DN_GPU=1`,
+ opt-in). Ognuno dei 30 layer DeltaNet di Qwen3.6 copiava i suoi dati tra la
+ scheda e la CPU quattro volte per token; ora un token di decode esegue l'intero
+ layer sulla scheda, con il suo stato ricorrente tenuto in VRAM. Su una RTX
+ 3070 con i layer densi in VRAM: da 25.4 a 30.0 tok/s
+ ([qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md#the-deltanet-layer-on-the-card-q36_dn_gpu1)).
+- **Schede più vecchie.** Se il CUDA toolkit non compila più per la tua scheda
+ (CUDA 13 e una V100, in [#1852](https://github.com/JustVugg/colibri/issues/1852)),
+ la compilazione si ferma: `--backend vulkan` usa invece la scheda tramite
+ Vulkan. Il livello CUDA di DeepSeek V4 si compila anche per Pascal e Turing
+ (`CUDA_ARCH=portable-pre-ampere NO_TC=1`).
+
+Tutti i dettagli: [docs/cuda.md](docs/cuda.md).
+
+### Apple Silicon
+
+Un backend Metal esegue i calcoli degli expert sulla GPU a memoria unificata per
+diversi motori; compila con `METAL=1` ([docs/metal.md](docs/metal.md)). Su macOS
+l'installazione in un passo compila per la CPU.
+
+<a id="system-one-mode-ask-a-closed-question"></a>
+<a id="system-one-a-decision-with-a-probability"></a>
+
+## System One: una decisione con una probabilità
-**Windows:** scarica il repository (**Code**, poi **Download ZIP**, oppure
-`git clone`), scompattalo e fai doppio clic su **`START-HERE.bat`**.
-**Linux e macOS:**
+Gran parte di ciò che si chiede a un modello è una scelta, non un paragrafo:
+quale coda, quale verdetto, sì o no. `POST /v1/systemone` riceve uno stato (testo
+o JSON) e domande tipizzate, e risponde a ciascuna con la probabilità di ogni
+opzione ammessa e una confidenza. Non si genera nulla, quindi nessuna risposta
+può uscire dalla tua lista, e "il modello non è sicuro" è un numero su cui puoi
+mettere una soglia.
```bash
-git clone https://github.com/JustVugg/colibri && cd colibri
-./start-here.sh
+curl -s http://127.0.0.1:8000/v1/systemone -H 'Content-Type: application/json' -d '{
+ "state": "340 lines, 8 files, no tests. CI is green but nothing covers that path.",
+ "questions": {
+ "review": {"type": "choice", "instructions": "What should the reviewer do?",
+ "criteria": {"merge": null, "request changes": null, "close": null}},
+ "risky": {"type": "noul", "instructions": "Is this change risky?"}}}'
```
-Rileva RAM, disco e GPU, consiglia un modello adatto a questa macchina (Invio
-lo accetta), compila il motore con Vulkan o CUDA quando la tua GPU può usarli
-(oppure scarica quello già compilato), scarica il modello con ripresa
-(interrompilo quando vuoi, rilancialo per continuare) e apre la dashboard nel
-browser. Stampa anche gli URL base OpenAI e Anthropic per le altre app.
-Rilancialo più tardi e colibri parte subito; `c/coli stop` lo ferma. Cosa fa
-ogni passo: [quickstart.md](docs/quickstart.md#the-one-step-way).
+Un `choice` torna con l'etichetta scelta, una probabilità per ogni etichetta e
+una `confidence` da 0 (piatta) a 1 (certa); un `noul` con la probabilità del sì;
+uno `score` con il livello atteso.
-Usi un assistente di programmazione AI? Chiedigli di installare colibri seguendo [docs/AI_SETUP.md](docs/AI_SETUP.md).
-Gli assistenti che parlano il Model Context Protocol possono usare `coli mcp`
-([MCP_SERVER.md](docs/MCP_SERVER.md)).
+Chi risponde:
-Segue il percorso manuale.
+- **Qualsiasi modello di chat che colibri fa girare**, dando un punteggio: legge
+ la probabilità di ogni opzione invece di scrivere una risposta. Più domande
+ sullo stesso documento leggono il documento una volta sola: su Qwen3.6,
+ quattro domande su un documento sono tornate 5.7x più velocemente che
+ generando le stesse risposte sulla stessa macchina CPU.
+- **Tre modelli di decisione**, in modo nativo, in un solo forward pass con la
+ calibrazione stimata dai loro autori: [Laya](docs/laya.md) (Convai
+ Innovations), [GLiNER2.5-Decide](docs/gliner_decide.md) (fastino) e
+ [Clef](docs/clef.md) (Cloudflare; sa anche chattare). Dimensioni e velocità
+ sono nella [tabella dei modelli di decisione](#which-model-for-my-machine).
-### 1. Procurati colibri
+**Passare da Jev.** La richiesta e la risposta sono quelle dell'API Jev di
+TypeSafe, quindi un client Jev passa a colibri cambiando il base URL e
+nient'altro: `TYPESAFE_BASE_URL=http://127.0.0.1:8000` (la chiave che già invia
+viene accettata da un server avviato senza `COLI_API_KEY`). I due SDK ufficiali,
+senza modifiche, sono testati contro `coli serve`.
-**Scarica una release già compilata** — Linux, macOS e Windows, nessun
-compilatore necessario. Prendi l'archivio della tua piattaforma dalla pagina
-[Releases](https://github.com/JustVugg/colibri/releases) e scompattalo:
+La stessa modalità c'è nel terminale (`/decide merge | request changes | close`
+in `coli chat`) e nella pagina System One della dashboard. Richiesta e risposta
+complete, le regole di scoring e dove non aiuta:
+[docs/systemone.md](docs/systemone.md).
-```bash
-mkdir colibri && tar xzf colibri-v1.8.0-linux-x86_64.tar.gz -C colibri && cd colibri
-python3 coli info # engine ready ✓
-```
+## La dashboard
-Dentro trovi il motore (`colibri`, `colibri.exe` su Windows), il launcher `coli`
-e i suoi script Python di supporto. Niente da rinominare o configurare: `coli`
-trova il motore accanto a sé. Serve solo avere
-[Python 3](https://www.python.org/downloads/) installato — il launcher e il
-gateway API sono script Python, mentre il motore è C puro senza dipendenze.
+La apre `coli web`, e la apre anche l'installazione in un passo: la chat, la
+pagina System One, il Brain e la pagina Profiling, in tema chiaro o scuro.
-**Oppure compila dai sorgenti** — servono `gcc` (o clang) con OpenMP:
+<p align="center">
+ <img src="docs/media/colibri-dashboard.png" width="900" alt="la dashboard web di colibri: chat, metriche live, pannello hardware, livelli degli expert">
+</p>
+<p align="center"><em>Qwen3.6 che risponde su una macchina con sola CPU, con gli expert letti dal disco in streaming.</em></p>
-```bash
-git clone https://github.com/JustVugg/colibri && cd colibri/c
-./setup.sh # verifica gcc/OpenMP, compila, autotest
-```
+<p align="center">
+ <img src="docs/media/colibri-brio.png" width="900" alt="la pagina System One: un documento letto una volta, una probabilità per ogni risposta ammessa, e un'entropia">
+</p>
+<p align="center"><em><strong>System One</strong>: dai al modello un documento e le sole risposte che può scegliere. Qui:
+<strong>request changes al 99.9%</strong>, entropia 0.005, 4 token letti, 0 generati.</em></p>
-Vuoi `coli` nel PATH? Da un checkout, `pip install -e .` lo registra (il motore
-resta in `c/` — è un'installazione editabile dal clone, non un wheel).
+<p align="center">
+ <img src="docs/media/colibri-brain.png" width="900" alt="la pagina Brain: l'atlante misurato degli expert di GLM-5.2 disegnato come una corteccia, dieci regioni in cui entrare">
+</p>
+<p align="center"><em>Il <strong>Brain</strong>: l'<a href="https://github.com/JustVugg/colibri/issues/175">atlante misurato degli expert</a> di GLM-5.2,
+13,260 expert caratterizzati in dieci regioni (Python, SQL, matematica, poesia, legge, cinese...), posizionati in base
+all'affinità di routing misurata. <strong>Live routing</strong> mostra il modello in esecuzione: una cella per expert, colorata
+secondo il livello di archiviazione, e ogni expert instradato in un turno lampeggia.</em></p>
+
+La pagina **Profiling** mostra dove ogni turno spende il suo tempo, fase per
+fase, con gli ultimi 30 turni come tendenza.
+
+## Usarlo da altre app
+
+`coli serve` (che l'installazione avvia per te) è un unico server con diverse
+API:
+
+- **compatibile OpenAI**: `/v1/chat/completions`, `/v1/completions` e
+ `/v1/models`, con streaming, risposte JSON, sequenze di stop e logprobs;
+- **compatibile Anthropic**: `/v1/messages`, quindi Claude Code e gli SDK di
+ Anthropic funzionano con esso;
+- **tool calling** su ogni motore di chat tranne Inkling e OLMoE, ciascuno nel
+ formato nativo del suo modello ([la tabella per motore](docs/api.md#tool-calling-support));
+- **immagini in ingresso** su GLM-5.3-Flash, DeepSeek V4.1 Flash, MiMo-V2.6,
+ Qwen3.8-Flash-Next e Qwen3.8-27B: un percorso in un messaggio di `coli chat`,
+ un allegato in `coli web` o una parte `image_url`;
+- **immagini in uscita** con Qwen-Image-2.1 su `POST /v1/images/generations`,
+ disegnate anche dentro il terminale da `coli chat`
+ ([qwen-image.md](docs/qwen-image.md));
+- **decisioni** su `POST /v1/systemone` ([sopra](#system-one-a-decision-with-a-probability)).
+
+Le CLI di programmazione e gli editor si collegano come a qualsiasi provider
+compatibile OpenAI: base URL `http://127.0.0.1:8000/v1`, l'id del modello che
+stampa `coli status`, una chiave qualsiasi purché non vuota
+([docs/api.md](docs/api.md#connect-a-coding-cli-or-editor)).
+
+<a id="how-it-works"></a>
-### 2. Scarica il modello
+## Come funziona
-Un container **GLM-5.2 int4** pre-convertito è su Hugging Face — usa la build
-**group-scaled (gs64) con la testa MTP int8**. Pesa circa **429 GB**, quindi mettilo su un
-disco che abbia lo spazio, meglio se veloce:
+<p align="center">
+ <img src="docs/media/token-path.png" width="880" alt="instrada, unisci, piazza, sovrapponi, impara">
+</p>
-**https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp**
+Ogni layer di ogni token percorre gli stessi cinque passi: instrada, unisci,
+piazza, sovrapponi, impara. L'obiettivo progettuale è che **il piazzamento decida
+soltanto la velocità**: le decisioni del router e la precisione dei pesi sono le
+stesse sia che un expert risponda dalla VRAM, dalla RAM o dal disco.
-**GLM-5.3** è la stessa famiglia e si carica con lo stesso motore. Ha il suo
-container group-scaled (gs64), circa **419 GB**, e arriva **senza** la testa MTP,
-quindi la decodifica speculativa resta disattivata:
+<p align="center">
+ <img src="docs/media/tiers.png" width="880" alt="VRAM, RAM e NVMe come tre livelli di residenza degli expert">
+</p>
-**https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64**
+- **Un JIT per i pesi.** Un compilatore JIT non compila mai l'intero programma:
+ osserva cosa viene eseguito e compila i percorsi caldi. colibri fa la stessa
+ scommessa sui pesi. Il calore di routing misurato decide quali expert si
+ guadagnano la VRAM, la RAM o il disco: una cache LRU per layer, più un insieme
+ caldo fissato in memoria, appreso dalle tue conversazioni (`.coli_usage`,
+ aggiornato a ogni turno). colibri diventa più veloce più lo usi. Funziona
+ perché il routing ha una struttura misurabile
+ (l'[atlante degli expert](https://github.com/JustVugg/colibri/issues/175)).
+- **Mai aspettare il disco due volte.** Le tre matrici di un expert si leggono
+ con un solo `pread`; un pool di loader legge gli expert mancanti mentre quelli
+ residenti calcolano; un batch di posizioni legge ogni expert una volta sola; un
+ thread di lookahead del router può fare il prefetch del layer successivo (il
+ routing di GLM-5.2 è prevedibile al 71.6% un layer in anticipo). `DIRECT=1`
+ (O_DIRECT) spesso è un grande vantaggio sui dischi NVMe veloci e neutro o
+ peggiore sugli altri: misuralo sul tuo ([tuning.md](docs/tuning.md)).
+- **Più di un SSD.** `COLI_MODEL_MIRROR=/second/glm52_i4 ./coli chat --model /fast/glm52_i4`
+ legge da una copia su un secondo disco. Due NVMe su controller indipendenti
+ hanno misurato +37.5% in decode; funziona anche un mirror parziale su un disco
+ più piccolo ([multidisk.md](docs/multidisk.md)).
+- **Dal portatile al rack.** Su un portatile da 25 GB ogni expert viene letto
+ dal disco in streaming, lentamente e correttamente; su un host grande ogni
+ expert è residente (`CUDA_EXPERT_GB=auto PIN_GB=all`) e il disco esce dal
+ decode. `COLI_NUMA=1` distribuisce i pesi residenti tra i controller di
+ memoria di un host multi-socket, e una modalità cluster locale esegue gli
+ expert instradati su altre macchine ([cluster.md](docs/cluster.md)).
+- **Un modello fedele.** Ogni motore è verificato in CI contro l'implementazione
+ di riferimento del suo modello su una fixture minuscola. L'attenzione MLA di
+ GLM-5.2 tiene uno stato KV compresso (576 float per token invece di 32,768,
+ 57x più piccolo) che sopravvive ai riavvii, quindi una conversazione si riapre
+ senza un prompt da rileggere.
+- **Speculazione che si ripaga.** La testa MTP int8 di GLM-5.2 propone 2.2-2.8
+ token per forward quando conviene; la testa MTP di Qwen3.8-Flash-Next,
+ opt-in, aggiunge il 12-14% con lo stesso output. Dove il drafting costa più di
+ quanto fa risparmiare (DeepSeek V4) resta spento
+ ([tuning.md](docs/tuning.md#speculation-and-reproducibility)).
+
+Il motore è un file C per famiglia di modelli (`c/colibri.c` per GLM-5.2) sopra
+header condivisi, senza BLAS e senza Python a runtime: Python esegue solo
+l'installazione, il launcher, i convertitori e il gateway API.
+
+<a id="what-it-achieves"></a>
+
+## Benchmark
-> ⚠️ Usa il container **gs64** qui sopra, non i vecchi mirror int4 per-row
-> (`mateogrgic/…`, `jlnsrk/…`): misurano circa 9 punti percentuali in meno sulla
-> qualità e causavano i loop in think-mode e le generazioni senza termine originali
-> di [#455](https://github.com/JustVugg/colibri/issues/455). Il container gs64 ha
-> corretto quegli A/B per-row controllati, ma non è una protezione generale contro
-> ripetizioni o EOS starvation. Anche la testa MTP deve essere **int8, non int4**
-> (int4 → 0% di accettazione dei draft,
-> [#8](https://github.com/JustVugg/colibri/issues/8)):
-> `ls -l <modello>/out-mtp-*`: int8 (corretto) è `3527131672 / 5366238584 / 1065950496`
-> in tre file, oppure un solo `out-mtp-00000.safetensors` da `9959321520` byte
-> (il caricamento attuale del container consigliato lo distribuisce come un unico
-> file: stessi tensori int8, 777, a un byte per elemento).
+<p align="center">
+ <img src="docs/media/ladder.png" width="880" alt="velocità di decode di GLM-5.2 misurata per classe di hardware">
+</p>
-Oppure converti tu stesso dalla sorgente FP8 — un unico comando riprendibile che
-non richiede mai i 756 GB completi su disco contemporaneamente:
+Stesso motore e stesso container int4: l'hardware cambia solo dove risiedono gli
+expert. Decode di GLM-5.2, dalle [tabelle complete](docs/benchmarks.md):
-```bash
-./coli convert --model /nvme/glm52_i4 # scarica e converti shard per shard (python, una tantum)
-```
+- **6x RTX 5090, tutti gli expert residenti:** 5.8-6.8 tok/s, 9.0-9.2 con
+ l'interleave NUMA selettivo
+ ([log dell'esperimento](docs/experiments/glm52-6x5090-2026-07-12.md));
+- **128 GB, solo CPU** (Ryzen AI Max+ 395): 1.83 tok/s a caldo
+ ([#200](https://github.com/JustVugg/colibri/issues/200));
+- **una singola RTX 5070 Ti, macchina di classe laptop:** 1.07 tok/s
+ ([#273](https://github.com/JustVugg/colibri/issues/273));
+- **il portatile da 25 GB da cui tutto è cominciato:** 0.05-0.1 tok/s a freddo,
+ il minimo onesto.
-<a id="other-supported-models"></a>
-#### Altri modelli supportati
-
-GLM-5.2 è il modello di riferimento, ma lo stesso approccio in streaming fa girare
-altre nove famiglie di modelli linguistici, e un motore genera immagini. Ognuna è un
-**motore fratello**: un file C, la sua architettura, la stessa interfaccia
-`coli chat` / `coli serve` / `coli web` (il launcher sceglie il binario dal
-`config.json` del modello, o da `model_index.json` per il modello di immagini):
-
-> **Cosa serve a ciascuno.** Sono molto diversi, e leggerne due insieme ha fatto
-> credere ad alcuni che i requisiti si contraddicano
-> ([#191](https://github.com/JustVugg/colibri/issues/191)). Non è così: sono
-> modelli diversi. **Nessuno di loro richiede una GPU.**
->
-> | Modello | Disco per i pesi | RAM | GPU |
-> |---|---|---|---|
-> | **OLMoE** | ~7 GB (container int8) | 8 GB | non serve; Vulkan opzionale |
-> | **GLM-5.2/5.3** | ~429 GB (5.2) / ~419 GB (5.3) | 16 GB minimo, 24 GB comodi | non serve; Vulkan opzionale |
-> | **GLM-5.3-Flash** | ~195 GB dopo la conversione | 25 GB (12 GB di pesi a int4 + cache degli expert) | non serve; Vulkan opzionale |
-> | **Inkling** | ~469 GB | 25 GB con il container denso int4, ~120 GB senza | non serve; Vulkan opzionale |
-> | **Kimi K3** | ~1,6 TB | 32 GB+ | non serve; Vulkan opzionale |
-> | **DeepSeek V4 Flash** | ~167 GB (REAP 150B: ~85 GB) | 16 GB minimo, 32 GB comodi | opzionale; qualsiasi scheda NVIDIA dalla serie GTX 10 in su (Pascal/Turing con `CUDA_ARCH=portable-pre-ampere NO_TC=1`, al meglio su RTX 50) rende il prefill 5-10x e il decode ~2,5x più veloci; Vulkan opzionale |
-> | **DeepSeek V4.1 Flash** | ~510 GB (checkpoint ufficiale; 203 GB sono una memoria n-gram letta poche centinaia di byte alla volta) | ~18 GB residenti (parte densa, embedding, visione) più la cache degli expert dimensionata da `--ram`; 24,8 GB di RSS di picco misurati a cap 8 | non serve; Vulkan opzionale |
-> | **MiMo-V2.6 Flash** | ~178 GB (checkpoint ufficiale) | 30,1 GB residenti misurati con 32 expert in cache per layer, 49,8 GB con 64; `--ram` dimensiona la cache | non serve; Vulkan opzionale |
-> | **MiMo-V2.6 Pro** | ~574 GB (~564 GB senza i tre file che il motore non carica mai) | parte densa 30,2 GiB come rilasciata, 21,7 GiB in int8; 48,0 GB residenti misurati con 12 expert in cache per layer (parte densa come rilasciata), 50,7 GB con 20 (parte densa in int8) | non serve; Vulkan opzionale |
-> | **Qwen3.8-Flash-Next** | ~185,5 GB (checkpoint FP8 ufficiale), più 68,0 GB per il sidecar opzionale degli expert int4-g64 | 24 GB comodi al contesto predefinito con gli expert FP8 (cap 32; 16 GB sono sotto il minimo); 11,6 GB di RSS misurati a cap 32 con il sidecar int4-g64 | opzionale; il livello expert CUDA in VRAM (solo expert FP8) con il tronco denso quantizzato a int8 in VRAM; Vulkan opzionale |
-> | **Qwen3.8-27B** (denso, testo e immagini) | ~51 GB dopo la conversione (f16) | 20 GB con pesi densi int4, 30 GB in int8 | non serve; ancora nessun livello CUDA; Vulkan opzionale |
-> | **Qwen3.6-35B-A3B** | ~23 GB (container int4-gs64) | 24 GB (richiede la residenza completa in RAM) | opzionale; il livello expert CUDA in VRAM ha misurato **1,44 -> 10,05 tok/s (7,0x)** su due schede da 8 GB, output identico bit per bit alla CPU; Vulkan opzionale |
-> | **Qwen3-Coder-30B-A3B** | ~19 GB (container int4-gs64; 30 GB in int8) | 6,5 GB residenti misurati con 32 expert in cache per layer, 15,2 GB con tutti i 128 | non serve; Vulkan opzionale |
-> | **Qwen-Image-2.1** (da testo a immagine) | ~33 GB (checkpoint diffusers ufficiale) | 16,0 GB con tutto residente, 8,5 GB di picco con il text encoder caricato a ogni prompt, più i buffer di lavoro (9,0 GB di picco misurati per un'immagine 768x512) | non serve; Vulkan opzionale, non ancora cronometrato su GPU |
->
-> Una GPU non cambia mai ciò che il modello risponde, solo dove si svolge il
-> lavoro. La velocità la decide il disco, perché gli expert vengono letti in
-> streaming da lì: aspettati una frazione di token al secondo su un disco lento e
-> qualche token al secondo su uno veloce con la cache calda.
->
-> **Vulkan opzionale** significa una build `VK=1`. Avviato con `COLI_VULKAN=1`, il
-> motore mette le sue matrici residenti su qualsiasi GPU con un driver Vulkan 1.2
-> (GLM-5.2 ha lì un percorso di decode completo), e la CI verifica quei motori
-> contro i token della CPU su un driver
-> software ([vulkan.md](docs/vulkan.md#the-other-engines)). Corretto non vuol dire
-> ancora più veloce. Sulla prima GPU reale misurata per questi motori, una Radeon
-> 780M integrata (Ryzen 7 PRO 8700GE, stessi binari, page cache fredda), oggi è più
-> lento della CPU: Qwen3.6-35B-A3B ha fatto 3,06 tok/s in decode contro 5,97 sulla
-> CPU, con output identico, e Qwen3.8-Flash-Next con expert int4 1,53 contro 3,55.
-> Ogni matmul è una submit sincrona, circa 726 per token, e una GPU integrata legge
-> la stessa RAM della CPU.
-
-| Famiglia | Totali / attivi | Pesi | Build | Documentazione |
-|---|---|---|---|---|
-| **GLM-5.2/5.3** | 744B / 40B | [`mastouri/…-int4-g64-with-int8-mtp`](https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp) (429 GB) o [`Justvugg/GLM-5.3-colibri-int4-g64`](https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64) (419 GB) | `make -C c glm` | questa pagina |
-| **Inkling** (Thinking Machines) | 975B / 41B | [`nbeerbower/Inkling-colibri-int4`](https://huggingface.co/nbeerbower/Inkling-colibri-int4) (469 GB) | `make -C c inkling` | [inkling.md](docs/inkling.md) |
-| **GLM-5.3-Flash** (Z.ai) | 321B / 18B | [`zai-org/GLM-5.3-Flash`](https://huggingface.co/zai-org/GLM-5.3-Flash), convertito con gli expert instradati in **int4-gs64**; la parte densa resta BF16 e la sua precisione si sceglie al caricamento; visione inclusa | `make -C c glm53` | [glm53-flash.md](docs/glm53-flash.md) |
-| **Kimi K3** (Moonshot) | 2,8T / 104B | [`moonshotai/Kimi-K3`](https://huggingface.co/moonshotai/Kimi-K3): checkpoint originale, gli expert instradati restano **MXFP4 nativi** | `make -C c kimi_k3` | [kimi_k3.md](docs/kimi_k3.md) |
-| **DeepSeek V4 Flash** | 284B / 13B | checkpoint ufficiale in shard: gli expert instradati restano **fp4 nativi**, la parte densa resta fp8-e4m3; il **150B potato con REAP** ([`puwaer/DeepSeek-V4-Flash-0731-reap-150b`](https://huggingface.co/puwaer/DeepSeek-V4-Flash-0731-reap-150b), 85 GB, 132 expert su 256) si carica con lo stesso motore e senza conversione | `make -C c deepseek-v4` | [deepseek-v4.md](docs/deepseek-v4.md) |
-| **DeepSeek V4.1 Flash** | 552B / 16B | checkpoint ufficiale, **nessuna conversione**: gli expert sono già fp4, la parte densa è fp8-e4m3. 203 GB sono una memoria n-gram letta dal disco poche centinaia di byte alla volta, e gli expert instradati costano **4,5 GB per token** contro i 12,7 di GLM-5.2. Visione, tool calling e la testa di draft DSpark sono tutti attivi | `make -C c deepseek_v41` | [deepseek-v41.md](docs/deepseek-v41.md) |
-| **MiMo-V2.6 Flash** (Xiaomi) | 309B / 15B | [`XiaomiMiMo/MiMo-V2.6-Flash-MOPD`](https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Flash-MOPD) (178 GB), checkpoint ufficiale, **nessuna conversione**: gli expert instradati restano **MXFP4 nativi**, la parte densa resta FP8/BF16. 39 dei suoi 48 layer guardano una finestra di 128 token, quindi un contesto lungo costa il KV di 9. Visione e tool calling attivi | `make -C c mimo` | [mimo.md](docs/mimo.md) |
-| **MiMo-V2.6 Pro** (Xiaomi) | 1,02T / 42B | [`XiaomiMiMo/MiMo-V2.6-Pro-MOPD`](https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Pro-MOPD) (573,5 GB), checkpoint ufficiale, **nessuna conversione**, sul motore MiMo: la stessa architettura a 70 layer e 384 expert. Verificato contro il codice di modellazione di Xiaomi sui primi 32 dei suoi 70 layer. Visione e tool calling attivi | `make -C c mimo` | [mimo.md](docs/mimo.md#pro) |
-| **Qwen3.8-Flash-Next** (Alibaba) | 125B + 51B n-gram / 6B | [`Qwen/Qwen3.8-Flash-Next-FP8`](https://huggingface.co/Qwen/Qwen3.8-Flash-Next-FP8), checkpoint originale; la PLE resta paginabile e gli expert restano **block-FP8 nativi**, oppure vengono letti come **int4-g64** da un sidecar opzionale (vedi sotto). Draft MTP opt-in (`Q38_MTP=1`) | `make -C c qwen38` (`CUDA=1` per il livello expert in VRAM) | [qwen38.md](docs/qwen38.md) |
-| **Qwen3.6** (Alibaba) | 35B / 3B | [`Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64`](https://huggingface.co/Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64) (~23 GB, **consigliato**): ibrido Gated Attention + Gated DeltaNet | `make -C c qwen36` (`CUDA=1` per il livello expert in VRAM) | [qwen36.md](docs/qwen36.md) |
-| **Qwen3.8-27B** (Alibaba) | 27B, denso | [`Qwen/Qwen3.8-27B`](https://huggingface.co/Qwen/Qwen3.8-27B) convertito con `c/tools/convert_qwen36.py` in un container f16 (51 GB); il motore lo quantizza a int8, o a int4 con `COLI_DENSE_BITS=4`, durante il caricamento. Un MLP per layer e nessun router, sul motore Qwen3.6. Testo e immagini | `make -C c qwen36` | [qwen36.md](docs/qwen36.md#the-dense-27b) |
-| **Qwen3-Coder-30B-A3B** (Alibaba) | 30B / 3B | [`Justvugg/Qwen3-Coder-30B-A3B-colibri-int4`](https://huggingface.co/Justvugg/Qwen3-Coder-30B-A3B-colibri-int4) (19 GB, int4-gs64), convertito da [`Qwen/Qwen3-Coder-30B-A3B-Instruct`](https://huggingface.co/Qwen/Qwen3-Coder-30B-A3B-Instruct). MoE Qwen3 di sola attenzione sul motore Qwen3.6, 128 expert top-8, una sua forma XML per le chiamate ai tool e nessun thinking; in teacher forcing il container int4 sceglie il token top-1 della release bf16 nel 96,9% delle posizioni | `make -C c qwen36` | [qwen36.md](docs/qwen36.md#qwen3-coder-30b-a3b) |
-| **OLMoE** (AI2) | 7B / 1B | convertito con `c/tools/convert_olmoe_merged.py`: container **int8**, ~7 GB | `make -C c olmoe` | - |
-| **Qwen-Image-2.1** (Alibaba) | modello di immagini | [`Qwen/Qwen-Image-2.1`](https://huggingface.co/Qwen/Qwen-Image-2.1) (~33 GB), checkpoint diffusers ufficiale, **nessuna conversione**: il text encoder e il diffusion transformer vengono quantizzati a int8 durante il caricamento. Immagini dentro `coli chat`, `POST /v1/images/generations` su `coli serve`. Qwen Research License: solo uso non commerciale | `make -C c qwenimage` | [qwen-image.md](docs/qwen-image.md) |
-| **Laya** (Convai Innovations) | modello di decisione, 421M | [`convaiinnovations/laya`](https://huggingface.co/convaiinnovations/laya) (842 MB), checkpoint ufficiale, **nessuna conversione**: un encoder ModernBERT con una testa di decisione che risponde a domande tipizzate (choice, score, noul) con probabilità calibrate invece di generare. Servito su `POST /v1/systemone` da `coli serve`. Apache-2.0 | `make -C c laya` | [laya.md](docs/laya.md) |
-| **GLiNER2.5-Decide** (fastino) | modello di decisione, 340M | [`fastino/GLiNER2.5-Decide`](https://huggingface.co/fastino/GLiNER2.5-Decide) (1,9 GB), checkpoint ufficiale, **nessuna conversione**: un encoder DeBERTa-v3 con la testa di classificazione di GLiNER2; le domande di una richiesta e lo stato si leggono in un solo passaggio e ogni opzione riceve una probabilità. Servito su `POST /v1/systemone` da `coli serve`. Apache-2.0 | `make -C c gliner_decide` | [gliner_decide.md](docs/gliner_decide.md) |
-| **Clef** (Cloudflare) | modello di decisione + chat, 27B | [`Cloudflare/clef`](https://huggingface.co/Cloudflare/clef) (55 GB), convertito con `c/tools/convert_qwen36.py` (52 GB, testa inclusa): Qwen3.8-27B riaddestrato con una testa congiunta che dà un punteggio a ogni opzione di ogni domanda in un solo passaggio. `POST /v1/systemone` risponde in modo nativo, la chat funziona come su Qwen3.8-27B. Apache-2.0 | `make -C c qwen36` | [clef.md](docs/clef.md) |
-
-Qwen3.6 offre tre container pre-convertiti: **int4-gs64** (consigliato: coseno
-misurato rispetto all'ancora int8 da 0,98777 a 0,99313 e KL da 0,109 a 0,080
-rispetto al per-row, cioè ~44% di errore di quantizzazione in meno),
-[int4 per-row](https://huggingface.co/Kreuzzelg/qwen36-35b-a3b-colibri-i4) come
-baseline per gli A/B, e
-[KAT-Coder v2.5](https://huggingface.co/Kreuzzelg/kat-coder-v2.5-dev-colibri-i4-gs64),
-che lo stesso motore esegue senza modifiche: qualsiasi checkpoint con architettura
-identica funziona senza un percorso di codice dedicato. Con `CUDA=1` il livello
-expert in VRAM ha misurato **da 1,44 a 10,05 tok/s (7,0×) su due schede da 8 GB**,
-con output identico bit per bit al percorso CPU.
-
-Qwen3.8-Flash-Next legge i suoi expert instradati come rilasciati, in block-FP8. Un
-**sidecar int4-g64** opzionale (`c/tools/convert_qwen38_experts_int4.py`, 68,0 GB
-scritti accanto agli shard FP8) fa leggere a ogni miss il 56% dei byte. Misurato su
-un Ryzen 7 PRO 8700GE (16 thread, 61 GiB, NVMe), il decode è 1,4-1,5x più veloce a
-parità di cache e 1,56x più veloce a parità di RAM, per +0,017 nats per token di
-perplessità in media ([qwen38.md](docs/qwen38.md#routed-experts-as-int4-g64)). La
-decodifica speculativa con la testa MTP del checkpoint è opt-in (`Q38_MTP=1`), e
-l'output è identico alla decodifica normale. Sulla stessa macchina con gli expert
-int4, il 94-96% dei draft è stato accettato, 1,94 token per forward, per +12-14% di
-tok/s (da 3,57 a 4,01 a cap 96, da 4,15 a 4,74 a cap 170). Lì il guadagno è piccolo
-perché le letture degli expert dal disco non si riducono
-([qwen38.md](docs/qwen38.md)).
-
-Kimi K3 non richiede conversione: i suoi expert MXFP4 addestrati con QAT vengono
-letti in streaming direttamente dagli shard originali di Hugging Face, e la parte
-densa bf16 viene quantizzata al caricamento. Le sessioni lunghe degli agenti
-possono attivare i checkpoint dello stato ricorrente (`COLI_K3_CKPT=N` slot in RAM,
-o parcheggiati su disco con `COLI_K3_CKPT_DIR`): un prompt modificato o di
-follow-up ripristina il checkpoint più profondo ancora disponibile e rifà il
-prefill solo della coda, invece di ripercorrere l'intera conversazione attraverso i
-layer SSM. Sugli host Vulkan (`COLI_VULKAN=1`) i suoi expert instradati entrano nel
-livello di expert condiviso, riempito dalla storia degli expert e aggiornato man mano
-che il routing cambia. I percorsi KDA e MLA del motore sono
-validati token-esatti in CI contro l'implementazione del vendor.
-
-Inkling distribuisce expert int4 ma **pesi densi bf16** (49,4 GB residenti); su un
-host che non può tenerli, [inkling.md](docs/inkling.md) ha uno strumento a passata
-singola che porta la parte densa a 15,3 GB e fa girare il 975B su una macchina da
-25 GB, con il compromesso messo onestamente per iscritto.
-
-### 3. Esegui
+La qualità è misurata, non presunta: il costo del container int4 e le ablazioni
+sulla quantizzazione sono in
+[benchmarks.md](docs/benchmarks.md#quality-benchmark). Per aggiungere la tua
+macchina, segui il [protocollo di benchmark](docs/benchmarking.md) e apri una
+issue con i numeri.
-```bash
-COLI_MODEL=/nvme/glm52_i4 ./coli chat # budget RAM, cache e MTP rilevati automaticamente
-COLI_MODEL=/nvme/glm52_i4 ./coli plan # mostra il piazzamento pianificato VRAM/RAM/disco
-COLI_MODEL=/nvme/glm52_i4 ./coli doctor # controllo di idoneità (sola lettura)
-COLI_MODEL=/nvme/glm52_i4 ./coli doctor --deep # controllo preliminare rigoroso di tensori/shard/indice/mirror
-COLI_MODEL=/nvme/glm52_i4 ./coli tune # misura e salva il profilo di esecuzione sicuro più veloce di questa macchina
-./coli web --model /nvme/glm52_i4 # API + dashboard, e apre un browser
-./coli serve --model /nvme/glm52_i4 # API + dashboard, senza browser (headless)
-```
+<a id="install-by-hand"></a>
-#### Modalità System One: una domanda a risposta chiusa
+## Installazione a mano
-Gran parte di ciò che si chiede a un modello è una scelta, non un paragrafo:
-quale coda, quale verdetto, quale dei quattro valori può prendere un campo. La
-modalità System One passa al motore le opzioni e legge la probabilità di ciascuna
-invece di generare: non si genera nulla, nessuna risposta può uscire dalla tua
-lista, e ogni risposta arriva con una confidenza, così "il modello non è sicuro"
-è un numero su cui mettere una soglia. Funziona su tutte e dieci le famiglie,
-sullo stesso server, ed è opzionale per richiesta: la chat resta identica byte
-per byte per chi non la chiede.
+<a id="1-get-colibri"></a>
-```bash
-# nella TUI: lo stesso modello, a cui si dice di non scrivere
-./coli chat --model /nvme/qwen36_i4_gs64
-> /decide merge | request changes | close
-> 340 lines, 8 files, no tests. CI is green but nothing covers that path.
+**1. Il programma.** Prendi l'archivio per la tua piattaforma da
+[Releases](https://github.com/JustVugg/colibri/releases) (Linux x86_64, macOS,
+Windows; non serve un compilatore, solo [Python 3](https://www.python.org/downloads/)
+per il launcher e l'API) ed estrailo, poi `python3 coli info`. Oppure compila dai
+sorgenti con `gcc` (o clang) e OpenMP:
-# da qualunque programma: una richiesta JSON al server in esecuzione
-curl -s http://127.0.0.1:8000/v1/systemone -H 'Content-Type: application/json' -d '{
- "state": "340 lines, 8 files, no tests. CI is green but nothing covers that path.",
- "questions": {"review": {"type": "choice", "instructions": "What should the reviewer do?",
- "criteria": {"merge": null, "request changes": null, "close": null}}}}'
+```bash
+git clone https://github.com/JustVugg/colibri && cd colibri/c
+./setup.sh # checks gcc/OpenMP, builds, self-tests
+make qwen36 VK=1 # one engine, here with Vulkan (CUDA=1 for CUDA)
```
-`POST /v1/systemone` parla la richiesta e la risposta dell'API Jev di TypeSafe:
-un client Jev passa a colibri cambiando solo il base URL. Più domande sullo
-stesso documento lo leggono una volta sola: misurato su Qwen3.6 contro la
-generazione delle stesse risposte sulla stessa macchina CPU, 5,7x su quattro
-domande sullo stesso documento. Tutta la modalità, la forma di richiesta e
-risposta, e dove non serve: [docs/systemone.md](docs/systemone.md). Anche la
-dashboard ha una pagina System One.
-
+<a id="2-get-the-model"></a>
-Su Windows un archivio di release include `coli.cmd`: fai doppio clic per l'avvio
-rapido, oppure esegui `coli.cmd chat --model D:\glm52_i4` da cmd o PowerShell. Da
-un checkout dei sorgenti gli stessi comandi funzionano con `python coli chat --model
-D:\glm52_i4`. I file `.exe` sono i motori, non il launcher: avviati da soli non
-hanno un modello da caricare ed escono subito.
-Il motore a runtime è puro C: python si usa solo per il convertitore (una tantum)
-e per il gateway API opzionale.
+**2. Un modello.** Qualsiasi download delle [tabelle qui sopra](#which-model-for-my-machine):
+gli id dell'installazione corrispondono a repository Hugging Face, e la pagina di
+ogni modello riporta il comando di download e di conversione. Per GLM-5.2 usa il
+container group-scaled (gs64) con la testa MTP int8,
+[`mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp`](https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp)
+(429 GB), oppure [`Justvugg/GLM-5.3-colibri-int4-g64`](https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64)
+per GLM-5.3 (419 GB, senza testa MTP). Non i vecchi mirror int4 per-row:
+misurano circa 9 punti in meno sulla qualità e hanno causato le risposte in loop
+di [#455](https://github.com/JustVugg/colibri/issues/455).
+`./coli convert --model /nvme/glm52_i4` costruisce lo stesso container dalla
+release FP8, shard per shard, senza mai aver bisogno di tutti i suoi 756 GB su
+disco nello stesso momento. Come controllare la testa MTP e il resto:
+[quickstart.md](docs/quickstart.md#3-get-the-model).
-#### Gli stessi comandi per tutti i modelli
+<a id="3-run-it"></a>
-`coli` legge il `config.json` del modello, sceglie il binario del motore
-corrispondente e applica il chat template di quella famiglia: quindi **la riga di
-comando non cambia tra un modello e l'altro**. Compila una volta il motore che ti
-serve, poi punta `COLI_MODEL` alla directory giusta:
+**3. Avvialo.** Da `c/` in un checkout dei sorgenti, o dalla release estratta.
+Il launcher legge il `config.json` del modello e sceglie il motore e il suo chat
+template, quindi i comandi sono gli stessi per ogni modello:
```bash
-make -C c glm # GLM-5.2
-make -C c inkling # Inkling
-make -C c kimi_k3 # Kimi K3
-
-COLI_MODEL=/nvme/glm52_i4 ./coli chat # TUI
-COLI_MODEL=/nvme/inkling_i4 ./coli chat
-COLI_MODEL=/nvme/kimi_k3 ./coli chat
-
-./coli web --model /nvme/inkling_i4 # API + dashboard, opens a browser
-./coli web --model /nvme/kimi_k3
-./coli serve --model /nvme/inkling_i4 # API + dashboard, no browser
+./coli chat --model /nvme/qwen36 # chat in the terminal
+./coli web --model /nvme/qwen36 # API + dashboard, opens a browser
+./coli serve --model /nvme/qwen36 # API + dashboard, no browser
+./coli plan --model /nvme/qwen36 # where the model will live: VRAM, RAM, disk
+./coli doctor --model /nvme/qwen36 # read-only check: is everything ready?
+./coli tune --model /nvme/qwen36 # measure and save this machine's fastest safe settings
```
-Per i motori diversi da GLM, `coli chat` avvia il gateway in locale e ci collega
-la TUI, così TUI, API e dashboard passano tutti per lo stesso chat template che
-conosce l'architettura: non devi mai passare il template a mano.
+Su Windows un archivio di release include `coli.cmd` (`coli.cmd chat --model
+D:\qwen36`); da un checkout dei sorgenti usa `py -3 c\coli`. I file `.exe` sono
+i motori, non il launcher. Tutte le opzioni e le variabili:
+[SETTINGS.md](docs/SETTINGS.md), [ENVIRONMENT.md](docs/ENVIRONMENT.md).
-Due cose cambiano da un modello all'altro, entrambe documentate nella pagina del
-modello:
+## Ricerca, e come aiutare
-- **Inkling su un host con poca RAM** richiede il container denso int4 e una cache
- degli expert piccola: `./coli chat --model /nvme/inkling_i4 --cap 2`
- (vedi [inkling.md](docs/inkling.md): il `--cap 8` predefinito vuole ~14 GB di
- cache oltre al set residente).
-- **Kimi K3** legge in streaming i suoi expert MXFP4 dal checkpoint originale,
- quindi non c'è niente da convertire, ma lo snapshot è di ~1,6 TB
- (vedi [kimi_k3.md](docs/kimi_k3.md)).
+colibri vuole che i modelli di frontiera dipendano meno da hardware scarso e
+costino meno da far girare. Questo significa cambiare il modo in cui i pesi sono
+memorizzati e spostati, decidere cosa sta in VRAM, in RAM o nello storage,
+sovrapporre il lavoro di CPU e GPU, e provare nuovi modi di fare decode. Niente
+si tiene perché è convenzionale, e niente si adotta perché un microbenchmark
+sembra veloce: il risultato che decide è l'inferenza end-to-end su macchine
+reali, con la qualità misurata insieme alla velocità. Le domande aperte:
-### 4. Approfondisci
+| ipotesi | evidenza finora | esperimento ancora necessario |
+|---|---|---|
+| La cronologia di routing può piazzare gli expert meglio di una semplice LRU | i pin appresi migliorano i carichi ripetuti, ma possono sovradattarsi a un prompt | A/B cross-session su dati esclusi dall'apprendimento, con carichi di codice, chat, multilingua e contesto lungo |
+| Più SSD possono trasformare banda indipendente in velocità di decode | due NVMe indipendenti hanno misurato +37.5% in decode; un terzo disco più lento è risultato neutro dopo lo striping pesato ([misure](docs/multidisk.md#what-has-been-measured)) | riprodurre con dischi di velocità diverse, disposizioni diverse dei controller e diversi stati della cache |
+| Un planner consapevole dell'hardware può avvicinarsi automaticamente alla configurazione migliore di ogni macchina | oggi si rilevano i budget di RAM/VRAM e diversi backend, e l'installazione sceglie la build | confrontare il piano generato con uno sweep controllato dei parametri su portatili, workstation, host NUMA e sistemi multi-GPU |
+| Rappresentazioni lossless o a qualità limitata possono ridurre il movimento dei pesi abbastanza da fare la differenza | esistono ablazioni di formato e di quantizzazione, con gate di correttezza/qualità | riprodurre insieme qualità, byte spostati, latenza e costo per token utile, non solo il rapporto di compressione |
+| La speculazione consapevole del routing può convenire prima della residenza quasi completa | MTP e draft da grammatica funzionano, ma MTP ha anche misurato una perdita del 32% intorno all'85% di expert hit | mappare la superficie di pareggio tra accettazione, hit rate degli expert, batch union e profondità del draft |
+| La sovrapposizione CPU/GPU può nascondere trasferimenti e sincronizzazione invece di spostare soltanto il collo di bottiglia | esistono vantaggi con CUDA, Metal e Vulkan, ma CPU veloci, GPU integrate e bassa residenza possono annullarli | profili per fase e A/B a una variabile su macchine PCIe, a memoria unificata e a residenza completa, e i primi numeri su GPU dedicata per il livello e la catena Vulkan |
+
+Vuoi aiutare? Scegli una riga e pubblica anche i risultati negativi. Registra
+hardware, commit, modello, comando esatto, prompt, stato della cache,
+throughput, tempo al primo token, hit rate degli expert, byte letti e un
+controllo di qualità; cambia una sola variabile, ripeti e allega i log grezzi.
+Parti da [CONTRIBUTING.md](CONTRIBUTING.md) e dal [protocollo di benchmark](docs/benchmarking.md),
+poi [apri una issue](https://github.com/JustVugg/colibri/issues/new). Qui un
+fallimento ben controllato vale più di un numero veloce senza spiegazione.
+
+## Documentazione
| argomento | documento |
|---|---|
-| Benchmark, dati dalla comunità, misurazioni di qualità | [docs/benchmarks.md](docs/benchmarks.md) |
-| Protocollo di benchmark riproducibile e report minimo | [docs/benchmarking.md](docs/benchmarking.md) |
-| Parametri di tuning, policy, cache che impara, prefetch | [docs/tuning.md](docs/tuning.md) |
-| Build nativa su Windows 11 (con CUDA DLL) | [docs/windows.md](docs/windows.md) |
-| Backend CUDA, livello expert in VRAM, residenza completa | [docs/cuda.md](docs/cuda.md) |
-| Backend Vulkan (qualsiasi GPU: AMD tramite RADV, comprese le schede non più supportate da ROCm) | [docs/vulkan.md](docs/vulkan.md) |
-| Backend Metal per Apple Silicon | [docs/metal.md](docs/metal.md) |
-| API compatibile OpenAI, KV slot, dashboard web | [docs/api.md](docs/api.md) |
-| Modalità System One: punteggiare un insieme chiuso di opzioni invece di generare | [docs/systemone.md](docs/systemone.md) |
-| ABI sperimentale di embedding per segmenti di layer | [docs/segment-runtime.md](docs/segment-runtime.md) |
-| ABI Edge sperimentale per tokenizer/embedding/head | [docs/edge-runtime.md](docs/edge-runtime.md) |
-| Draft forzati da grammatica (output strutturato) | [docs/grammar-draft.md](docs/grammar-draft.md) |
-| Inventario delle variabili d'ambiente | [docs/ENVIRONMENT.md](docs/ENVIRONMENT.md) |
-
-## DeepSeek V4
-
-**DeepSeek V4 Flash** legge in streaming il checkpoint ufficiale senza conversione:
-gli expert instradati restano **fp4 nativi**, la parte densa resta **fp8-e4m3** con
-scale di blocco UE8M0. Attenzione sparsa MLA + DSA, 43 layer, 256 expert instradati
-più uno condiviso, top-6. Supportato su Linux x86-64/aarch64 e su Windows/MSYS2
-(CPU), con un livello CUDA opzionale (DLL di runtime su Windows; link diretto
-`CUDA=1` su Linux, verificato sotto WSL2) che mantiene ogni fase canonica rispetto
-alla CPU e ripiega fase per fase.
-
-```bash
-cd c
-make deepseek-v4
-python ./coli chat --model /path/to/DeepSeek-V4-Flash --ram 32
-# also: coli run / coli serve / coli web
-# Windows CUDA tier: make cuda-dsv4-dll CUDA_ARCH=portable (+ make cuda-dsv4-dg-dll on RTX 50)
-```
-
-Due leve GPU opt-in sono nuove e cercano numeri dalla comunità, entrambe disattivate
-per default e identiche byte per byte quando non impostate: `DSV4_HYBRID=1` divide i
-miss del livello VRAM tra il ramo di riempimento GPU e il ramo CPU usando le bande
-misurate a runtime, e `COLI_CUDA_MOE_DOUBLE=1` (insieme a `COLI_CUDA_MOE_BATCH=1`)
-precarica l'intero set di expert del layer successivo in un secondo banco di VRAM
-mentre il layer corrente calcola, e ripiega sul banco singolo quando la VRAM non
-basta. Il livello CUDA ora gira anche sulle schede Pascal e Turing (serie GTX 10 /
-RTX 20): compila con `CUDA_ARCH=portable-pre-ampere NO_TC=1`.
-
-Decode greedy e un solo slot KV. Il tool calling passa per il gateway HTTP con il
-prompt nativo di V4 e i blocchi di chiamata DSML; la grammatica non è supportata.
-Vedi la [matrice API per motore](docs/api.md#tool-calling-support). I checkpoint di
-prefisso (in memoria e su disco) fanno partire le sessioni degli agenti e i turni
-successivi in pochi secondi dopo il primo prefill di un system prompt. Misurato su
-una RTX 5080 + 2 NVMe: prefill di 3324 token in 90 s, primo turno di 8,3k token in
-~4 min una volta sola, sessioni e turni successivi in 6-9 s, decode ~1,6 tok/s a 3k
-di contesto: vedi [docs/deepseek-v4.md](docs/deepseek-v4.md).
-
-**Dagli RAM.** 43 × 256 expert instradati occupano ~137 GiB su disco e un token ne
-tocca 301, quindi è il tasso di hit della cache degli expert a decidere i tok/s:
-`--ram` è la manopola più preziosa in assoluto, e cambia solo la velocità, mai
-l'output.
-
-**Il drafting speculativo esiste ed è spento.** Il drafter markoviano di DSpark e
-l'MTP completo sono entrambi implementati e verificati: un draft può risparmiare
-forward pass ma non cambiare mai un token, perché ogni token accettato è comunque
-l'argmax del modello target. Misurati su vere chat a più turni, hanno accettato 1
-su 15 e 10 su 24, e il replay del suffisso rifiutato sullo stato di attenzione
-ricorrente di questo motore è costato più di quanto i draft abbiano risparmiato:
-una risposta di 14 token ha richiesto 495 secondi. Per questo `V4_DRAFT` e `V4_MTP`
-sono `0` per default e il codice resta, con i numeri accanto, per chi vorrà
-riprovarci su uno storage più veloce.
-
-Vedi [docs/deepseek-v4.md](docs/deepseek-v4.md) per il livello CUDA (build, scelta
-della DLL, copertura GPU), il riferimento delle variabili d'ambiente, i numeri di
-prestazione, la validazione del checkpoint e l'oracle tiny indipendente generato.
-
-## Prossimi passi
-
-- **La ricerca sui sistemi di inferenza è il prodotto.** La gerarchia attuale usa
- LRU e un insieme appreso di expert fissati; il lavoro attivo copre formati,
- compressione, piazzamento, scheduling, I/O, kernel CPU/GPU, sovrapposizione
- eterogenea, stato KV e speculazione consapevole del routing. L'obiettivo è
- ridurre i requisiti hardware e il costo per token utile, con risultati misurati
- end-to-end, revisionati e sviluppati apertamente.
-- **Più modelli aperti.** L'algoritmo di tiering è indipendente dal modello:
- qualsiasi MoE con expert instradati può essere organizzato allo stesso modo.
- Dieci famiglie di modelli linguistici funzionano già (GLM-5.2/5.3, GLM-5.3-Flash
- con la visione, Inkling, Kimi K3, DeepSeek V4 Flash, DeepSeek V4.1 Flash,
- MiMo-V2.6, Qwen3.8-Flash-Next, Qwen3.6, OLMoE), più Qwen-Image-2.1 per le
- immagini; altre famiglie open-weight, **MiniMax** tra le candidate, si guadagnano
- un engine come queste: quando qualcuno le misura end-to-end.
-
-## Sostenere il progetto
-
-colibrì è nato come progetto di una sola persona su un portatile con 12 core
-e 25 GB di RAM; oggi i suoi numeri arrivano da una comunità di macchine reali.
-Se ti è utile:
-
-- ⭐ metti una stella al repository e condividilo;
-- 🐛 apri issue con i numeri di benchmark del tuo hardware — i datapoint
- fanno avanzare questo progetto più di qualsiasi altra cosa;
-- 💬 entra nella [comunità Discord](https://discord.gg/RXV83nSZdk) per discutere
- esperimenti, risultati hardware e direzioni di ricerca;
-- 💬 contattaci via GitHub issues per sponsorizzare lo sviluppo o donare hardware.
+| L'installazione in un passo e quella manuale, per ogni piattaforma | [quickstart.md](docs/quickstart.md) |
+| Installare tramite un assistente AI, e il server MCP | [AI_SETUP.md](docs/AI_SETUP.md), [MCP_SERVER.md](docs/MCP_SERVER.md) |
+| L'API: OpenAI, Anthropic, tool, slot KV, dashboard | [api.md](docs/api.md) |
+| System One e i modelli di decisione | [systemone.md](docs/systemone.md), [laya.md](docs/laya.md), [gliner_decide.md](docs/gliner_decide.md), [clef.md](docs/clef.md) |
+| Vulkan: il livello degli expert, la catena densa, le schede senza Resizable BAR | [vulkan.md](docs/vulkan.md) |
+| CUDA, e il livello CUDA di Qwen3.6 | [cuda.md](docs/cuda.md), [qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md) |
+| Apple Silicon, Windows | [metal.md](docs/metal.md), [windows.md](docs/windows.md) |
+| Tuning, la cache che impara, prefetch, speculazione | [tuning.md](docs/tuning.md) |
+| Più SSD, più macchine | [multidisk.md](docs/multidisk.md), [cluster.md](docs/cluster.md) |
+| Benchmark e come misurare | [benchmarks.md](docs/benchmarks.md), [benchmarking.md](docs/benchmarking.md) |
+| Ogni opzione e variabile d'ambiente | [SETTINGS.md](docs/SETTINGS.md), [ENVIRONMENT.md](docs/ENVIRONMENT.md) |
+| Draft forzati da grammatica, e le ABI sperimentali di embedding | [grammar-draft.md](docs/grammar-draft.md), [segment-runtime.md](docs/segment-runtime.md), [edge-runtime.md](docs/edge-runtime.md) |
## Struttura del repository
```
-Makefile punto d'ingresso root per build/check
+start-here.sh, START-HERE.bat the one-step setup (Linux and macOS, Windows)
+Makefile root build/check entry point
c/
-├── colibri.c motore GLM-5.2 (make glm)
-├── inkling.c motore Inkling (make inkling)
-├── kimi_k3.c motore Kimi K3 (make kimi_k3)
-├── glm53.c motore GLM-5.3-Flash (make glm53)
-├── deepseek_v4.c motore DeepSeek V4 Flash (make deepseek-v4)
-├── deepseek_v41.c motore DeepSeek V4.1 Flash (make deepseek_v41)
-├── mimo.c motore MiMo-V2.6 Flash e Pro (make mimo)
-├── qwen38.c motore Qwen3.8-Flash-Next (make qwen38)
-├── qwen36.c motore Qwen3.6, Qwen3-Coder, Qwen3.8-27B (make qwen36)
-├── olmoe.c motore OLMoE (make olmoe)
-├── qwenimage.c motore Qwen-Image-2.1 (make qwenimage)
+├── colibri.c GLM-5.2/5.3 engine (make glm)
+├── glm53.c GLM-5.3-Flash (make glm53)
+├── inkling.c Inkling (make inkling)
+├── kimi_k3.c Kimi K3 (make kimi_k3)
+├── deepseek_v4.c DeepSeek V4 Flash (make deepseek-v4)
+├── deepseek_v41.c DeepSeek V4.1 Flash (make deepseek_v41)
+├── mimo.c MiMo-V2.6 Flash and Pro (make mimo)
+├── qwen38.c Qwen3.8-Flash-Next (make qwen38)
+├── qwen36.c Qwen3.6, Qwen3-Coder, Qwen3.8-27B, Clef (make qwen36)
+├── olmoe.c OLMoE (make olmoe)
+├── qwenimage.c Qwen-Image-2.1 (make qwenimage)
+├── laya.c Laya (make laya)
+├── gliner_decide.c GLiNER2.5-Decide (make gliner_decide)
│
-├── st.h indice safetensors e letture a intervalli
-├── quant.h decoder canonici dei container
-├── expert_ffn.h kernel FFN degli expert instradati condiviso dai motori MoE (int4 planare, runner di layer)
-├── tok.h, json.h tokenizer e parser JSON
-├── compat.h shim per Windows/macOS (nomi POSIX, in un solo posto)
-├── expert_store.h cache degli expert in streaming
-├── route_trace.h telemetria di routing e .coli_usage, indipendente dal motore
-├── kv_prefix.h riuso del prefisso KV tra i turni
+├── st.h, quant.h, idot.h safetensors reads, container decoders, integer kernels
+├── expert_ffn.h, expert_store.h routed-expert kernel and streaming expert cache
+├── tok.h, json.h, compat.h tokenizer, JSON, Windows/macOS shims
+├── route_trace.h, kv_prefix.h routing telemetry (.coli_usage), KV prefix reuse
+├── decide_serve.h the decision engines' side of System One
│
-├── backend_cuda.* livello CUDA opzionale (CUDA=1)
-├── backend_metal.* livello Metal opzionale (METAL=1)
-├── backend_vulkan.* livello Vulkan opzionale (VK=1)
+├── backend_cuda.* optional CUDA tier (CUDA=1)
+├── backend_metal.* optional Metal tier (METAL=1)
+├── backend_vulkan.*, vk_tier.c, vk_chain.c optional Vulkan tier and dense chain (VK=1)
│
-├── Makefile build e check locali
-├── coli CLI utente
-├── openai_server.py gateway HTTP compatibile OpenAI
-├── resource_plan.py planner RAM/VRAM dietro `coli plan` e `coli doctor`
-├── tools/ conversione offline, fixture e benchmark
-├── scripts/ helper per conversioni lunghe
-└── tests/ test C e Python senza dipendenze
-web/ UI browser (puro client API OpenAI)
-desktop/ shell desktop Tauri v2 che racchiude la web UI
-docker/ immagini container
-docs/ documentazione di riferimento, esperimenti, media
+├── coli user-facing CLI
+├── setup_*.py the one-step setup: hardware, catalog, downloads, flow
+├── mcp_server.py the MCP server (coli mcp)
+├── openai_server.py OpenAI- and Anthropic-compatible HTTP gateway
+├── resource_plan.py RAM/VRAM planner behind coli plan and coli doctor
+├── tools/ conversion, fixtures and benchmarks
+└── tests/ dependency-free C and Python tests
+web/ the dashboard (a pure API client)
+desktop/ Tauri desktop shell around the dashboard
+docker/ container images
+docs/ reference docs, experiments, media
+site/ the website
```
**Un `.c` per famiglia di modelli, sopra header singoli condivisi.** Un motore
-possiede la sua architettura e nient'altro; tutto ciò che serve a due motori (il
-lettore safetensors, i decoder dei container, il tokenizer, la cache degli expert)
-vive in un header che entrambi includono, così una correzione li raggiunge tutti
-insieme. Questa regola non è decorativa: i difetti che continuano a ripresentarsi
-qui sono quelli in cui un meccanismo è arrivato in un motore e non ha mai raggiunto
-i suoi fratelli.
+possiede la sua architettura e nient'altro; tutto ciò che serve a due motori vive
+in un header che entrambi includono, così una correzione li raggiunge tutti
+insieme. Dalla radice del repository, `make`, `make check` e `make clean`
+delegano al Makefile del motore.
-Dalla radice del repository, `make`, `make check` e `make clean` delegano al
-Makefile del motore.
+## Sostenere il progetto
-## Perché "colibrì"
+colibri è nato come progetto di una sola persona su un portatile con 12 core e
+25 GB di RAM; oggi i suoi numeri arrivano da una comunità di macchine reali. Se
+ti è utile:
-Il colibrì pesa pochi grammi, sta sospeso nel vuoto e visita un migliaio di
-fiori al giorno. Questo motore tiene in vita un gigante da 744 miliardi di
-parametri con le razioni di un colibrì: 25 GB di RAM, dodici core CPU e
-tanta pazienza col disco.
+- metti una stella al repository e condividilo;
+- apri issue con i numeri di benchmark del tuo hardware: i datapoint fanno
+ avanzare questo progetto più di qualsiasi altra cosa;
+- entra nella [comunità Discord](https://discord.gg/RXV83nSZdk) per discutere
+ esperimenti, risultati hardware e direzioni di ricerca;
+- contattaci tramite le issue di GitHub per sponsorizzare lo sviluppo o donare
+ hardware.
+
+## Perché "colibrì"
-Il nome è rimasto in italiano perché questa è la lingua in cui è stato scritto
-il primo prototipo — i commenti nel codice lo testimoniano ancora.
+Il colibrì pesa pochi grammi, resta sospeso in volo e visita un migliaio di fiori
+al giorno. Questo motore tiene in vita un gigante da 744 miliardi di parametri
+con le razioni di un colibrì: 25 GB di RAM, dodici core CPU e tanta pazienza col
+disco.
## Ringraziamenti
-colibrì è un motore; le menti che fa girare sono un dono. Grazie ai team che
-rilasciano apertamente pesi di classe frontiera, **Z.ai** (GLM), **Moonshot AI**
-(Kimi), **Alibaba Qwen**, **MiniMax** e **Allen AI** (OLMoE), e a ogni
-contributore che ha fatto benchmark, bisect, replicato un'esecuzione dell'atlante o
-mandato una patch. Questo progetto è la prova di ciò che i pesi aperti rendono
-possibile.
-
-Gli esperimenti del progetto su piazzamento, compressione e routing degli expert si
-basano anche su idee ed evidenze dei seguenti lavori aperti di ricerca e di sistemi:
-
-- [REAP](https://github.com/CerebrasResearch/reap) e
- [EASY-EP](https://github.com/RUCAIBox/EASYEP) per l'importanza degli expert
- consapevole dell'output e specifica del dominio.
-- [SERE](https://github.com/JL-Cheng/SERE) per il re-routing degli expert basato
- sulla similarità, e [ReMoE](https://github.com/BUAA-OSCAR/ReMoE) per il
- fine-tuning del router consapevole della località della cache.
-- [MC-SMoE](https://github.com/UNITES-Lab/MC-SMoE) per il merging e la compressione
- degli expert guidati dal routing.
-- [MoBE](https://github.com/inclusionAI/MoBE) e
- [D²-MoE](https://github.com/lliai/D2MoE) per le basi di expert condivise e i
- delta di expert a basso rango.
-- [HybriMoE](https://github.com/PKU-SEC-Lab/HybriMoE) per lo scheduling ibrido
- CPU/GPU degli expert, [ScMoE](https://arxiv.org/abs/2404.05019) per la
- sovrapposizione tra comunicazione degli expert e calcolo, e
- [OD-MoE](https://arxiv.org/abs/2512.03927) per il caricamento distribuito degli
- expert su richiesta.
-- [vLLM](https://github.com/vllm-project/vllm),
- [llama.cpp](https://github.com/ggml-org/llama.cpp) e
- [kTransformers](https://github.com/kvcache-ai/ktransformers) per i sistemi di
- inferenza aperti e il lavoro sull'offload degli expert che rendono riproducibili i
- confronti.
-
-Il motore poggia anche su lavoro di ingegneria concreto, non solo su idee. Ognuno
-di questi è usato o reimplementato oggi nel repository:
-
-- [safetensors](https://github.com/huggingface/safetensors): il container che ogni
- motore legge (`c/st.h`), compresi i suoi dtype fp8 e I64.
-- [tiktoken](https://github.com/openai/tiktoken): `c/tok.h` reimplementa
- esattamente il suo `byte_pair_encode`, unendo la coppia adiacente la cui
- concatenazione ha l'id di vocabolario più basso, così un vocabolario derivato da
- tiktoken non ha bisogno di una lista di merge.
-- [llama.cpp](https://github.com/ggml-org/llama.cpp): il sottoinsieme della
- grammatica GBNF in `c/grammar.h` segue la sua sintassi e il suo PDA a insieme di
- stack, e il percorso Metal prende in prestito il suo trucco di residenza
- `newBufferWithBytesNoCopy`.
-- [vLLM](https://github.com/vllm-project/vllm): il riferimento per la semantica
- dell'output che il motore riproduce posizione per posizione (per esempio dove cade
- la norma finale rispetto alla LM head).
-- [transformers](https://github.com/huggingface/transformers): l'oracle; la CI
- riproduce token per token contro di esso un modello inizializzato a caso.
-- [DietGPU](https://github.com/facebookresearch/dietgpu): il codec ANS su GPU dietro
- il livello sperimentale di expert compressi (`COLI_ANS`).
-- [rocWMMA](https://github.com/ROCm/rocWMMA): il backend HIP mappa su di esso l'API
- di frammenti e mma_sync `nvcuda::wmma` di CUDA (`c/backend_gpu_compat.h`), ed è
- ciò che permette a un unico sorgente .cu di compilare per entrambi i produttori.
+colibri è un motore; le menti che fa girare sono un dono. Grazie ai team che
+rilasciano apertamente i loro pesi: **Z.ai** (GLM), **Moonshot AI** (Kimi),
+**Alibaba Qwen**, **DeepSeek**, **Xiaomi** (MiMo), **Thinking Machines**
+(Inkling), **Allen AI** (OLMoE), **Convai Innovations** (Laya), **fastino**
+(GLiNER2.5-Decide) e **Cloudflare** (Clef); a chi pubblica i container
+convertiti; e a ogni contributore che ha fatto benchmark, bisect, replicato
+un'esecuzione dell'atlante o mandato una patch. Il codice di terze parti in
+questo repository e le sue licenze: [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
## Licenza
-Apache 2.0, Copyright 2026 Vincenzo Fornaro. Vedi [LICENSE](LICENSE) e [NOTICE](NOTICE). I pesi di GLM-5.2 sono rilasciati da Z.ai sotto licenza MIT.
+Apache 2.0, Copyright 2026 Vincenzo Fornaro. Vedi [LICENSE](LICENSE) e [NOTICE](NOTICE). Ogni modello mantiene la licenza che gli hanno dato i suoi autori (i pesi di GLM-5.2 sono rilasciati da Z.ai sotto licenza MIT; Qwen-Image-2.1 è solo per uso non commerciale).
diff --git a/README.ja.md b/README.ja.md
index 89a53120..5eb4fe15 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -1,10 +1,10 @@
<p align="center">
- <img src="assets/colibri-logo.svg" width="560" alt="colibrì — 小さなエンジン、巨大なモデル">
+ <img src="assets/colibri-logo.svg" width="560" alt="colibrì:小さなエンジン、巨大なモデル">
</p>
<p align="center">
- <a href="https://justvugg.github.io/colibri"><img src="https://img.shields.io/badge/website-justvugg.github.io%2Fcolibri-1f6feb" alt="Website"></a>
- <a href="https://github.com/JustVugg/colibri/releases"><img src="https://img.shields.io/github/v/release/JustVugg/colibri?color=2ea043" alt="Latest release"></a>
+ <a href="https://justvugg.github.io/colibri"><img src="https://img.shields.io/badge/website-justvugg.github.io%2Fcolibri-1f6feb" alt="ウェブサイト"></a>
+ <a href="https://github.com/JustVugg/colibri/releases"><img src="https://img.shields.io/github/v/release/JustVugg/colibri?color=2ea043" alt="最新リリース"></a>
</p>
<p align="center">
@@ -13,825 +13,455 @@
<a href="README.md">English</a> · <a href="README.zh-CN.md">简体中文</a> · <a href="README.zh-TW.md">繁體中文</a> · <a href="README.it.md">Italiano</a> · 日本語
</p>
-**小さなエンジン、巨大なモデル。** ストレージ・RAM・VRAM を単一の推論階層として扱う
-(AI メモリのマルチティア化)ことで、**744B から 2.8T パラメータのフロンティア MoE モデル**を、
-コンシューマー向けや異種混在のハードウェア上で、エンジン依存ゼロの純粋な C で実行します。
-
-現在動作するのは 10 の言語モデルファミリーです。数えているのはチェックポイントではなくエンジンです:
-それぞれが C ファイル 1 つで、同じ `coli chat` / `coli serve` / `coli web` フロントエンドを共有し、
-複数のモデルを動かすエンジンもあります。**GLM-5.2/5.3**(744B)、**GLM-5.3-Flash**(321B、
-ビジョン対応)、**Inkling**(975B)、**Kimi K3**(2.8T)、**DeepSeek V4 Flash**(284B)、
-**DeepSeek V4.1 Flash**(552B、ビジョン対応)、**MiMo-V2.6 Flash**(309B、ビジョン対応。同じエンジンで
-**MiMo-V2.6 Pro**、1.02T も動作)、**Qwen3.8-Flash-Next**(125B + 51B n-gram)、**Qwen3.6**(35B-A3B。
-同じエンジンで **Qwen3-Coder-30B-A3B** と、ビジョン対応の密モデル **Qwen3.8-27B** も動作)、そして
-**OLMoE**(7B)。
-画像生成も可能です: 11 番目のエンジンが **Qwen-Image-2.1** を動かし、テキストから画像を生成します。
-`coli chat` はそれをターミナル内に直接表示し、`coli serve` は `POST /v1/images/generations` で提供します
-([qwen-image.md](docs/qwen-image.md))。
-[全モデル一覧 ↓](#other-supported-models)
-
-> **Colibrì は今日すぐに動かせる推論エンジンであり、同時にオープンな研究
-> プラットフォームでもあります。** 主な目標は、ソフトウェアとハードウェアの境界全体——
-> モデルフォーマット、メモリ階層、ストレージ I/O、配置、スケジューリング、カーネル、
-> 投機的デコード、CPU/GPU のオーバーラップ——にわたって推論側の性能を追求し、
-> 大規模モデルが希少なハードウェアに依存せず、より低コストで動くようにすることです。
-
-Colibrì は VRAM・RAM・ストレージを単一のマルチティア階層として扱い、意図的に
-攻めたシステム上のアイデアを試す場となっています。そのため **速度に SLA はありませんが、
-セマンティクスは厳格に保証します**。実験は再現可能なエンドツーエンドの計測によって
-採用に値することを示さなければならず、デフォルトのポリシーは **モデルの精度やルーターの
-セマンティクスを黙って変更することは決してありません**。高速メモリが不足すると速度は
-落ちるかもしれませんが、それによってモデルが密かに別物になることはあってはなりません。
+**小さなエンジン、巨大なモデル。** colibri は、とても大きなオープンモデルを、あなたがすでに持っているマシンで動かします。数千億パラメータの Mixture-of-Experts モデルは、1 トークンごとに自分自身のごく一部しか使いません。そこで colibri はその部分を RAM に置き、残りの部分、つまりエキスパートは、モデルが必要としたときにディスクから読み込みます。純粋な C で書かれ、モデルファミリーごとにファイルは 1 つ、GPU は不要です。
+
+現在動作するエンジンは 13 個です。そのうち 10 個は言語モデル用です:**GLM-5.2/5.3**、**GLM-5.3-Flash**、**Inkling**、**Kimi K3**、**DeepSeek V4 Flash**、**DeepSeek V4.1 Flash**、**MiMo-V2.6 Flash**(と Pro)、**Qwen3.8-Flash-Next**、**Qwen3.6**(Qwen3-Coder と密モデルの Qwen3.8-27B も動かします)、そして **OLMoE**。1 個は画像を描きます:**Qwen-Image-2.1**。2 個は判定に答えます:**Laya** と **GLiNER2.5-Decide** で、さらに 3 つ目の判定モデル **Clef** が Qwen3.6 エンジンで動きます。[自分のマシンに合うのはどれか](#which-model-for-my-machine)
```
$ ./coli chat
- 🐦 colibri v1.12.1 — GLM-5.2 · 744B MoE · int4 · streaming CPU
+ colibri v1.12.1 · GLM-5.2 · 744B MoE · int4 · streaming CPU
✓ ready in 32s · resident 9.9 GB
› ciao!
- ◆ Ciao! 😊 Come posso aiutarti oggi?
+ ◆ Ciao! Come posso aiutarti oggi?
```
-## 動作の様子
+<a id="get-started"></a>
+<a id="the-one-step-way"></a>
-<p align="center">
- <img src="docs/media/colibri-dashboard.png" width="900" alt="colibrì Web ダッシュボード — ライブメトリクス、ハードウェアパネル、エキスパートのティア">
-</p>
-<p align="center"><em>Web ダッシュボード(<code>./coli web</code>)。1.12.0 で再設計され、チャット、System One モード、Brain ページ、
-Profiling のためのドックを備えたワークスペースになりました。ライトテーマとダークテーマに対応します。ここでは CPU マシン上の
-Qwen3.6 が、ディスクからストリーミングされるエキスパートで応答しています。</em></p>
+## ワンステップで始める
-<p align="center">
- <img src="docs/media/colibri-brio.png" width="900" alt="System One ページ: 1 回だけ読まれる文書、許可された各回答の確率、そしてエントロピー">
-</p>
-<p align="center"><em><strong>System One モード</strong>: 同じモデルに、書くのをやめるよう指示したものです。文書と、選んでよい回答だけを渡すと、
-各回答の確率を読み取り、何も生成せず、確信がないときにそれを示すエントロピーを報告します。ここでは
-<strong>request changes が 99.9%</strong>、エントロピー 0.005、読み取り 4 トークン、生成 0 トークンです。</em></p>
+必要なのは、最低でも **8 GB の RAM**(16 GB 以上あればなお良い)、最も小さなモデルのための **22 GB のディスク空き容量**、そしてインターネット接続のあるコンピューターです。グラフィックカードはあってもなくてもかまいません。
-<p align="center">
- <img src="docs/media/colibri-brain.png" width="900" alt="Brain ページ — GLM-5.2 の計測されたエキスパートアトラスを皮質として描画、入れる 10 の領域">
-</p>
-<p align="center"><em><strong>Brain</strong> ページの <strong>Explore</strong> 表示: GLM-5.2 の<a href="https://github.com/JustVugg/colibri/issues/175">計測されたエキスパートアトラス</a>を皮質として描画します。
-特性が明らかになった 13,260 個のエキスパートが 10 の領域(Python、SQL、数学、詩、法律、中国語…)に分かれ、位置は学習された埋め込みではなく
-計測されたルーティング親和性です。領域を選ぶとその中に入れます。<strong>Live routing</strong> 表示は実際に動いているモデルに切り替わり、
-エキスパートごとに 1 セル、色はストレージのティア、1 ターンでルーティングされたエキスパートは白く光ります。</em></p>
+**Windows**
-<p align="center">
- <img src="docs/media/colibri-brain-region.png" width="900" alt="Python 領域の内部 — 1,142 個のエキスパート、選択した 1 つとその計測された親和性">
-</p>
-<p align="center"><em><strong>Python</strong> 領域の内部: 1,142 個のエキスパートが星座として並び、それぞれにレイヤーと番号のラベルが付きます。パネルはその 1 つ、
-レイヤー 17 のエキスパート 178 を表示しています。エントロピー 3.13 のジェネラリストで、計測された親和性は Python 20.2%、JSON 14.6%、
-会話 14.2%、SQL 13.3% です。</em></p>
+1. このページで **Code** をクリックし、次に **Download ZIP** をクリックして、ZIP を展開します。
+2. 展開したフォルダーの中の **`START-HERE.bat`** をダブルクリックします。Python が入っていない場合は、その場でインストールすることを提案してくれます。
-<p align="center">
- <img src="docs/media/colibri-profiling.png" width="900" alt="Profiling ページ — エンジンが各ターンで時間を使う場所">
-</p>
-<p align="center"><em><strong>Profiling</strong> ページ: エンジンが各ターンで時間を使う場所をフェーズごとに示し、直近 30 ターンを推移として表示します。
-ここでは CPU マシン上の Qwen3.6: プロンプト 36 トークンと生成 55 トークンで壁時計時間 19.0 秒、2.9 tok/s、
-ディスクサービス 11.4 秒は計算と重なっています。</em></p>
-
-## 研究のミッション
-
-Colibrì があれば、プライベートなフロンティアモデルへのアクセスが、ハイパースケーラー級ハードウェアの入手可能性に制限されることはありません。
-
-マルチティア機能によって、Colibrì は **推論エンジンのパイプラインを積極的に最適化し、
-プロプライエタリなハードウェアへの依存を取り除きます**。
-
-私たちの実務上のミッションには、重みの表現方法と移動方法を変えること、何を VRAM・RAM・
-ストレージに置くかを決めること、異種計算資源をオーバーラップさせること、起動と同期の
-オーバーヘッドを減らすこと、スパース性と再利用を活用すること、そして新しいデコード
-アルゴリズムを試すことが含まれます。慣習的だからという理由だけで守られるものはなく、
-マイクロベンチマークで速く見えるという理由だけで採用されるものもありません。決め手となるのは
-実機でのエンドツーエンドの推論結果であり、スループット、レイテンシ、メモリ、コストと
-並んで、正しさと品質も計測されます。
-
-その実際的な帰結が **アクセシビリティ** です。すでに持っているハードウェアで
-744B パラメータのモデルを動かし、すべてのエキスパートが発火する様子をリアルタイムで眺め、
-それを実現しているコードを変更できます。API の向こうにある知能を借りるのではなく、
-それを *手にする* ——調べ、計測し、改善する——のです。エンジンは意図的に小さく保たれており、
-次の有用な最適化は、それを計測しようとする誰からでも生まれ得ます。
-
-## コア技術と計測結果
-
-- **ティア容量に縛られない単一の階層。** VRAM・RAM・NVMe は同じ重みを置く配置ティアです。
- 高速メモリの制約は速度を変えるだけで、モデルのセマンティクスは変えません。
-- **重みのための JIT。** すべてのエキスパートをロードする代わりに、計測されたルーティングの熱量が
- レイヤーごとの LRU、学習されたピン留めホットストア、1 レイヤー先のプリフェッチを駆動します。
- 繰り返しのあるワークロードでは効果がありますが、履歴は過学習し得るし、先読みは一部の
- ホストでは逆効果になり得るため、どちらも約束ではなく計測可能なポリシーとして扱われます。
-- **I/O はエンジンの一部。** バッチ化されたエキスパートの和集合、読み込みと計算のオーバーラップ、
- `O_DIRECT`、重み付きデュアル SSD ストライピングによって、ストレージのレイテンシが
- タダであるかのように装うのではなく、ストリーミング経路そのものに取り組みます。`O_DIRECT` は
- ドライブ依存であり、デュアル SSD はまだより幅広いコミュニティによるエンドツーエンドの A/B を必要としています。
-- **異種混在実行。** CPU、CUDA、Metal、NUMA メモリ、部分的または完全なエキスパート常駐は
- 1 つのランタイムを共有し、マシンに応じて組み合わせられます。どの組み合わせが有利かは、
- 計算能力、帯域幅、常駐状況、ワークロードによって決まります。
-- **別のモデルにすることなく状態を圧縮。** トークン単位で完全一致するフォワード検証、
- 57 分の 1 に縮小された MLA KV 状態、永続化されたウォームな会話、忠実な DSA により、
- 最適化を正しさに結び付けています。これらはメモリ・レイテンシ・正しさの特性であり、
- 一律のスループット向上を主張するものではありません。
-- **元が取れる場合にだけ使う投機的デコード。** ネイティブ MTP と文法強制ドラフトは
- エンドツーエンドで計測され、受理率が検証コストに見合わない場合は無効化できます。
-
-## 未検証の仮説、実験、そして協力の方法
-
-Colibrì は、制御されたエンドツーエンドの A/B が示すまで、最適化を仮説として扱います。
-現在の主な問いは次のとおりです:
+**Linux**(Ubuntu と Debian の場合。ほかのディストリビューションにも、同じパッケージがそれぞれの名前で用意されています)
-| 仮説 | これまでのエビデンス | まだ必要な実験 |
-|---|---|---|
-| ルーティング履歴は単純な LRU よりもうまくエキスパートを配置できる | 学習されたピンは繰り返しのワークロードを改善するが、プロンプトに過学習し得る | コーディング、チャット、多言語、長コンテキストのワークロードにわたる、ホールドアウトかつセッション横断の A/B |
-| 複数の SSD は独立した帯域幅をデコード速度に変えられる | 独立した NVMe ドライブ 2 台でデコード +37.5% を計測。より遅い 3 台目のドライブは、重み付きストライピングの後では効果が中立だった([計測結果](docs/multidisk.md#what-has-been-measured)) | ドライブ速度、コントローラ構成、キャッシュ状態を変えて再現する |
-| ハードウェアを考慮したプランナーは、各マシンの最適構成に自動で近づける | RAM/VRAM の予算といくつかのバックエンドは現在すでに検出される | 生成されたプランを、ラップトップ、ワークステーション、NUMA ホスト、マルチ GPU システムにわたる制御されたパラメータスイープと比較する |
-| ロスレスまたは品質上限付きの表現で、重みの移動を意味のあるほど減らせる | 正しさ/品質ゲート付きのフォーマットと量子化のアブレーションが存在する | 圧縮率だけでなく、品質、移動バイト数、レイテンシ、有用トークンあたりのコストを同時に再現する |
-| ルーティングを考慮した投機的デコードは、ほぼ完全常駐に達する前でも元が取れる | MTP と文法ドラフトは動作するが、MTP はエキスパートヒット率約 85% 付近で 32% の損失も計測されている | 受理率、エキスパートヒット率、バッチの和集合、ドラフト深さにわたる損益分岐面をマッピングする |
-| CPU/GPU のオーバーラップは、ボトルネックを移すだけでなく転送と同期を隠蔽できる | CUDA と Metal での改善はあるが、高速な CPU や低い常駐率ではそれが打ち消され得る | PCIe、ユニファイドメモリ、完全常駐マシンにわたる、ステージごとのプロファイルと 1 変数ずつの A/B |
+```bash
+sudo apt install git python3 build-essential
+git clone https://github.com/JustVugg/colibri
+cd colibri
+./start-here.sh
+```
+
+**macOS**([Homebrew](https://brew.sh) を使用)
+
+```bash
+xcode-select --install
+brew install libomp git python
+git clone https://github.com/JustVugg/colibri
+cd colibri
+./start-here.sh
+```
+
+聞かれる質問は「どのモデルにするか」の 1 つだけで、Enter を押せば推奨のモデルが選ばれます。そのあとセットアップは次のことを行います:
+
+1. **マシンを調べます**:RAM、ディスクの空き容量、CPU、GPU。
+2. **収まるモデルを推奨します**:モデルのうち常に RAM に置かれる部分と、最小限のエキスパートキャッシュが RAM に収まり、ダウンロードしたファイルがディスクに収まる必要があります。
+3. **エンジンを用意します**:コンパイラがあればこのマシン向けにビルドし、なければ CPU で動くビルド済みのものをダウンロードします。GPU 向けのビルドは、それで速くなる場合に行います:Linux の NVIDIA カードで CUDA ツールキットがインストールされていれば CUDA、それ以外は Vulkan です。ディスクリート GPU では常に GPU 向けにビルドします。CPU と RAM を共有する内蔵 GPU では、そこで速くなることが計測されたモデル(Qwen3.6、Qwen3-Coder、Qwen3.8-Flash-Next)の場合だけです。足りないパッケージがある場合は、それをインストールするための正確なコマンドを表示して、CPU で続行します。あとでセットアップをもう一度実行すれば、GPU 向けにビルドし直します。
+4. **モデルをダウンロードします**。進捗を表示し、途中から再開できます:いつ止めてもかまいません。もう一度実行すれば、止まったところから続きます。
+5. **colibri を起動し、ブラウザでダッシュボードを開きます**。また、ほかのアプリが使えるアドレスを表示します:
+
+```
+Starting colibri
+ Browser: http://127.0.0.1:8000/
+ OpenAI base URL: http://127.0.0.1:8000/v1
+ Anthropic base URL: http://127.0.0.1:8000
+ stop: press Ctrl+C here (or close this window)
+```
-協力したいですか? いずれかの行を選び、ネガティブな結果も公開してください。ハードウェア、
-コミット、モデル/コンテナ、正確なコマンド、プロンプト、キャッシュ状態、スループット、
-TTFT、エキスパートヒット率、読み込みバイト数、品質チェックを記録し、1 つの変数だけを変えて
-再実行し、生のログを添付してください。まずは
-[CONTRIBUTING.md](CONTRIBUTING.md) から始め、
-[ベンチマークプロトコル](docs/benchmarking.md) と比較したうえで、
-[実験 issue を作成](https://github.com/JustVugg/colibri/issues/new) してください。
-ここでは、説明のつかない速い数値よりも、よく制御された失敗のほうが価値があります。
+**次回からは**、`START-HERE.bat` か `./start-here.sh` をもう一度実行するだけです:ダウンロードもビルドもなしに、colibri がすぐに起動します。`c/coli status` は何がインストールされていて、動いているかどうかを表示し、`c/coli stop` で停止します(Windows では `c\coli.cmd status` と `c\coli.cmd stop`)。
-## アイデア
+オプションは `./start-here.sh` または `START-HERE.bat` のあとに付けます:
-744B の Mixture-of-Experts モデルは、1 トークンあたり約 40B のパラメータしか活性化せず、
-そのうちトークンごとに入れ替わるのは約 11 GB(ルーティングされるエキスパート)だけです:
+| オプション | 何をするか |
+|---|---|
+| `--list` | このマシンに対する全モデルの一覧と、収まらないモデルについてはその理由 |
+| `--model ID` | そのモデルをインストールする(ID は[下の表](#which-model-for-my-machine)にあります) |
+| `--yes` | 質問なしで推奨を選ぶ |
+| `--dir DIR` | モデルを別のディスクに置く(デフォルトは `~/colibri-models`) |
+| `--backend vulkan`、`cuda` または `cpu` | エンジンのビルドを自分で選ぶ。`--no-gpu` は `--backend cpu` と同じ |
+| `--model-dir DIR` | すでにダウンロードしたモデルを使う |
+| `--reconfigure` | 別のモデルを選び直す |
+
+各ステップの詳しい内容:[docs/quickstart.md](docs/quickstart.md#the-one-step-way)。
+
+### うまくいかないとき
+
+| 表示された内容 | 対処 |
+|---|---|
+| ダウンロード中に止まった | 同じコマンドをもう一度実行する:ディスクにすでにあるバイトから再開します |
+| `to use the GPU through ..., first run: <command>` | そのコマンドを実行してから、もう一度セットアップを実行する:GPU 向けにビルドし直し、ダウンロードはやり直しません |
+| CUDA でのビルド中に `the ... build failed`。たとえば、インストールされている CUDA ツールキットがそのカードをもうサポートしていないときの `Unsupported gpu architecture` | `./start-here.sh --backend vulkan` なら Vulkan 経由でカードを使います。`--no-gpu` なら CPU のままです |
+| `needs N GB free for the download` | `--dir` で、より大きなディスク上のフォルダーを指定する |
+| WSL で、モデルのフォルダーが `/mnt/c` の下にある | Linux 側のディスク(デフォルトの `~/colibri-models`)に置く:`/mnt/c` は何倍も遅くなります |
+| それ以外 | `c/coli logs -n 50` でサーバーのログを、`c/coli logs --install` でセットアップのログを表示できます。セットアップが最後に表示した数行を添えて [issue](https://github.com/JustVugg/colibri/issues) を作成してください |
+
+### AI アシスタントにセットアップしてもらう
+
+AI コーディングアシスタントを使っているなら、これをすべて任せられます。次のように頼んでください:
+
+> https://github.com/JustVugg/colibri の docs/AI_SETUP.md に従って、このマシンに colibri をセットアップしてください
+
+[docs/AI_SETUP.md](docs/AI_SETUP.md) は、各ステップを機械可読な結果を返すコマンドとしてアシスタントに渡し、モデルをダウンロードしたりシステムパッケージをインストールしたりする前に、あなたに確認するよう指示しています。Model Context Protocol に対応したアシスタントは、代わりに colibri の MCP サーバーを使えます:`coli mcp` は、ハードウェアの検出、モデルの推奨、インストール、起動、停止、状態確認のためのツールを提供します([docs/MCP_SERVER.md](docs/MCP_SERVER.md))。
+
+### または手動で
+
+各ステップを自分で選びたい場合(ビルド済みリリースかソースからのビルドか、下の表のどのモデルか、そして `coli chat`、`coli web`、`coli serve` のどれか)は、[手動でのインストール](#install-by-hand)を、全プラットフォームの手順を一つずつ追いたい場合は[クイックスタートガイド](docs/quickstart.md)を参照してください。
+
+## colibri とは何か、そしてなぜ作るのか
+
+Mixture-of-Experts モデルは、ディスク上では巨大でも、1 トークンあたりでは小さなものです。GLM-5.2 は 744B のパラメータを持ち、1 トークンごとに使うのは約 40B、そのうちトークンごとに入れ替わるのは約 11 GB だけです:ルーティングされるエキスパートです。
<p align="center">
<img src="docs/media/sparse.png" width="880" alt="1 トークンあたり活性化するのはパラメータの約 5.4% のみ">
</p>
-つまり、モデルは高速メモリに *収まる* 必要はなく、**配置** されればよいのです:
+つまり、モデルは高速メモリに収まる必要はなく、**配置** されればよいのです。密な部分(アテンション、共有エキスパート、埋め込み)は RAM に置かれます。ルーティングされるエキスパートはディスクに置かれ、ルーターが必要としたときに読み込まれます。読み込みは、あなたの作業がどのエキスパートを使うかを学習するキャッシュを通して行われます。GPU があれば、最もホットなエキスパートと密レイヤーを GPU が保持します。重みがどこにあるかで変わるのは答えが返ってくる速さであり、答えを生み出す重みやルーターの判断は変わりません。
-- **密な部分**(アテンション、共有エキスパート、埋め込み — 約 17B パラメータ)は
- **int4 で RAM に常駐** します(約 9.9 GB)。
-- **19,456 個のルーティングエキスパート**(75 MoE レイヤー × 256 + MTP ヘッド、int4 で各約 19 MB)は
- **ディスク上** に置かれ(約 370 GB)、レイヤーごとの LRU キャッシュ、学習されたピン留めホットストア、
- オプションの VRAM ティアとともに **オンデマンドでストリーミング** されます。
+なぜ作るのか:このサイズのモデルを、人々がすでに持っているハードウェアで動かすため。モデルが動く様子を眺めるため(ダッシュボードは、発火するエキスパートをすべて表示します)。そして、誰もが計測して速くできるほど、エンジンを小さく保つためです。colibri はオープンな研究プラットフォームでもあります:最適化は、再現可能なエンドツーエンドの計測によって採用に値することを示さなければならず、デフォルトのポリシーがモデルの精度やルーターのセマンティクスを黙って変えることは決してありません。高速メモリが少なければ速度は落ちるかもしれませんが、それによってモデルが密かに別物になってはなりません。詳しくは[仕組み](#how-it-works)を参照してください。
-コアアルゴリズムは **重みのための JIT** だと考えてください。コンパイラの JIT は
-プログラム全体をコンパイルすることはなく、実際に実行される部分を観察して、ホットパスを
-ジャストインタイムでコンパイルします。colibrì は 744B のパラメータ空間に対して同じ賭けをします。
-パラメータは保持すべき常駐状態ではなく、ルーターが必要だと証明したまさにそのときに、
-異種混在のストレージ階層(VRAM / RAM / NVMe)にわたって **ステージングされるデータ** なのです。
-計測されたルーティングの熱量がどのエキスパートをどのティアに置くかを決め、ルーターは
-1 レイヤー先を走ってプリフェッチがステージングのレイテンシを隠し、そして JIT と同様に、
-エンジンはあなたのワークロードを学習します。使えば使うほど、適切なエキスパートがホットになっていきます。
-これが機能するのは、ルーティングに計測可能な構造があるからです(
-[エキスパートアトラス](https://github.com/JustVugg/colibri/issues/175) を参照)。
-そして構造はキャッシュ可能です。
+<a id="which-model-for-my-machine"></a>
-エンジンは単一の C ファイル(`c/colibri.c`)と小さなヘッダ群だけで構成されています。BLAS も、
-実行時の Python も、GPU も必要ありません。
+## 自分のマシンに合うモデル
-### ローカルクラスタモード
+セットアップは、あなたのマシンで RAM から動かせるモデルのうち最も高性能なものを推奨し、そのすぐ下に、ディスクからストリーミングする、より大きなモデルを並べます。`./start-here.sh --list` を実行すると、すべてのモデルをこのマシンと照らし合わせて表示します。以下の表はセットアップ自身のカタログ([`c/setup_catalog.py`](c/setup_catalog.py))に沿っています。ダウンロードのサイズは、Hugging Face が各リポジトリについて表示しているサイズです。
-コーディネーターはトークン生成、ルーティング、KV 状態をローカルに保持し、ディスクを
-バックエンドとするエキスパートワーカーが、ルーティングされた FFN を他の Mac 上で実行します。
-あるレイヤーでルーティングされたバッチの和集合は 1 つの永続 TCP リクエストとして送られるため、
-1 トークンでエキスパートごとにラウンドトリップが発生することはありません。
+- **RAM** は 2 つの数値です:1 つ目を下回るとモデルは起動せず、2 つ目以上あれば計測値どおりに動きます。
+- **GPU** は、セットアップがそのエンジン向けにビルドできるものです([GPU](#gpus))。*内蔵 GPU も* とあるものは内蔵 GPU も使います。これらのエンジンは内蔵 GPU で速くなることが計測されています。それ以外のエンジンはディスクリート GPU だけを使います。
+- **計測値** は、記載されたマシンで計時した結果で、チャットモデルではデコード速度です。アルファベットは表の下に挙げたマシンを指します。空欄は、まだ誰も計測していないという意味です。
-オプションの登録サービスを起動します:
+**小さなモデル:RAM から動作します**
-```bash
-./coli cluster coordinator --host 0.0.0.0 --port 8765
-```
+| モデル | `--model` | ダウンロード | RAM | GPU | 計測値 |
+|---|---|---|---|---|---|
+| **Qwen3.6-35B-A3B**:思考モードとツールに対応したチャット | `qwen36-35b` | 23 GB | 10 / 20 GB | CUDA、Vulkan(内蔵 GPU も) | CPU で 6.0 tok/s、内蔵 GPU の Vulkan で 9.9(A)。CUDA で 30.0(C) |
+| Qwen3-Coder-30B-A3B:コードとツール呼び出し、思考モードなし | `qwen3-coder-30b` | 19 GB | 8 / 18 GB | CUDA、Vulkan(内蔵 GPU も) | 全エキスパートを RAM に置いて 8.5-9.6 tok/s、レイヤーあたり 32 個で 5.1(A、CPU) |
+| **Qwen-Image-2.1**:テキストから画像、非商用ライセンス | `qwen-image-2.1` | 33 GB | 12 / 18 GB | Vulkan | 768x512 の画像 1 枚に 2 分 40 秒(Zen 4 の 8 コア、CPU) |
-各ワーカーで、同じ変換済みモデルをローカルに用意したうえで:
+**大きなモデル:エキスパートをディスクからストリーミングします**(速度を決めるのはディスクで、高速な NVMe ドライブが最も効果的です)
-```bash
-./coli cluster worker --model /nvme/glm52_i4 --port 9100 \
- --coordinator http://COORDINATOR:8765 --advertise-host WORKER_IP
-```
+| モデル | `--model` | ダウンロード | RAM | GPU | 計測値 |
+|---|---|---|---|---|---|
+| DeepSeek V4 Flash REAP 150B:256 個中 132 個のエキスパート | `deepseek-v4-flash-reap` | 85 GB | 16 / 32 GB | CUDA、Vulkan | |
+| **DeepSeek V4 Flash**(284B):ツール対応 | `deepseek-v4-flash` | 167 GB | 16 / 32 GB | CUDA、Vulkan | CPU のみで、32 GB(Ryzen 7 5800X)なら 0.93 tok/s、63 GB(Ryzen 9 5950X)なら 1.24。CUDA で 1.5-1.6(RTX 5080、32 GB、NVMe 2 台) |
+| **MiMo-V2.6 Flash**(309B):ビジョンとツール | `mimo-v2.6-flash` | 172 GB | 32 / 52 GB | Vulkan | 2.34-3.37 tok/s(A、CPU) |
+| **Qwen3.8-Flash-Next**(125B + 51B n-gram):ビジョンとツール | `qwen38-flash-next` | 186 GB | 24 / 32 GB | CUDA、Vulkan(内蔵 GPU も) | レイヤーあたり 32-96 エキスパートで 1.91-2.56 tok/s。オプションの int4 エキスパートで 3.99(A、CPU) |
+| **GLM-5.2**(744B):リファレンスモデル、MTP ヘッド付き | `glm-5.2` | 429 GB | 16 / 24 GB | CUDA、Vulkan | 25 GB のラップトップでコールド時 0.05-0.1 tok/s。128 GB の Ryzen AI Max+ 395 で 1.83。6x RTX 5090 で 9.0-9.2 |
+| GLM-5.3(744B):同じエンジン、MTP ヘッドなし | `glm-5.3` | 419 GB | 16 / 24 GB | CUDA、Vulkan | |
+| **Inkling**(975B):int4 エキスパート、bf16 の密な重み | `inkling` | 514 GB | ダウンロードしたままなら 120 / 128 GB。[密な重みの変換](docs/inkling.md)後は 25 GB | CUDA、Vulkan | 0.25 tok/s(Ryzen 9 7900、187 GB、RTX A6000) |
+| MiMo-V2.6 Pro(1.02T):ビジョンとツール | `mimo-v2.6-pro` | 564 GB | 54 / 64 GB | Vulkan | 0.66-0.79 tok/s(A、CPU) |
+| **Kimi K3**(2.8T):最大のモデル | `kimi-k3` | 1.56 TB | 32 / 64 GB | CUDA、Vulkan | 1 トークンあたり約 9.4 秒、エキスパートの読み込みは 6.3 GB/s |
-ディスカバリーを使ってコーディネーターを実行するか、静的な構成では `--cluster-workers
-HOST:PORT,...` を指定します:
+<a id="other-supported-models"></a>
-```bash
-./coli serve --model /nvme/glm52_i4 \
- --cluster-coordinator http://127.0.0.1:8765
-```
+**手動:ダウンロード後に変換または準備の手順が必要なもの**
-ワーカーが設定されていない限りトランスポートは無効なので、既存の単一マシンでの経路は
-変わりません。密レイヤーのシャーディングやブラウザ/WebGPU ワーカーは、別の今後の拡張ポイントです。
+| モデル | ダウンロード、その後のディスク上のサイズ | RAM | GPU | 計測値 |
+|---|---|---|---|---|
+| **OLMoE**(7B):小さく、ツールの使い方を覚えるのに向く | 14 GB、int8 への変換後は 7 GB | 8 GB | Vulkan | 22-23 tok/s(A、CPU) |
+| Qwen3.8-27B(密モデル):テキストと画像 | 56 GB、変換後は 51 GB | int4 で 20 GB、int8 で 30 GB | Vulkan | int4 で 3.45 tok/s、int8 で 2.1(16 スレッドの CPU サーバー) |
+| **GLM-5.3-Flash**(321B):ビジョンとツール | 328 GB、シャードごとに変換して 195 GB | 25 GB | CUDA、Vulkan | 1 トークンあたりウォーム時約 20 秒、コールド時 44 秒(6 コア、25 GB、普通のディスク) |
+| **DeepSeek V4.1 Flash**(552B):ビジョンとツール、変換は不要だが一度だけ準備が必要 | 510 GB | 約 18 GB とエキスパートキャッシュ(レイヤーあたり 8 個でピーク 24.8 GB) | Vulkan | 0.21-0.24 tok/s(エキスパートの 68% を保持する 16 スレッドの CPU サーバー) |
-## 仕組み
+**判定モデル**([System One](#system-one-a-decision-with-a-probability) の質問に答えるモデルで、チャットはしません)
-### トークンごとの経路
+| モデル | ダウンロード、その後のディスク上のサイズ | RAM | GPU | 計測値 |
+|---|---|---|---|---|
+| **Laya**(Convai Innovations)、英語 | 0.85 GB | 1.7 GB | CPU | 質問 1 つで 219 ms、3 つで 882 ms(B) |
+| **GLiNER2.5-Decide**(fastino)、英語 | 1.95 GB | 1.9 GB | CPU | 質問 1 つで 294 ms、3 つで 897 ms(B、負荷あり) |
+| **Clef**(Cloudflare):判定ヘッド付きの Qwen3.8-27B、チャットも可能 | 55 GB、変換後は 52 GB | int4 の 19 GB から f16 の 55 GB まで | CPU | int8 で 1 リクエストあたり 20.4 秒(A) |
-<p align="center">
- <img src="docs/media/token-path.png" width="880" alt="ルーティング → 和集合 → 配置 → オーバーラップ → 学習">
-</p>
+マシン:
+**A** Ryzen 7 PRO 8700GE のデスクトップ(8 コア、61-64 GB DDR5、NVMe、内蔵 Radeon 780M)。
+**B** i7-1355U のラップトップ。
+**C** Threadripper 3945WX のマシンに載せた RTX 3070 8 GB。密レイヤーと DeltaNet レイヤーはカード上に置いています(行単位 int4 コンテナ)。
+各数値は、[docs/](docs/) にある各モデルのページか[ベンチマーク表](docs/benchmarks.md)に、正確な設定とともに記載されています。
-すべてのトークンのすべてのレイヤーが、同じ 5 つのステップをたどります。設計上の目標は、
-**配置が決めるのは常に速度だけ** ということです。エキスパートが VRAM から応答しようと
-ディスクから応答しようと、ルーターの判断も重みの精度も同じです。
+ファミリーごとにページがあります:[qwen36.md](docs/qwen36.md)(Qwen3.6、Qwen3-Coder、Qwen3.8-27B)、[qwen38.md](docs/qwen38.md)、[deepseek-v4.md](docs/deepseek-v4.md)、[deepseek-v41.md](docs/deepseek-v41.md)、[mimo.md](docs/mimo.md)、[glm53-flash.md](docs/glm53-flash.md)、[inkling.md](docs/inkling.md)、[kimi_k3.md](docs/kimi_k3.md)、[qwen-image.md](docs/qwen-image.md)、[laya.md](docs/laya.md)、[gliner_decide.md](docs/gliner_decide.md)、[clef.md](docs/clef.md)、そして GLM-5.2 については[クイックスタート](docs/quickstart.md#3-get-the-model)にあります。対応モデルと同じアーキテクチャのチェックポイントは、Qwen3.6 エンジン上の KAT-Coder v2.5 のように、変更なしでそのまま動きます。
-### 1 つのメモリ要件ではなく、1 つのメモリ階層
+<a id="gpus"></a>
-<p align="center">
- <img src="docs/media/tiers.png" width="880" alt="VRAM / RAM / NVMe の 3 ティアによるエキスパート常駐">
-</p>
+## GPU
-<a id="dual-ssd-two-copies-of-the-model-twice-the-read-bandwidth"></a>
+### GPU は不要
-### 複数の SSD: 2 台以上のドライブからモデルのコピーをストリーミング
+どのエンジンも、ほかに何もインストールせずに CPU で動きます。GPU は重みを置くためのより速い場所であって、必須ではありません:大きなモデルでは速度を決めるのはディスク、小さなモデルでは RAM です。
-デコードがディスク律速のときは、**2 台目の SSD** が役立ちます: そこにモデルのコピーを置き、エンジンに両方の
-ドライブから読ませます。GLM-5.2 の場合、ソースのチェックアウトの `c/` から(または展開したリリースから)
-次のように実行します:
+### Vulkan:あらゆる GPU
-```bash
-COLI_MODEL_MIRROR=/second/glm52_i4 python3 ./coli chat --model /fast/glm52_i4
-```
+すべての MoE エンジンは、Vulkan 1.2 ドライバを持つあらゆる GPU(AMD、Intel、NVIDIA、内蔵でもディスクリートでも)を、2 通りの方法で使えます:
-エンジンは起動時にドライブを計測し、読み込みの配分に重みを付けます。バッファ付きの読み込みは決定論的な
-エキスパートルーティングを使い、条件を満たすダイレクト読み込みは 1 つのエキスパートを複数のレプリカに
-またがってストライプできます。独立したドライブがもたらすのは帯域幅の余裕であり、トークンレートの倍率が
-保証されるわけではありません: 共有コントローラ、キャッシュヒット、計算が効果を制限することがあります。
-Bash と PowerShell の例、計測された効果と限界、単一ドライブとの比較は
-[マルチディスクガイド](docs/multidisk.md) を参照してください。知っておくべき詳細:
-
-- ミラーは **起動時に検証** されます(ファイルごとのサイズと safetensors ヘッダがプライマリとバイト単位で一致する必要があります)。一致しない、または欠けているファイルはプライマリのままになるので、**部分的なミラーでも問題ありません**。小さめの 2 台目 SSD でも、置いているシャードを提供できます。
-- ミラーには **一切書き込まれません**: `.coli_usage`、`.coli_kv` およびすべてのサイドカーファイルはプライマリに残ります。
-- ミラーでの読み込みエラーはプライマリにフォールバックします(警告 1 回、クラッシュなし)。そのため実行中に 2 台目のドライブを抜いても、サーバーが落ちるのではなく性能が低下するだけです。
-- ルーティングがトークンを変えることはありません。両コピーはバイト単位で同一です。`PROF=1` を有効にすると、ドライブごとに提供した GB 数を示す `MIRROR:` プロファイルカウンタが表示されます。
-
-同じエンジンがあらゆる規模をカバーします。25 GB のラップトップではすべてがディスクから
-ストリーミングされ(遅いが正しい)、大きなホストではエキスパート全体が常駐し
-(`CUDA_EXPERT_GB=auto PIN_GB=all`)、ディスクはデコード経路から完全に外れます。
-ティアの間には **学習キャッシュ** があります。エンジンは *あなたの* ワークロードがどの
-エキスパートにルーティングされるかを記録し(`.coli_usage`、ターンごとに更新)、最もホットな
-ものを自動でピン留めします — colibrì は文字どおり、使えば使うほど速くなります。マルチソケットの
-ホストでは、`COLI_NUMA=1` によって常駐する重みをメモリコントローラ間でインターリーブします
-([#82](https://github.com/JustVugg/colibri/issues/82))。
-
-モデル全体を置けない 2 台目のドライブ向けに、Colibri はすでに学習しているエキスパート履歴から
-部分ミラーの優先順位を付けられます。まずいくつかの代表的なプロンプトを実行して `.coli_usage` に
-ワークロードを反映させてから、ミラーを計画・ステージング・検証します:
+- **エキスパートティア**:GPU メモリ上の、ルーティングされるエキスパートのキャッシュです。起動時に過去の会話で使われたエキスパートで埋められ、チャット中にも適応していきます。GPU は自分が保持するエキスパートを計算し、その間に CPU が残りを計算します。
+- **密チェーン**:レイヤー 1 つ全体を 1 回の GPU サブミッションとして記録し、モデルの実行中の状態をレイヤーからレイヤーへと GPU 上に保持したままにします。
-```bash
-./c/coli mirror plan --model /fast/glm52_i4 --mirror /second/glm52_i4 \
- --budget-gib 200 --reserve-gib 20
-./c/coli mirror stage --model /fast/glm52_i4 --mirror /second/glm52_i4 \
- --budget-gib 200 --reserve-gib 20
-./c/coli mirror verify --model /fast/glm52_i4 --mirror /second/glm52_i4
-```
+マシン A の内蔵 Radeon 780M で計測しました。各実行の前にモデルファイルをページキャッシュから追い出し、100 トークンをデコードしています([vulkan.md](docs/vulkan.md#the-chain-on-a-radeon-780m)):
-プランナーは safetensors ヘッダを直接読み、`COLI_MODEL_DIRS` から分割モデルのディレクトリをたどり、
-最もホットなルーティングエキスパートを提供できるシャードを優先します。ステージングがプライマリの
-モデルを変更することはありません。一時ファイル経由でコピーし、指定された空き容量の予備を確保し、
-すべてのシャードを SHA-256 で検証し、既存のミラーシャードを削除することはなく、選択された
-ミラーの準備が整って初めてレシートをアトミックに公開します。
-
-### ディスクを二度待たない
-
-ミスはコストが高いため、エンジンは工夫の大部分をミスの回避とオーバーラップに費やします。
-各エキスパートの 3 つの行列は隣接して格納され、1 回の `pread` で読み込まれます。上限付きの
-非同期 I/O プール(`PIPE=1`、デフォルト)は、常駐しているエキスパートが計算している間に
-欠けているエキスパートをロードします。バッチ化された位置では一意なエキスパートを 1 回だけ読み込み
-(**batch-union**)、ルーター先読みスレッド(`PILOT=1`)が次のレイヤーのエキスパートを
-プリフェッチします — ルーティングは **1 レイヤー先を 71.6% の精度で予測可能** であることが計測されています。
-GPU では、常駐パイプライン(`COLI_CUDA_PIPE=2`)が残差ストリームをレイヤーをまたいでデバイス上に
-保持するため、CPU のエキスパートループは中断されずに実行されます。Apple Silicon では実験的な
-[Metal バックエンド](docs/metal.md) がユニファイドメモリ GPU 上でバッチ化されたエキスパート演算を行い、
-[Vulkan バックエンド](docs/vulkan.md) はエキスパートティア、密な射影、MLA アテンションのコアを、
-Vulkan 1.2 ドライバを持つあらゆる GPU にもたらします — Mesa/RADV 経由の AMD カードも含まれます
-(RX 580 のようにベンダーのスタックがサポートを終了したカードでは唯一のバックエンドであり、
-RDNA4 では ROCm と互角です — [ベンチマークに関するメモ](docs/vulkan.md) を参照)。
-他のすべてのエンジンも、`VK=1` ビルドで `COLI_VULKAN=1` を指定すると、常駐行列のために同じバックエンドを
-使うようになりました。CI では CPU のトークンと照合されていますが、最初に計測した実 GPU である内蔵
-Radeon 780M では、現時点では CPU より遅くなっています([その他のエンジン](docs/vulkan.md#the-other-engines))。
-
-> **実際の NVMe では `DIRECT=1` を計測してください。** O_DIRECT はページキャッシュをバイパスし、
-> DRAM キャッシュと帯域幅に余裕のあるドライブでは大きな改善になることが多いです(Blackwell/Windows
-> マシンで `PIPE=1` と併用してデコード +34% を計測、GB10 の iobench で 4.25→9.69 GB/s)。
-> ただしドライブ依存であり、QLC/DRAM レスや仮想化されたディスクでは効果なし〜逆効果になり得ます。
-> まず試して、ハードウェアが報いてくれる設定を残してください。
-
-### 忠実なモデル、圧縮された状態
-
-フォワードパスは `transformers` のオラクルに対して検証されています(teacher-forcing で
-通常 30〜32/32。小さなオラクルの 2 つの位置は浮動小数点上のほぼ同値で、ツールチェーンに依存します)。
-MLA アテンションは圧縮された KV 状態を保存します — 1 トークンあたり 32,768 個ではなく 576 個の
-浮動小数点数(**57 分の 1**)— そしてそれを再起動をまたいで永続化します(`.coli_kv`)。
-会話は再プリフィルなしでウォームな状態から再開され、中断されなかったセッションとバイト単位で同一です。
-DSA スパースアテンション(GLM-5.2 の lightning indexer)は忠実に実装されており、全キーを強制的に
-選択させたときに密なアテンションを正確に再現することで検証されています。
-
-### 投機的デコードを、誠実に
-
-GLM-5.2 のネイティブ MTP ヘッドがトークンをドラフトし、メインモデルが 1 回のバッチ化された
-フォワードでそれを検証します — 効果がある場合はフォワードあたり 2.2〜2.8 トークン。苦労して
-得た 2 つのルールがデフォルトとして組み込まれています。MTP ヘッドは **int8** でなければならないこと
-(int4 のヘッドは受理率が 0〜4% に崩壊します、[#8](https://github.com/JustVugg/colibri/issues/8))、
-そしてドラフトと検証は **同じ関数** を計算しなければならないこと — `SPEC_PIN=1` は両者を
-1 つのカーネルファミリーに固定します(詳しい調査の経緯は [#163](https://github.com/JustVugg/colibri/issues/163) にあります)。
-文法強制ドラフト([`GRAMMAR=file.gbnf`](docs/grammar-draft.md))は、制約付き JSON 出力で
-ほぼタダで受理率を上げます。投機的デコードが正味でプラスになるかはキャッシュの温まり具合に
-依存します — 計測し、効果がなければ `DRAFT=0` を使ってください。
-
-検証バッチでは、`COLI_EXACT_VERIFY=1` で **厳密なアテンションコア** をオプトインすることもできます
-([#689](https://github.com/JustVugg/colibri/issues/689))。CPU の MLA-absorb のスコアとコンテキストの内積は
-整数の積を累積して 1 回だけ丸めるため、検証行でのほぼ同値はどのホストでも同じように決着します。代償は
-小さなオラクルで約 0.6 倍の tok/s です(内積自体は浮動小数点ループの約 5〜7 倍)。知っておくべき制限が
-2 つあります: 量子化された KV キャッシュ(`tq1`、TQ、int8 KV)ではコンテキストの内積は浮動小数点の経路の
-ままなので、そこでの厳密性は提供されません。また、実際のほぼ同値による反転はまだ論じられただけで、
-n=64 の GLM-5.2 ではまだ捕捉されていません。
-
-## 何を実現しているか
+| | CPU | Vulkan、エキスパートティア | Vulkan、ティアと密チェーン |
+|---|---|---|---|
+| Qwen3.6-35B-A3B、デコード | 6.0 tok/s | 8.0 tok/s | **9.9 tok/s** |
+| Qwen3.6-35B-A3B、512 トークンのプロンプト | 35.7 秒 | 12.2 秒 | **9.5 秒** |
+| Qwen3.8-Flash-Next(int4 エキスパート)、デコード | 3.5 tok/s | **3.8 tok/s** | 3.2 tok/s |
+| Qwen3.8-Flash-Next、512 トークンのプロンプト | 43.6 秒 | 38.7 秒 | **30.1 秒** |
+| OLMoE、デコード(ウォーム) | **23.1 tok/s** | 12.8 tok/s | 17.3 tok/s |
-<p align="center">
- <img src="docs/media/ladder.png" width="880" alt="ハードウェアクラス別の計測デコード速度">
-</p>
+内蔵 GPU は CPU と RAM を共有しています。内蔵 GPU が節約するのは、保持しているエキスパートの計算とディスク読み込みです。そのため Qwen3.6 のようなモデルでは効果がありますが、OLMoE のようにエキスパートがすでに RAM にある小さなモデルでは、かえって遅くなることがあります。だからセットアップは、内蔵 GPU では Qwen3.6、Qwen3-Coder、Qwen3.8-Flash-Next の場合にだけ Vulkan を有効にし、各エンジンもそこで密チェーンを動かすかどうかを自分で判断します(Qwen3.6 は動かし、Qwen3.8 は動かしません)。それでも Vulkan を使いたい場合は `--backend vulkan` を指定します。
+
+ディスクリート GPU では、セットアップはすべてのエンジンを Vulkan 向けにビルドし(エンジンに CUDA の経路があり、ツールキットがインストールされている場合は CUDA が優先)、密レイヤーをカード上に置きます。これこそこの設計が想定しているケースですが、**まだ計測されていません:エキスパートティアも密チェーンも、ディスクリート GPU ではまだ一度も動かされていません。**(これらより前の、GLM-5.2 の以前の Vulkan 経路は、ディスクリートの RX 9070 で 1.7-1.8 tok/s でデコードしました。)あなたのカードでの数値を歓迎します。
+
+**Resizable BAR のないカード** でも動くようになりました。そうしたカード(すべての Turing カード、発売時のファームウェアのままの Ampere カード、このオプションを無効にした古い AMD カード)では、CPU がカードのメモリに直接書き込めるのは約 256 MB だけです。colibri は現在、ステージングバッファを通して重みを自動でコピーします。この経路は、強制的に使わせる方法と、3 つのデバイスで小さなウィンドウをエミュレートする方法でテストされており、780M では計測できるほどのコストはありません。ただし、Resizable BAR のないカードではまだ計測されていません([vulkan.md](docs/vulkan.md#memory-placement-without-resizable-bar))。
-同じエンジン、同じ int4 コンテナ — ハードウェアが変えるのはエキスパートの置き場所だけです。
-[完全なベンチマーク表](docs/benchmarks.md) からのハイライト:
+CI は、ソフトウェアドライバ上で、すべてのエンジンの Vulkan 経路を CPU のトークンと照合しています。GPU は数値を異なる順序で足し合わせ、CPU が丸める一部の活性値を f32 のまま保持するため、長い回答では CPU の回答と 1 単語ずれることがあります([vulkan.md](docs/vulkan.md#the-other-engines))。
-- **6× RTX 5090、完全常駐:** デコード 5.8〜6.8 tok/s、TTFT 約 13 秒
- ([実験ログ](docs/experiments/glm52-6x5090-2026-07-12.md))
-- **128 GB の CPU のみのデスクトップ:** ウォーム時 約 1.8 tok/s([#200](https://github.com/JustVugg/colibri/issues/200))
-- **RTX 5070 Ti 1 枚のラップトップ級マシン:** GPU 常駐パイプラインで 1.07 tok/s
- ([#273](https://github.com/JustVugg/colibri/issues/273))
-- **25 GB の開発マシン:** コールド時 0.05〜0.1 tok/s — このプロジェクトが始まった実証済みの下限であり、
- 今も誠実なベースラインです。
+### CUDA:NVIDIA カード
-品質は仮定ではなく計測されています。int4 コンテナの量子化コストと、スケール粒度/回転の
-アブレーションは [docs/benchmarks.md](docs/benchmarks.md#quality-benchmark) と
-[#108](https://github.com/JustVugg/colibri/issues/108)/[#81](https://github.com/JustVugg/colibri/issues/81) にあります。
+Linux で CUDA ツールキットがインストールされている場合、セットアップは CUDA の経路を持つエンジンを CUDA 向けにビルドします:GLM-5.2/5.3、GLM-5.3-Flash、Inkling、Kimi K3、DeepSeek V4 Flash、Qwen3.8-Flash-Next、そして Qwen3.6 と Qwen3-Coder です。Windows では CUDA エンジンは別の DLL です([windows.md](docs/windows.md))。
-## はじめに
+- **VRAM エキスパートティア** は、計測されたルーティングから選んだ最もホットなエキスパートをカード上に置きます。ミスしたエキスパートは同時に CPU で計算されます。8 GB のカード 2 枚(RTX 3070 と Quadro RTX 4000)での Qwen3.6 は、履歴が温まった状態で 11.3 tok/s でデコードしました([qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md))。全エキスパートを常駐させた RTX 5090 6 枚での GLM-5.2 は 9.0-9.2 tok/s([benchmarks.md](docs/benchmarks.md))。RTX 5080 での DeepSeek V4 Flash は 1.5-1.6 tok/s で、3,324 トークンのプロンプトを 90 秒で処理しました([deepseek-v4.md](docs/deepseek-v4.md))。
+- **Qwen3.6 の新機能:DeltaNet レイヤーをカード上で実行**(`Q36_DN_GPU=1`、オプトイン)。これまで Qwen3.6 の 30 個の DeltaNet レイヤーはそれぞれ、1 トークンごとに 4 回、カードと CPU の間でデータをコピーしていました。現在はデコード時の 1 トークンがレイヤー全体をカード上で実行し、そのリカレント状態は VRAM に保持されます。密レイヤーを VRAM に置いた RTX 3070 で:25.4 から 30.0 tok/s に向上しました([qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md#the-deltanet-layer-on-the-card-q36_dn_gpu1))。
+- **古いカード。** CUDA ツールキットがもうあなたのカード向けにコンパイルできない場合([#1852](https://github.com/JustVugg/colibri/issues/1852) の CUDA 13 と V100 の例)、ビルドは止まります:その場合は `--backend vulkan` で、代わりに Vulkan 経由でカードを使います。DeepSeek V4 の CUDA ティアは Pascal と Turing 向けにもビルドできます(`CUDA_ARCH=portable-pre-ampere NO_TC=1`)。
-必要なものは 2 つです: **プログラム**(数百 KB)と **モデル**(429 GB)。
-全プラットフォーム向けの手順は [クイックスタートガイド](docs/quickstart.md) にあります。
+すべての詳細:[docs/cuda.md](docs/cuda.md)。
-### ワンステップで始める
+### Apple Silicon
-**Windows:** リポジトリをダウンロードし(**Code** から **Download ZIP**、または
-`git clone`)、展開して **`START-HERE.bat`** をダブルクリックします。
-**Linux と macOS:**
+いくつかのエンジンでは、Metal バックエンドがユニファイドメモリ GPU 上でエキスパートの演算を行います。`METAL=1` でビルドしてください([docs/metal.md](docs/metal.md))。macOS では、ワンステップのセットアップは CPU 向けにビルドします。
+
+<a id="system-one-mode-ask-a-closed-question"></a>
+<a id="system-one-a-decision-with-a-probability"></a>
+
+## System One:確率付きの判定
+
+人がモデルに求めることの多くは、段落ではなく選択です:どのキューか、どの判定か、イエスかノーか。`POST /v1/systemone` は状態(テキストまたは JSON)と型付きの質問を受け取り、それぞれの質問に、許可された各選択肢の確率と確信度 (confidence) を付けて答えます。何も生成しないので、どの回答もリストの外に出ることはなく、「モデルに確信がない」ことが、閾値を設定できる数値になります。
```bash
-git clone https://github.com/JustVugg/colibri && cd colibri
-./start-here.sh
+curl -s http://127.0.0.1:8000/v1/systemone -H 'Content-Type: application/json' -d '{
+ "state": "340 lines, 8 files, no tests. CI is green but nothing covers that path.",
+ "questions": {
+ "review": {"type": "choice", "instructions": "What should the reviewer do?",
+ "criteria": {"merge": null, "request changes": null, "close": null}},
+ "risky": {"type": "noul", "instructions": "Is this change risky?"}}}'
```
-RAM・ディスク・GPU を検出し、このマシンに収まるモデルを推奨し(Enter でそのまま
-選択)、GPU が使える場合は Vulkan または CUDA でエンジンをビルドし(またはビルド済み
-のものを取得し)、モデルを再開可能な形でダウンロードし(いつ中断しても、もう一度
-実行すれば続きから再開します)、ブラウザでダッシュボードを開きます。他のアプリ向けに
-OpenAI と Anthropic のベース URL も表示します。次回からは実行するだけで colibri が
-すぐに起動し、`c/coli stop` で停止します。各ステップの内容:
-[quickstart.md](docs/quickstart.md#the-one-step-way)。
+`choice` は、選ばれたラベル、すべてのラベルの確率、そして 0(平坦)から 1(確実)までの `confidence` を返します。`noul` はイエスの確率を、`score` は期待されるレベルを返します。
-AI コーディングアシスタントを使っていますか? [docs/AI_SETUP.md](docs/AI_SETUP.md) に従って colibri をセットアップするよう頼んでください。
-Model Context Protocol に対応したアシスタントは `coli mcp` を使えます
-([MCP_SERVER.md](docs/MCP_SERVER.md))。
+答えるのは:
-以下は手動での手順です。
+- **colibri が動かすすべてのチャットモデル**。スコアリングによって答えます:回答を書く代わりに、各選択肢の確率を読み取ります。1 つの文書についての複数の質問は、文書を 1 回だけ読みます:Qwen3.6 では、1 つの文書についての 4 つの質問が、同じ CPU マシンで同じ回答を生成する場合より 5.7 倍速く返ってきました。
+- **3 つの判定モデル**。作者が調整した較正を使い、1 回のフォワードパスでネイティブに答えます:[Laya](docs/laya.md)(Convai Innovations)、[GLiNER2.5-Decide](docs/gliner_decide.md)(fastino)、[Clef](docs/clef.md)(Cloudflare。チャットも可能)。サイズと速度は[判定モデルの表](#which-model-for-my-machine)にあります。
-### 1. colibri を入手する
+**Jev からの切り替え。** リクエストとレスポンスは TypeSafe の Jev API と同じなので、Jev のクライアントは base URL を変えるだけで、ほかは何も変えずに colibri に切り替えられます:`TYPESAFE_BASE_URL=http://127.0.0.1:8000`(クライアントがすでに送っているキーは、`COLI_API_KEY` なしで起動したサーバーなら受け入れられます)。2 つの公式 SDK は、改変なしのまま `coli serve` に対してテストされています。
-**ビルド済みリリースをダウンロード** — Linux、macOS、Windows に対応し、コンパイラは不要です。
-[Releases](https://github.com/JustVugg/colibri/releases) から自分のプラットフォーム用の
-アーカイブを取得して展開します:
+同じモードはターミナル(`coli chat` での `/decide merge | request changes | close`)と、ダッシュボードの System One ページにもあります。リクエストとレスポンスの全体、スコアリングのルール、そして役に立たない場面:[docs/systemone.md](docs/systemone.md)。
-```bash
-mkdir colibri && tar xzf colibri-v1.8.0-linux-x86_64.tar.gz -C colibri && cd colibri
-python3 coli info # engine ready ✓
-```
+## ダッシュボード
-中にはエンジン(`colibri`、Windows では `colibri.exe`)、`coli` ランチャー、その Python
-ヘルパーが入っています。名前の変更や設定は不要です — `coli` は自分の隣にあるエンジンを見つけます。
-必要なのは [Python 3](https://www.python.org/downloads/) のインストールだけです。ランチャーと
-API ゲートウェイは Python スクリプトですが、エンジン自体は依存ゼロの純粋な C です。
+`coli web` で開きます。ワンステップのセットアップでも開きます:チャット、System One ページ、Brain、Profiling ページがあり、ライトテーマとダークテーマに対応しています。
-**またはソースからビルド** — OpenMP 対応の `gcc`(または clang)が必要です:
+<p align="center">
+ <img src="docs/media/colibri-dashboard.png" width="900" alt="colibri の Web ダッシュボード:チャット、ライブメトリクス、ハードウェアパネル、エキスパートのティア">
+</p>
+<p align="center"><em>CPU マシン上で、ディスクからストリーミングされるエキスパートを使って応答する Qwen3.6。</em></p>
-```bash
-git clone https://github.com/JustVugg/colibri && cd colibri/c
-./setup.sh # gcc/OpenMP を確認し、ビルドとセルフテストを実行
-```
+<p align="center">
+ <img src="docs/media/colibri-brio.png" width="900" alt="System One ページ:1 回だけ読まれる文書、許可された各回答の確率、そしてエントロピー">
+</p>
+<p align="center"><em><strong>System One</strong>:モデルに文書と、選んでよい回答だけを渡します。ここでは
+<strong>request changes が 99.9%</strong>、エントロピー 0.005、読み取り 4 トークン、生成 0 トークンです。</em></p>
-`coli` を PATH に置きたい場合は、チェックアウトから `pip install -e .` を実行すると登録されます
-(エンジンは引き続き `c/` にあります — wheel ではなく、クローンからの editable インストールです)。
+<p align="center">
+ <img src="docs/media/colibri-brain.png" width="900" alt="Brain ページ:皮質として描かれた GLM-5.2 の計測されたエキスパートアトラスと、中に入れる 10 の領域">
+</p>
+<p align="center"><em><strong>Brain</strong>:GLM-5.2 の<a href="https://github.com/JustVugg/colibri/issues/175">計測されたエキスパートアトラス</a>。
+特性が明らかになった 13,260 個のエキスパートが 10 の領域(Python、SQL、数学、詩、法律、中国語...)に分かれ、計測された
+ルーティング親和性に従って配置されています。<strong>Live routing</strong> は実行中のモデルを表示します:エキスパートごとに 1 セル、
+色はストレージのティアを表し、1 ターンでルーティングされたエキスパートはすべて光ります。</em></p>
-### 2. モデルを入手する
+**Profiling** ページは、各ターンがどこで時間を使っているかをフェーズごとに示し、直近 30 ターンを推移として表示します。
-変換済みの **GLM-5.2 int4** コンテナが Hugging Face にあります — **int8 MTP ヘッド** 付きの
-**グループスケール(gs64)** ビルドを使ってください。サイズは約 **429 GB** なので、
-十分な容量のある、できれば高速なディスクに置いてください:
+## ほかのアプリから使う
-**https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp**
+`coli serve`(セットアップが起動してくれるもの)は、複数の API を備えた 1 つのサーバーです:
-**GLM-5.3** は同じファミリーで、同じエンジンでロードできます。専用のコンテナがあり、こちらもグループスケール
-(gs64)で、約 **419 GB** です。MTP ヘッドは **含まれていない** ため、投機的デコードはオフのままです:
+- **OpenAI 互換**:`/v1/chat/completions`、`/v1/completions`、`/v1/models`。ストリーミング、JSON での応答、停止シーケンス、logprobs に対応しています。
+- **Anthropic 互換**:`/v1/messages`。Claude Code や Anthropic の SDK をそのまま接続できます。
+- **ツール呼び出し**:Inkling と OLMoE を除くすべてのチャットエンジンで、それぞれのモデルのネイティブ形式で行います([エンジンごとの表](docs/api.md#tool-calling-support))。
+- **画像入力**:GLM-5.3-Flash、DeepSeek V4.1 Flash、MiMo-V2.6、Qwen3.8-Flash-Next、Qwen3.8-27B で使えます。`coli chat` のメッセージ内のパス、`coli web` での添付、または `image_url` パートで渡します。
+- **画像出力**:Qwen-Image-2.1 で `POST /v1/images/generations` から生成します。`coli chat` ではターミナル内に描画されます([qwen-image.md](docs/qwen-image.md))。
+- **判定**:`POST /v1/systemone` で行います([前述](#system-one-a-decision-with-a-probability))。
-**https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64**
+コーディング用の CLI やエディタは、ほかの OpenAI 互換プロバイダーと同じように接続できます:base URL は `http://127.0.0.1:8000/v1`、モデル ID は `coli status` が表示するもの、キーは空でなければ何でもかまいません([docs/api.md](docs/api.md#connect-a-coding-cli-or-editor))。
-> ⚠️ 古い行単位 int4 のミラー(`mateogrgic/…`、`jlnsrk/…`)ではなく、上記の **gs64** コンテナを
-> 使ってください。それらは品質が約 9 ポイント劣ることが計測されており、
-> [#455](https://github.com/JustVugg/colibri/issues/455) で報告された当初の思考モードのループや
-> 終わらない生成の根本原因でした。gs64 コンテナは制御された行単位の A/B で見られたそれらの問題を
-> 解消しましたが、繰り返しや EOS 欠乏に対する汎用的なガードではありません。MTP ヘッドも
-> **int4 ではなく int8** である必要があります
-> (int4 → ドラフト受理率 0%、[#8](https://github.com/JustVugg/colibri/issues/8)):
-> `ls -l <model>/out-mtp-*` — int8(正しい)なら 3 ファイルで `3527131672 / 5366238584 / 1065950496`、
-> または単一の `out-mtp-00000.safetensors` で `9959321520` バイトです
-> (推奨コンテナの現在のアップロードは 1 ファイルで配布されています: 中身は同じ
-> int8 テンソルで、1 要素 1 バイトのものが 777 個です)。
+<a id="how-it-works"></a>
-あるいは FP8 のソースから自分で変換することもできます — 756 GB 全体を一度にディスクに置く必要のない、
-再開可能なコマンド 1 つで行えます:
+## 仕組み
-```bash
-./coli convert --model /nvme/glm52_i4 # シャードごとにダウンロード+変換(python、初回のみ)
-```
+<p align="center">
+ <img src="docs/media/token-path.png" width="880" alt="ルーティング、和集合、配置、オーバーラップ、学習">
+</p>
-<a id="other-supported-models"></a>
-#### その他の対応モデル
-
-GLM-5.2 がリファレンスモデルですが、同じストリーミング手法でさらに 9 つの言語モデルファミリーが動作し、
-画像を生成するエンジンも 1 つあります。それぞれが **兄弟エンジン** です: C ファイル 1 つで独自の
-アーキテクチャを持ち、同じ `coli chat` / `coli serve` / `coli web` フロントエンドを使います(ランチャーは
-モデルの `config.json`、画像モデルでは `model_index.json` からバイナリを選びます):
-
-> **それぞれに必要なもの。** これらは大きく異なり、2 つを並べて読んだ人が要件が矛盾していると
-> 誤解したこともあります([#191](https://github.com/JustVugg/colibri/issues/191))。矛盾してはいません —
-> 別々のモデルなのです。**どれも GPU は必要ありません。**
->
-> | モデル | 重み用のディスク | RAM | GPU |
-> |---|---|---|---|
-> | **OLMoE** | 約 7 GB(int8 コンテナ) | 8 GB | 不要。Vulkan はオプトイン |
-> | **GLM-5.2/5.3** | 約 429 GB(5.2)/ 約 419 GB(5.3) | 最低 16 GB、快適には 24 GB | 不要。Vulkan はオプトイン |
-> | **GLM-5.3-Flash** | 変換後 約 195 GB | 25 GB(int4 の重み 12 GB + エキスパートキャッシュ) | 不要。Vulkan はオプトイン |
-> | **Inkling** | 約 469 GB | int4 密コンテナ使用時 25 GB、未使用時 約 120 GB | 不要。Vulkan はオプトイン |
-> | **Kimi K3** | 約 1.6 TB | 32 GB 以上 | 不要。Vulkan はオプトイン |
-> | **DeepSeek V4 Flash** | 約 167 GB(REAP 150B: 約 85 GB) | 最低 16 GB、快適には 32 GB | オプション。GTX 10 シリーズ以降の任意の NVIDIA カード(Pascal/Turing は `CUDA_ARCH=portable-pre-ampere NO_TC=1` で、RTX 50 で最良)により、プリフィルが 5〜10 倍、デコードが約 2.5 倍高速化。Vulkan はオプトイン |
-> | **DeepSeek V4.1 Flash** | 約 510 GB(公式チェックポイント。うち 203 GB は一度に数百バイトずつ読まれる n-gram メモリ) | 常駐 約 18 GB(密部分、埋め込み、ビジョン)+ `--ram` で決まるエキスパートキャッシュ。cap 8 でピーク RSS 24.8 GB を計測 | 不要。Vulkan はオプトイン |
-> | **MiMo-V2.6 Flash** | 約 178 GB(公式チェックポイント) | レイヤーあたり 32 エキスパートをキャッシュして常駐 30.1 GB、64 で 49.8 GB を計測。キャッシュは `--ram` で決まる | 不要。Vulkan はオプトイン |
-> | **MiMo-V2.6 Pro** | 約 574 GB(エンジンが読み込まない 3 ファイルを除くと約 564 GB) | 密部分はリリースのままで 30.2 GiB、int8 で 21.7 GiB。レイヤーあたり 12 エキスパート(密部分はリリースのまま)で常駐 48.0 GB、20(密部分は int8)で 50.7 GB を計測 | 不要。Vulkan はオプトイン |
-> | **Qwen3.8-Flash-Next** | 約 185.5 GB(公式 FP8 チェックポイント)、オプションの int4-g64 エキスパートサイドカーに追加で 68.0 GB | FP8 エキスパートならデフォルトのコンテキストで快適には 24 GB(cap 32。16 GB では足りない)。int4-g64 サイドカー使用時は cap 32 で RSS 11.6 GB を計測 | オプション。CUDA VRAM エキスパートティア(FP8 エキスパートのみ)、密なトランクは VRAM 上で int8 に量子化。Vulkan はオプトイン |
-> | **Qwen3.8-27B**(密モデル、テキストと画像) | 変換後 約 51 GB(f16) | int4 の密な重みで 20 GB、int8 で 30 GB | 不要。CUDA ティアはまだなし。Vulkan はオプトイン |
-> | **Qwen3.6-35B-A3B** | 約 23 GB(int4-gs64 コンテナ) | 24 GB(RAM への完全常駐が必要) | オプション。CUDA VRAM エキスパートティアは 8 GB カード 2 枚で **1.44 -> 10.05 tok/s(7.0 倍)** を計測、出力は CPU とビット単位で同一。Vulkan はオプトイン |
-> | **Qwen3-Coder-30B-A3B** | 約 19 GB(int4-gs64 コンテナ。int8 では 30 GB) | レイヤーあたり 32 エキスパートをキャッシュして常駐 6.5 GB、128 個すべてで 15.2 GB を計測 | 不要。Vulkan はオプトイン |
-> | **Qwen-Image-2.1**(テキストから画像) | 約 33 GB(公式 diffusers チェックポイント) | すべて常駐で 16.0 GB、テキストエンコーダをプロンプトごとに読み込むとピーク 8.5 GB、これに作業バッファが加わる(768x512 の画像 1 枚でピーク 9.0 GB を計測) | 不要。Vulkan はオプトイン、GPU での計時はまだなし |
->
-> GPU はモデルの答えを変えません。変わるのは処理がどこで走るかだけです。エキスパートはディスクから
-> ストリーミングされるため、速度はディスクで決まります。遅いドライブでは 1 秒あたり 1 トークン未満、
-> 高速なドライブでキャッシュが温まっていれば 1 秒あたり数トークンを想定してください。
->
-> **Vulkan はオプトイン** とは `VK=1` ビルドのことです。`COLI_VULKAN=1` で実行すると、エンジンは常駐行列を
-> Vulkan 1.2 ドライバを持つ任意の GPU に置きます(GLM-5.2 はそこに完全なデコード経路を持ちます)。
-> CI はそれらのエンジンをソフトウェアドライバ上で CPU の
-> トークンと照合しています([vulkan.md](docs/vulkan.md#the-other-engines))。正しいことと速いことはまだ
-> 別です。これらのエンジンで最初に計測した実 GPU である内蔵 Radeon 780M(Ryzen 7 PRO 8700GE、同じ
-> バイナリ、コールドなページキャッシュ)では、現時点では CPU より遅くなっています: Qwen3.6-35B-A3B の
-> デコードは CPU の 5.97 tok/s に対して 3.06 tok/s(出力は同一)、int4 エキスパートの Qwen3.8-Flash-Next は
-> 3.55 に対して 1.53 でした。すべての行列積が同期的な submit で 1 トークンあたり約 726 回あり、内蔵 GPU は
-> CPU と同じ RAM を読むためです。
-
-| ファミリー | 総数 / アクティブ | 重み | ビルド | ドキュメント |
-|---|---|---|---|---|
-| **GLM-5.2/5.3** | 744B / 40B | [`mastouri/…-int4-g64-with-int8-mtp`](https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp)(429 GB)または [`Justvugg/GLM-5.3-colibri-int4-g64`](https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64)(419 GB) | `make -C c glm` | このページ |
-| **Inkling**(Thinking Machines) | 975B / 41B | [`nbeerbower/Inkling-colibri-int4`](https://huggingface.co/nbeerbower/Inkling-colibri-int4)(469 GB) | `make -C c inkling` | [inkling.md](docs/inkling.md) |
-| **GLM-5.3-Flash**(Z.ai) | 321B / 18B | [`zai-org/GLM-5.3-Flash`](https://huggingface.co/zai-org/GLM-5.3-Flash)。ルーティングエキスパートを **int4-gs64** に変換、密部分は BF16 のままで精度はロード時に選択。ビジョン対応 | `make -C c glm53` | [glm53-flash.md](docs/glm53-flash.md) |
-| **Kimi K3**(Moonshot) | 2.8T / 104B | [`moonshotai/Kimi-K3`](https://huggingface.co/moonshotai/Kimi-K3) — オリジナルのチェックポイント、ルーティングエキスパートは **ネイティブ MXFP4** のまま | `make -C c kimi_k3` | [kimi_k3.md](docs/kimi_k3.md) |
-| **DeepSeek V4 Flash** | 284B / 13B | 公式のシャード化チェックポイント — ルーティングエキスパートは **ネイティブ fp4**、密部分は fp8-e4m3 のまま。**REAP で枝刈りした 150B**([`puwaer/DeepSeek-V4-Flash-0731-reap-150b`](https://huggingface.co/puwaer/DeepSeek-V4-Flash-0731-reap-150b)、85 GB、256 個中 132 個のエキスパート)も同じエンジンで変換なしにロード可能 | `make -C c deepseek-v4` | [deepseek-v4.md](docs/deepseek-v4.md) |
-| **MiMo-V2.6 Flash**(Xiaomi) | 309B / 15B | [`XiaomiMiMo/MiMo-V2.6-Flash-MOPD`](https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Flash-MOPD)(178 GB)、公式チェックポイント、**変換不要**: ルーティングエキスパートは **ネイティブ MXFP4** のまま、密部分は FP8/BF16。48 層のうち 39 層は 128 トークンのウィンドウを参照するため、長いコンテキストでも KV は 9 層分だけ。ビジョンとツール呼び出しに対応 | `make -C c mimo` | [mimo.md](docs/mimo.md) |
-| **MiMo-V2.6 Pro**(Xiaomi) | 1.02T / 42B | [`XiaomiMiMo/MiMo-V2.6-Pro-MOPD`](https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Pro-MOPD)(573.5 GB)、公式チェックポイント、**変換不要**、MiMo エンジンで動作: 同じアーキテクチャで 70 層、384 エキスパート。全 70 層のうち最初の 32 層について Xiaomi 自身のモデリングコードと照合済み。ビジョンとツール呼び出しに対応 | `make -C c mimo` | [mimo.md](docs/mimo.md#pro) |
-| **DeepSeek V4.1 Flash** | 552B / 16B | 公式チェックポイント、**変換不要**: エキスパートはすでに fp4、密部分は fp8-e4m3。そのうち 203 GB は一度に数百バイトずつディスクから読まれる n-gram メモリで、ルーティングエキスパートのコストは GLM-5.2 の 12.7 GB に対して **1 トークンあたり 4.5 GB**。ビジョン、ツール呼び出し、DSpark ドラフトヘッドはすべて有効 | `make -C c deepseek_v41` | [deepseek-v41.md](docs/deepseek-v41.md) |
-| **Qwen3.8-Flash-Next**(Alibaba) | 125B + 51B n-gram / 6B | [`Qwen/Qwen3.8-Flash-Next-FP8`](https://huggingface.co/Qwen/Qwen3.8-Flash-Next-FP8)、オリジナルのチェックポイント。PLE はページング可能なまま、エキスパートは **ネイティブのブロック FP8** のまま、またはオプションのサイドカーから **int4-g64** として読み込み(下記参照)。MTP ドラフトはオプトイン(`Q38_MTP=1`) | `make -C c qwen38`(VRAM エキスパートティアには `CUDA=1`) | [qwen38.md](docs/qwen38.md) |
-| **Qwen3.6**(Alibaba) | 35B / 3B | [`Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64`](https://huggingface.co/Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64)(約 23 GB、**推奨**)— Gated Attention + Gated DeltaNet のハイブリッド | `make -C c qwen36`(VRAM エキスパートティアには `CUDA=1`) | [qwen36.md](docs/qwen36.md) |
-| **Qwen3.8-27B**(Alibaba) | 27B、密モデル | [`Qwen/Qwen3.8-27B`](https://huggingface.co/Qwen/Qwen3.8-27B) を `c/tools/convert_qwen36.py` で f16 コンテナ(51 GB)に変換。エンジンはロード時に int8、`COLI_DENSE_BITS=4` なら int4 に量子化。レイヤーごとに MLP が 1 つでルーターはなく、Qwen3.6 エンジンで動作。テキストと画像に対応 | `make -C c qwen36` | [qwen36.md](docs/qwen36.md#the-dense-27b) |
-| **Qwen3-Coder-30B-A3B**(Alibaba) | 30B / 3B | [`Justvugg/Qwen3-Coder-30B-A3B-colibri-int4`](https://huggingface.co/Justvugg/Qwen3-Coder-30B-A3B-colibri-int4)(19 GB、int4-gs64)、[`Qwen/Qwen3-Coder-30B-A3B-Instruct`](https://huggingface.co/Qwen/Qwen3-Coder-30B-A3B-Instruct) から変換。Qwen3.6 エンジンで動く全層アテンションの Qwen3 MoE で、128 エキスパートの top-8、独自の XML 形式のツール呼び出しを持ち、思考モードはなし。teacher forcing で、int4 コンテナは 96.9% の位置で bf16 リリースと同じ top-1 トークンを選ぶ | `make -C c qwen36` | [qwen36.md](docs/qwen36.md#qwen3-coder-30b-a3b) |
-| **OLMoE**(AI2) | 7B / 1B | `c/tools/convert_olmoe_merged.py` で変換 — **int8** コンテナ、約 7 GB | `make -C c olmoe` | — |
-| **Qwen-Image-2.1**(Alibaba) | 画像モデル | [`Qwen/Qwen-Image-2.1`](https://huggingface.co/Qwen/Qwen-Image-2.1)(約 33 GB)、公式 diffusers チェックポイント、**変換不要**: テキストエンコーダと拡散トランスフォーマーはロード時に int8 に量子化。`coli chat` では画像をインライン表示し、`coli serve` では `POST /v1/images/generations` で提供。Qwen Research License: 非商用利用のみ | `make -C c qwenimage` | [qwen-image.md](docs/qwen-image.md) |
-| **Laya**(Convai Innovations) | 判定モデル、421M | [`convaiinnovations/laya`](https://huggingface.co/convaiinnovations/laya)(842 MB)、公式チェックポイント、**変換不要**: ModernBERT エンコーダと判定ヘッドで、型付きの質問(choice、score、noul)に生成ではなく較正済みの確率で答える。`coli serve` の `POST /v1/systemone` で提供。Apache-2.0 | `make -C c laya` | [laya.md](docs/laya.md) |
-| **GLiNER2.5-Decide**(fastino) | 判定モデル、340M | [`fastino/GLiNER2.5-Decide`](https://huggingface.co/fastino/GLiNER2.5-Decide)(1.9 GB)、公式チェックポイント、**変換不要**: DeBERTa-v3 エンコーダと GLiNER2 の分類ヘッド。リクエストの全質問と状態を一度に読み、各選択肢に確率を返す。`coli serve` の `POST /v1/systemone` で提供。Apache-2.0 | `make -C c gliner_decide` | [gliner_decide.md](docs/gliner_decide.md) |
-| **Clef**(Cloudflare) | 判定モデル + チャット、27B | [`Cloudflare/clef`](https://huggingface.co/Cloudflare/clef)(55 GB)、`c/tools/convert_qwen36.py` で変換(52 GB、ヘッド込み): Qwen3.8-27B を追加学習し、すべての質問のすべての選択肢を 1 回のパスで採点する結合スキーマヘッドを付けたモデル。`POST /v1/systemone` にネイティブに答え、チャットは Qwen3.8-27B と同様に動作。Apache-2.0 | `make -C c qwen36` | [clef.md](docs/clef.md) |
-
-Qwen3.6 には変換済みコンテナが 3 つあります: **int4-gs64**(推奨 — int8 のアンカーに対するコサイン類似度は
-行単位と比べて 0.98777 → 0.99313、KL は 0.109 → 0.080 と計測されており、量子化誤差が約 44% 少ない)、
-A/B のベースラインとしての [int4 行単位](https://huggingface.co/Kreuzzelg/qwen36-35b-a3b-colibri-i4)、
-そして [KAT-Coder v2.5](https://huggingface.co/Kreuzzelg/kat-coder-v2.5-dev-colibri-i4-gs64) です。
-KAT-Coder は同じエンジンでそのまま動きます — アーキテクチャが同一のチェックポイントであれば、
-専用のコードパスなしで動作します。`CUDA=1` を使うと、VRAM エキスパートティアは
-**8 GB カード 2 枚で 1.44 → 10.05 tok/s(7.0 倍)** を計測し、出力は CPU の経路とビット単位で同一でした。
-
-Qwen3.8-Flash-Next はルーティングエキスパートをリリースどおりのブロック FP8 で読み込みます。オプションの
-**int4-g64 サイドカー**(`c/tools/convert_qwen38_experts_int4.py`、FP8 シャードの隣に 68.0 GB を書き込む)を
-使うと、ミス 1 回あたりの読み込みバイト数は 56% になります。Ryzen 7 PRO 8700GE(16 スレッド、61 GiB、NVMe)
-での計測では、同じキャッシュサイズでデコードが 1.4〜1.5 倍、同じ RAM では 1.56 倍速くなり、パープレキシティの
-増加は平均で 1 トークンあたり +0.017 nats でした([qwen38.md](docs/qwen38.md#routed-experts-as-int4-g64))。
-チェックポイント自身の MTP ヘッドによる投機的デコードはオプトイン(`Q38_MTP=1`)で、出力は通常のデコードと
-同一です。同じマシンで int4 エキスパートを使った場合、ドラフトの 94〜96% が受理され、1 フォワードあたり
-1.94 トークン、tok/s は +12〜14%(cap 96 で 3.57 → 4.01、cap 170 で 4.15 → 4.74)でした。そこで伸びが
-小さいのは、ディスクからのエキスパート読み込みが減らないためです([qwen38.md](docs/qwen38.md))。
-
-Kimi K3 は変換不要です。QAT で学習された MXFP4 エキスパートはオリジナルの Hugging Face シャードから
-直接ストリーミングされ、bf16 の密な重みセットはロード時に量子化されます。長いエージェントセッションでは、
-リカレント状態のチェックポイントをオプトインできます(RAM 上に `COLI_K3_CKPT=N` スロット、または
-`COLI_K3_CKPT_DIR` でディスクに退避)。編集されたプロンプトやフォローアッププロンプトは、残っている
-最も深いチェックポイントを復元して末尾だけを再プリフィルするため、会話全体を SSM レイヤーで
-再生し直す必要がありません。Vulkan ホスト(`COLI_VULKAN=1`)では、ルーティングされたエキスパートが
-共有のエキスパートティアに載り、エキスパート履歴から埋められ、ルーティングの変化に合わせて
-入れ替わります。エンジンの KDA と MLA の経路は、CI でベンダー実装に
-対してトークン単位で完全一致することが検証されています。
-
-Inkling は int4 のエキスパートと **bf16 の密な重み**(常駐 49.4 GB)で提供されています。それを
-保持できないホスト向けに、[inkling.md](docs/inkling.md) には密な重みセットを 15.3 GB にする
-ワンパスのツールがあり、975B を 25 GB のマシンで動かせます — トレードオフも誠実に書かれています。
-
-### 3. 実行する
+すべてのトークンのすべてのレイヤーが、同じ 5 つのステップをたどります:ルーティング、和集合、配置、オーバーラップ、学習。設計上の目標は、**配置が決めるのは常に速度だけ** ということです:エキスパートが VRAM から答えても、RAM から答えても、ディスクから答えても、ルーターの判断と重みの精度は同じです。
-```bash
-COLI_MODEL=/nvme/glm52_i4 ./coli chat # RAM 予算、キャッシュ、MTP を自動検出
-COLI_MODEL=/nvme/glm52_i4 ./coli plan # 計画された VRAM/RAM/ディスクの配置を確認
-COLI_MODEL=/nvme/glm52_i4 ./coli doctor # 読み取り専用の準備状況チェック
-COLI_MODEL=/nvme/glm52_i4 ./coli doctor --deep # テンソル/シャード/インデックス/ミラーの厳密な事前チェック
-COLI_MODEL=/nvme/glm52_i4 ./coli tune # このマシンで最速かつ安全な実行プロファイルを計測して保存
-./coli web --model /nvme/glm52_i4 # API + ダッシュボード、ブラウザを開く
-./coli serve --model /nvme/glm52_i4 # API + ダッシュボード、ブラウザなし(ヘッドレス)
-```
+<p align="center">
+ <img src="docs/media/tiers.png" width="880" alt="エキスパート常駐の 3 つのティアとしての VRAM、RAM、NVMe">
+</p>
-#### System One モード: クローズドな質問をする
+- **重みのための JIT。** コンパイラの JIT はプログラム全体をコンパイルすることはなく、実際に実行される部分を観察して、ホットパスをコンパイルします。colibri は重みについて同じ賭けをします。計測されたルーティングの熱量が、どのエキスパートに VRAM、RAM、ディスクのどれを割り当てるかを決めます:レイヤーごとの LRU キャッシュに加えて、あなた自身の会話から学習したピン留めのホットセット(`.coli_usage`、ターンごとに更新)があります。colibri は使えば使うほど速くなります。これが機能するのは、ルーティングに計測可能な構造があるからです([エキスパートアトラス](https://github.com/JustVugg/colibri/issues/175))。
+- **ディスクを二度待たない。** エキスパートの 3 つの行列は 1 回の `pread` で読み込まれます。ローダーのプールが、常駐エキスパートが計算している間に、欠けているエキスパートを読み込みます。複数の位置をまとめたバッチでは、各エキスパートを 1 回だけ読みます。ルーター先読みスレッドが次のレイヤーをプリフェッチできます(GLM-5.2 のルーティングは 1 レイヤー先を 71.6% 予測できます)。`DIRECT=1`(O_DIRECT)は高速な NVMe ドライブでは大きな改善になることが多い一方、ほかのドライブでは効果がないか逆効果になります:自分のドライブで計測してください([tuning.md](docs/tuning.md))。
+- **複数の SSD。** `COLI_MODEL_MIRROR=/second/glm52_i4 ./coli chat --model /fast/glm52_i4` は、2 台目のドライブにあるコピーから読み込みます。独立したコントローラに接続された NVMe ドライブ 2 台で、デコード +37.5% を計測しました。より小さなドライブ上の部分ミラーでも動作します([multidisk.md](docs/multidisk.md))。
+- **ラップトップからラックまで。** 25 GB のラップトップでは、すべてのエキスパートがディスクからストリーミングされ、遅いながらも正しく動きます。大きなホストではすべてのエキスパートが常駐し(`CUDA_EXPERT_GB=auto PIN_GB=all`)、ディスクはデコードから外れます。`COLI_NUMA=1` はマルチソケットのホストで、常駐する重みを複数のメモリコントローラに分散させます。ローカルクラスタモードは、ルーティングされるエキスパートをほかのマシンで実行します([cluster.md](docs/cluster.md))。
+- **忠実なモデル。** すべてのエンジンは、CI で小さなフィクスチャを使い、そのモデルのリファレンス実装と照合されています。GLM-5.2 の MLA アテンションは圧縮された KV 状態(1 トークンあたり 32,768 個ではなく 576 個の浮動小数点数で、57 分の 1)を保持し、それは再起動をまたいで残るため、会話はプロンプトを読み直すことなく再開できます。
+- **元が取れるときだけの投機的デコード。** GLM-5.2 の int8 MTP ヘッドは、効果がある場合、フォワードあたり 2.2-2.8 トークンをドラフトします。Qwen3.8-Flash-Next の MTP ヘッドはオプトインで、同じ出力のまま速度を 12-14% 上げます。ドラフトのコストが節約を上回る場合(DeepSeek V4)はオフのままです([tuning.md](docs/tuning.md#speculation-and-reproducibility))。
-人がモデルに求めることの多くは、段落ではなく選択です: どのキューか、どの判定か、あるフィールドが取り得る
-4 つの値のどれか。System One モードはエンジンに選択肢を渡し、生成する代わりにそれぞれの確率を読み取ります:
-何も生成されず、どの回答もリストの外に出ることはなく、すべての回答に確信度 (confidence) が付くため、
-「モデルに確信がない」ことが閾値を設定できる数値になります。10 のファミリーすべてで、同じサーバー上で
-動作し、リクエストごとのオプトインです: 求めない人にとって、チャットはバイト単位で同一のままです。
+エンジンは、共有ヘッダの上に、モデルファミリーごとに C ファイルを 1 つ置いた構成です(GLM-5.2 なら `c/colibri.c`)。BLAS は使わず、実行時に Python も使いません:Python が動かすのは、セットアップ、ランチャー、変換ツール、API ゲートウェイだけです。
-```bash
-# in the TUI: the same model, told to stop writing
-./coli chat --model /nvme/qwen36_i4_gs64
-> /decide merge | request changes | close
-> 340 lines, 8 files, no tests. CI is green but nothing covers that path.
+<a id="what-it-achieves"></a>
-# from anywhere: one JSON request on the running server
-curl -s http://127.0.0.1:8000/v1/systemone -H 'Content-Type: application/json' -d '{
- "state": "340 lines, 8 files, no tests. CI is green but nothing covers that path.",
- "questions": {"review": {"type": "choice", "instructions": "What should the reviewer do?",
- "criteria": {"merge": null, "request changes": null, "close": null}}}}'
-```
+## ベンチマーク
-`POST /v1/systemone` は TypeSafe の Jev API と同じリクエストとレスポンスを話します: Jev のクライアントは
-base URL を変えるだけで colibri に切り替えられます。1 つの文書への複数の質問は文書を 1 回だけ読みます:
-Qwen3.6 で、同じ CPU マシン上で同じ回答を生成する場合と比べて計測したところ、1 つの文書に対する
-4 つの質問で 5.7 倍でした。モード全体、リクエストとレスポンスの形、そして役に立たない場面については
-[docs/systemone.md](docs/systemone.md) を参照してください。ダッシュボードにも System One ページがあります。
+<p align="center">
+ <img src="docs/media/ladder.png" width="880" alt="ハードウェアクラス別に計測した GLM-5.2 のデコード速度">
+</p>
+同じエンジン、同じ int4 コンテナです:ハードウェアが変えるのはエキスパートの置き場所だけです。GLM-5.2 のデコード速度を[完全な表](docs/benchmarks.md)から抜粋します:
-Windows ではリリースアーカイブに `coli.cmd` が同梱されています。ダブルクリックでクイックスタート、
-または cmd や PowerShell から `coli.cmd chat --model D:\glm52_i4` を実行してください。
-ソースのチェックアウトからは、同じコマンドを `python coli chat --model
-D:\glm52_i4` として実行できます。`.exe` ファイルはエンジンでありランチャーではありません。
-単体で起動するとロードするモデルがないため、すぐに終了します。
-実行時のエンジンは純粋な C です — Python は初回のみの変換ツールとオプションの
-API ゲートウェイでしか使われません。
+- **6x RTX 5090、全エキスパート常駐:** 5.8-6.8 tok/s、選択的な NUMA インターリーブで 9.0-9.2([実験ログ](docs/experiments/glm52-6x5090-2026-07-12.md))。
+- **128 GB、CPU のみ**(Ryzen AI Max+ 395):ウォーム時 1.83 tok/s([#200](https://github.com/JustVugg/colibri/issues/200))。
+- **RTX 5070 Ti 1 枚のラップトップ級マシン:** 1.07 tok/s([#273](https://github.com/JustVugg/colibri/issues/273))。
+- **このプロジェクトが始まった 25 GB のラップトップ:** コールド時 0.05-0.1 tok/s。偽りのない下限です。
-#### 同じコマンドでどのモデルも動く
+品質は仮定ではなく計測されています:int4 コンテナのコストと量子化のアブレーションは [benchmarks.md](docs/benchmarks.md#quality-benchmark) にあります。あなたのマシンを追加するには、[ベンチマークプロトコル](docs/benchmarking.md)に従い、数値を添えて issue を作成してください。
-`coli` はモデルの `config.json` を読み、対応するエンジンバイナリを選び、そのファミリーの
-チャットテンプレートを適用します — そのため **モデルが変わってもコマンドラインは何も変わりません**。
-使いたいエンジンを一度ビルドしたら、あとは `COLI_MODEL` を適切なディレクトリに向けるだけです:
+<a id="install-by-hand"></a>
-```bash
-make -C c glm # GLM-5.2
-make -C c inkling # Inkling
-make -C c kimi_k3 # Kimi K3
+## 手動でのインストール
-COLI_MODEL=/nvme/glm52_i4 ./coli chat # TUI
-COLI_MODEL=/nvme/inkling_i4 ./coli chat
-COLI_MODEL=/nvme/kimi_k3 ./coli chat
+<a id="1-get-colibri"></a>
-./coli web --model /nvme/inkling_i4 # API + ダッシュボード、ブラウザを開く
-./coli web --model /nvme/kimi_k3
-./coli serve --model /nvme/inkling_i4 # API + ダッシュボード、ブラウザなし
-```
+**1. プログラム。** [Releases](https://github.com/JustVugg/colibri/releases) から自分のプラットフォーム用のアーカイブ(Linux x86_64、macOS、Windows。コンパイラは不要で、必要なのはランチャーと API のための [Python 3](https://www.python.org/downloads/) だけ)を取得して展開し、`python3 coli info` を実行します。または、`gcc`(または clang)と OpenMP を使ってソースからビルドします:
-GLM 以外のエンジンでは、`coli chat` がローカルでゲートウェイを起動して TUI をそれに接続します。
-そのため TUI、API、ダッシュボードはすべて同じアーキテクチャ対応のチャットテンプレートを通り、
-テンプレートを自分で指定する必要はありません。
+```bash
+git clone https://github.com/JustVugg/colibri && cd colibri/c
+./setup.sh # checks gcc/OpenMP, builds, self-tests
+make qwen36 VK=1 # one engine, here with Vulkan (CUDA=1 for CUDA)
+```
-モデルごとに異なる点が 2 つあり、どちらも各モデルのページに記載されています:
+<a id="2-get-the-model"></a>
-- **RAM に余裕のないホストでの Inkling** には、int4 の密コンテナと小さなエキスパートキャッシュが
- 必要です: `./coli chat --model /nvme/inkling_i4 --cap 2`
- ([inkling.md](docs/inkling.md) を参照 — デフォルトの `--cap 8` では、常駐セットに加えて
- 約 14 GB のキャッシュが必要です)。
-- **Kimi K3** は MXFP4 エキスパートをオリジナルのチェックポイントからストリーミングするため、
- 変換するものはありません — ただしスナップショットは約 1.6 TB です
- ([kimi_k3.md](docs/kimi_k3.md) を参照)。
+**2. モデル。** [上の表](#which-model-for-my-machine)にあるどのダウンロードでもかまいません:セットアップの ID は Hugging Face のリポジトリに対応しており、各モデルのページにダウンロードと変換のコマンドがあります。GLM-5.2 には、int8 MTP ヘッド付きのグループスケール(gs64)コンテナ [`mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp`](https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp)(429 GB)を、GLM-5.3 には [`Justvugg/GLM-5.3-colibri-int4-g64`](https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64)(419 GB、MTP ヘッドなし)を使ってください。古い行単位 int4 のミラーは使わないでください:品質が約 9 ポイント劣ることが計測されており、[#455](https://github.com/JustVugg/colibri/issues/455) のループする回答の原因でした。`./coli convert --model /nvme/glm52_i4` は、FP8 リリースから同じコンテナをシャードごとに作成するので、756 GB 全体を一度にディスクに置く必要はありません。MTP ヘッドなどの確認方法:[quickstart.md](docs/quickstart.md#3-get-the-model)。
-### 4. さらに詳しく
+<a id="3-run-it"></a>
-| トピック | ドキュメント |
-|---|---|
-| ベンチマーク、コミュニティのデータポイント、品質計測 | [docs/benchmarks.md](docs/benchmarks.md) |
-| 再現可能なベンチマークプロトコルと最低限のレポート | [docs/benchmarking.md](docs/benchmarking.md) |
-| チューニング項目、ポリシー、学習キャッシュ、プリフェッチ | [docs/tuning.md](docs/tuning.md) |
-| Windows 11 ネイティブビルド(+ CUDA DLL) | [docs/windows.md](docs/windows.md) |
-| CUDA バックエンド、VRAM エキスパートティア、完全常駐 | [docs/cuda.md](docs/cuda.md) |
-| Vulkan バックエンド(任意の GPU: RADV 経由の AMD、ROCm がサポートを終了したカードを含む) | [docs/vulkan.md](docs/vulkan.md) |
-| Apple Silicon Metal バックエンド | [docs/metal.md](docs/metal.md) |
-| OpenAI 互換 API、KV スロット、Web ダッシュボード | [docs/api.md](docs/api.md) |
-| System One モード: 生成する代わりに、閉じた選択肢の集合をスコアリング | [docs/systemone.md](docs/systemone.md) |
-| 実験的なレイヤーセグメント埋め込み ABI | [docs/segment-runtime.md](docs/segment-runtime.md) |
-| 実験的なトークナイザ/埋め込み/ヘッドの Edge ABI | [docs/edge-runtime.md](docs/edge-runtime.md) |
-| 文法強制ドラフト(構造化出力) | [docs/grammar-draft.md](docs/grammar-draft.md) |
-| 環境変数一覧 | [docs/ENVIRONMENT.md](docs/ENVIRONMENT.md) |
-
-## DeepSeek V4
-
-**DeepSeek V4 Flash** は公式チェックポイントを変換なしでストリーミングします。ルーティング
-エキスパートは **ネイティブ fp4** のまま、密な重みセットは UE8M0 ブロックスケール付きの
-**fp8-e4m3** のままです。MLA + DSA スパースアテンション、43 レイヤー、256 個のルーティング
-エキスパートと 1 個の共有エキスパート、top-6。x86-64/aarch64 の Linux と Windows/MSYS2(CPU)に
-対応し、オプションの CUDA ティア(Windows ではランタイム DLL、Linux では `CUDA=1` による直接リンク、
-WSL2 で検証済み)は、すべてのステージを CPU 基準に保ちつつステージごとにフォールバックします。
+**3. 実行する。** ソースのチェックアウトなら `c/` から、リリースなら展開したフォルダーから実行します。ランチャーはモデルの `config.json` を読んでエンジンとそのチャットテンプレートを選ぶので、コマンドはどのモデルでも同じです:
```bash
-cd c
-make deepseek-v4
-python ./coli chat --model /path/to/DeepSeek-V4-Flash --ram 32
-# coli run / coli serve / coli web も可
-# Windows CUDA ティア: make cuda-dsv4-dll CUDA_ARCH=portable (RTX 50 では + make cuda-dsv4-dg-dll)
+./coli chat --model /nvme/qwen36 # chat in the terminal
+./coli web --model /nvme/qwen36 # API + dashboard, opens a browser
+./coli serve --model /nvme/qwen36 # API + dashboard, no browser
+./coli plan --model /nvme/qwen36 # where the model will live: VRAM, RAM, disk
+./coli doctor --model /nvme/qwen36 # read-only check: is everything ready?
+./coli tune --model /nvme/qwen36 # measure and save this machine's fastest safe settings
```
-新しく追加された 2 つのオプトイン GPU レバーがあり、コミュニティによる計測値を求めています。
-どちらもデフォルトでオフで、未設定時はバイト単位で同一です。`DSV4_HYBRID=1` は、実行時に計測した
-帯域幅を使って、VRAM ティアのミスを GPU のフィル分岐と CPU の分岐に振り分けます。
-`COLI_CUDA_MOE_DOUBLE=1`(`COLI_CUDA_MOE_BATCH=1` と併用)は、現在のレイヤーを計算している間に
-次のレイヤーのエキスパートセット全体を 2 つ目の VRAM バンクにプリフェッチし、VRAM が足りなければ
-単一バンクにフォールバックします。
-CUDA ティアは Pascal と Turing のカード(GTX 10 / RTX 20 シリーズ)でも動作するようになりました:
-`CUDA_ARCH=portable-pre-ampere NO_TC=1` でビルドしてください。
-
-グリーディデコードで KV スロットは 1 つです。ツール呼び出しは、V4 ネイティブのプロンプトと DSML の
-呼び出しブロックで HTTP ゲートウェイを通じて接続されています。文法はサポートされていません。
-[エンジンごとの API マトリクス](docs/api.md#tool-calling-support) を参照してください。プレフィックス
-チェックポイント(メモリ上 + ディスク上)により、システムプロンプトの初回プリフィル後は、
-エージェントセッションやフォローアップのターンが数秒で始まります。RTX 5080 + NVMe 2 台での計測:
-3324 トークンのプリフィルが 90 秒、8.3k トークンの初回ターンが初回のみ約 4 分、以降の
-セッション/ターンは 6〜9 秒、3k コンテキストでデコード約 1.6 tok/s — 詳細は
-[docs/deepseek-v4.md](docs/deepseek-v4.md) を参照してください。
-
-**RAM を与えてください。** 43 × 256 個のルーティングエキスパートはディスク上で約 137 GiB あり、
-1 トークンがそのうち 301 個に触れるため、エキスパートキャッシュのヒット率が tok/s を決めます —
-`--ram` は最も価値のある単一の設定項目であり、変わるのは速度だけで、出力は決して変わりません。
-
-**投機的ドラフトは存在しますが、オフです。** DSpark のマルコフドラフターと完全な MTP はどちらも
-実装・検証済みです。ドラフトはフォワードパスを節約できますが、トークンを変えることは決してありません。
-受理されたトークンはすべてターゲット自身の argmax だからです。実際のマルチターンチャットで計測したところ、
-受理率は 15 個中 1 個と 24 個中 10 個で、このエンジンのリカレントなアテンション状態について
-棄却されたサフィックスを再生するコストがドラフトによる節約を上回りました — 14 トークンの回答 1 つに
-495 秒かかりました。そのため `V4_DRAFT` と `V4_MTP` はデフォルトで `0` とし、より高速なストレージで
-再挑戦する人のために、コードは計測値とともに残してあります。
-
-CUDA ティア(ビルド、DLL の選択、GPU の対応範囲)、環境変数リファレンス、性能値、
-チェックポイントの検証、生成された小さな独立オラクルについては
-[docs/deepseek-v4.md](docs/deepseek-v4.md) を参照してください。
-
-## 今後の展望
-
-- **推論システムの研究こそがプロダクトです。** 現在の階層は LRU + 学習されたピンセットです。
- 進行中の作業は、モデルフォーマット、圧縮、配置、スケジューリング、I/O、CPU/GPU カーネル、
- 異種混在のオーバーラップ、KV 状態、ルーティングを考慮した投機的デコードにわたります。
- 目的はハードウェア要件と有用トークンあたりのコストを下げることです。すべてはこのプロジェクトの
- やり方で取り込まれます: エンドツーエンドで計測され、レビューされ、オープンに開発されます。
-- **より多くのオープンモデル。** ティアリングアルゴリズムはモデルに依存しません。ルーティング
- エキスパートを持つ MoE であれば、どれも同じ方法でステージングできます。現在 10 の言語モデル
- ファミリーが動作しています(GLM-5.2/5.3、GLM-5.3-Flash、Inkling、Kimi K3、DeepSeek V4 Flash、
- DeepSeek V4.1 Flash、MiMo-V2.6、Qwen3.8-Flash-Next、Qwen3.6、OLMoE)。加えて画像用に Qwen-Image-2.1 が
- あります。さらなるオープンウェイトのファミリー(候補には **MiniMax** も含まれます)は、これらと同じ方法で
- エンジンを獲得します: 誰かがエンドツーエンドで計測したときにです。
+Windows では、リリースアーカイブに `coli.cmd` が同梱されています(`coli.cmd chat --model D:\qwen36`)。ソースのチェックアウトからは `py -3 c\coli` を使ってください。`.exe` ファイルはエンジンであり、ランチャーではありません。すべてのオプションと環境変数:[SETTINGS.md](docs/SETTINGS.md)、[ENVIRONMENT.md](docs/ENVIRONMENT.md)。
-## プロジェクトへの支援
+## 研究、そして協力の方法
+
+colibri は、フロンティアモデルが希少なハードウェアに頼る度合いを減らし、より安く動かせるようにしたいと考えています。そのためには、重みの格納方法と移動方法を変え、何を VRAM、RAM、ストレージに置くかを決め、CPU と GPU の処理をオーバーラップさせ、新しいデコード方法を試すことになります。慣習的だからという理由で残されるものはなく、マイクロベンチマークで速く見えるという理由で採用されるものもありません:決め手となるのは実機でのエンドツーエンドの推論であり、速度と並んで品質も計測されます。未解決の問いは次のとおりです:
-colibrì は、RAM 25 GB の 12 コアのラップトップ上で、1 人のプロジェクトとして始まりました。
-今ではその数値は、実機を持つコミュニティから集まっています。役に立ったと感じたら:
+| 仮説 | これまでのエビデンス | まだ必要な実験 |
+|---|---|---|
+| ルーティング履歴は単純な LRU よりもうまくエキスパートを配置できる | 学習されたピンは繰り返しのワークロードを改善するが、プロンプトに過学習し得る | コーディング、チャット、多言語、長コンテキストのワークロードにわたる、ホールドアウトかつセッション横断の A/B |
+| 複数の SSD は独立した帯域幅をデコード速度に変えられる | 独立した NVMe ドライブ 2 台でデコード +37.5% を計測。より遅い 3 台目のドライブは、重み付きストライピングの後では効果が中立だった([計測結果](docs/multidisk.md#what-has-been-measured)) | ドライブ速度、コントローラ構成、キャッシュ状態を変えて再現する |
+| ハードウェアを考慮したプランナーは、各マシンの最適構成に自動で近づける | RAM/VRAM の予算といくつかのバックエンドは現在すでに検出され、セットアップがビルドを選ぶ | 生成されたプランを、ラップトップ、ワークステーション、NUMA ホスト、マルチ GPU システムにわたる制御されたパラメータスイープと比較する |
+| ロスレスまたは品質上限付きの表現で、重みの移動を意味のあるほど減らせる | 正しさ/品質ゲート付きのフォーマットと量子化のアブレーションが存在する | 圧縮率だけでなく、品質、移動バイト数、レイテンシ、有用トークンあたりのコストを同時に再現する |
+| ルーティングを考慮した投機的デコードは、ほぼ完全常駐に達する前でも元が取れる | MTP と文法ドラフトは動作するが、MTP はエキスパートヒット率約 85% 付近で 32% の損失も計測されている | 受理率、エキスパートヒット率、バッチの和集合、ドラフト深さにわたる損益分岐面をマッピングする |
+| CPU/GPU のオーバーラップは、ボトルネックを移すだけでなく転送と同期を隠蔽できる | CUDA、Metal、Vulkan での改善はあるが、高速な CPU、内蔵 GPU、低い常駐率ではそれが打ち消され得る | PCIe、ユニファイドメモリ、完全常駐のマシンにわたる、ステージごとのプロファイルと 1 変数ずつの A/B、そして Vulkan のティアとチェーンについての最初のディスクリート GPU での数値 |
-- ⭐ リポジトリにスターを付けて共有してください。
-- 🐛 あなたのハードウェアでのベンチマーク数値を添えて issue を作成してください — データポイントは
- 何よりもこのプロジェクトを前進させます。
-- 💬 [Discord コミュニティ](https://discord.gg/RXV83nSZdk) に参加して、実験、ハードウェアでの結果、
- 研究の方向性について議論してください。
-- 💬 開発のスポンサーやハードウェアの寄贈については、GitHub の issue からご連絡ください。
+協力したいですか?いずれかの行を選び、ネガティブな結果も公開してください。ハードウェア、コミット、モデル、正確なコマンド、プロンプト、キャッシュ状態、スループット、最初のトークンまでの時間、エキスパートヒット率、読み込みバイト数、品質チェックを記録し、1 つの変数だけを変えて繰り返し、生のログを添付してください。まずは [CONTRIBUTING.md](CONTRIBUTING.md) と[ベンチマークプロトコル](docs/benchmarking.md)から始め、それから [issue を作成](https://github.com/JustVugg/colibri/issues/new)してください。ここでは、説明のつかない速い数値よりも、よく制御された失敗のほうが価値があります。
+
+## ドキュメント
+
+| トピック | ドキュメント |
+|---|---|
+| ワンステップのセットアップと手動インストール、全プラットフォーム | [quickstart.md](docs/quickstart.md) |
+| AI アシスタントによるセットアップと MCP サーバー | [AI_SETUP.md](docs/AI_SETUP.md)、[MCP_SERVER.md](docs/MCP_SERVER.md) |
+| API:OpenAI、Anthropic、ツール、KV スロット、ダッシュボード | [api.md](docs/api.md) |
+| System One と判定モデル | [systemone.md](docs/systemone.md)、[laya.md](docs/laya.md)、[gliner_decide.md](docs/gliner_decide.md)、[clef.md](docs/clef.md) |
+| Vulkan:エキスパートティア、密チェーン、Resizable BAR のないカード | [vulkan.md](docs/vulkan.md) |
+| CUDA と、Qwen3.6 の CUDA ティア | [cuda.md](docs/cuda.md)、[qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md) |
+| Apple Silicon、Windows | [metal.md](docs/metal.md)、[windows.md](docs/windows.md) |
+| チューニング、学習キャッシュ、プリフェッチ、投機的デコード | [tuning.md](docs/tuning.md) |
+| 複数の SSD、複数のマシン | [multidisk.md](docs/multidisk.md)、[cluster.md](docs/cluster.md) |
+| ベンチマークと計測方法 | [benchmarks.md](docs/benchmarks.md)、[benchmarking.md](docs/benchmarking.md) |
+| すべてのオプションと環境変数 | [SETTINGS.md](docs/SETTINGS.md)、[ENVIRONMENT.md](docs/ENVIRONMENT.md) |
+| 文法強制ドラフトと、実験的な組み込み用 ABI | [grammar-draft.md](docs/grammar-draft.md)、[segment-runtime.md](docs/segment-runtime.md)、[edge-runtime.md](docs/edge-runtime.md) |
## リポジトリ構成
```
-Makefile ルートのビルド/チェックのエントリポイント
+start-here.sh, START-HERE.bat the one-step setup (Linux and macOS, Windows)
+Makefile root build/check entry point
c/
-├── colibri.c GLM-5.2 エンジン (make glm)
-├── inkling.c Inkling エンジン (make inkling)
-├── kimi_k3.c Kimi K3 エンジン (make kimi_k3)
-├── glm53.c GLM-5.3-Flash エンジン (make glm53)
-├── deepseek_v4.c DeepSeek V4 Flash エンジン (make deepseek-v4)
-├── deepseek_v41.c DeepSeek V4.1 Flash エンジン (make deepseek_v41)
-├── mimo.c MiMo-V2.6 Flash と Pro のエンジン (make mimo)
-├── qwen38.c Qwen3.8-Flash-Next エンジン (make qwen38)
-├── qwen36.c Qwen3.6、Qwen3-Coder、Qwen3.8-27B エンジン (make qwen36)
-├── olmoe.c OLMoE エンジン (make olmoe)
-├── qwenimage.c Qwen-Image-2.1 エンジン (make qwenimage)
+├── colibri.c GLM-5.2/5.3 engine (make glm)
+├── glm53.c GLM-5.3-Flash (make glm53)
+├── inkling.c Inkling (make inkling)
+├── kimi_k3.c Kimi K3 (make kimi_k3)
+├── deepseek_v4.c DeepSeek V4 Flash (make deepseek-v4)
+├── deepseek_v41.c DeepSeek V4.1 Flash (make deepseek_v41)
+├── mimo.c MiMo-V2.6 Flash and Pro (make mimo)
+├── qwen38.c Qwen3.8-Flash-Next (make qwen38)
+├── qwen36.c Qwen3.6, Qwen3-Coder, Qwen3.8-27B, Clef (make qwen36)
+├── olmoe.c OLMoE (make olmoe)
+├── qwenimage.c Qwen-Image-2.1 (make qwenimage)
+├── laya.c Laya (make laya)
+├── gliner_decide.c GLiNER2.5-Decide (make gliner_decide)
│
-├── st.h safetensors のインデックスと範囲読み込み
-├── quant.h 正規のコンテナデコーダ
-├── expert_ffn.h MoE エンジン共通のルーテッドエキスパート FFN カーネル(planar int4、レイヤーランナー)
-├── tok.h, json.h トークナイザと JSON パーサ
-├── compat.h Windows/macOS 用シム(POSIX 名を一か所に)
-├── expert_store.h ストリーミングエキスパートキャッシュ
-├── route_trace.h ルーティングのテレメトリと .coli_usage(エンジン非依存)
-├── kv_prefix.h ターンをまたいだ KV プレフィックスの再利用
+├── st.h, quant.h, idot.h safetensors reads, container decoders, integer kernels
+├── expert_ffn.h, expert_store.h routed-expert kernel and streaming expert cache
+├── tok.h, json.h, compat.h tokenizer, JSON, Windows/macOS shims
+├── route_trace.h, kv_prefix.h routing telemetry (.coli_usage), KV prefix reuse
+├── decide_serve.h the decision engines' side of System One
│
-├── backend_cuda.* オプションの CUDA ティア (CUDA=1)
-├── backend_metal.* オプションの Metal ティア (METAL=1)
-├── backend_vulkan.* オプションの Vulkan ティア (VK=1)
+├── backend_cuda.* optional CUDA tier (CUDA=1)
+├── backend_metal.* optional Metal tier (METAL=1)
+├── backend_vulkan.*, vk_tier.c, vk_chain.c optional Vulkan tier and dense chain (VK=1)
│
-├── Makefile ビルドとローカルチェック
-├── coli ユーザー向け CLI
-├── openai_server.py OpenAI 互換 HTTP ゲートウェイ
-├── resource_plan.py `coli plan` と `coli doctor` の背後にある RAM/VRAM プランナー
-├── tools/ オフライン変換、フィクスチャ、ベンチマーク
-├── scripts/ 長時間実行の変換ヘルパー
-└── tests/ 依存関係のない C と Python のテスト
-web/ ブラウザ UI(純粋な OpenAI API クライアント)
-desktop/ Web UI をラップする Tauri v2 デスクトップシェル
-docker/ コンテナイメージ
-docs/ リファレンスドキュメント、実験、メディア
+├── coli user-facing CLI
+├── setup_*.py the one-step setup: hardware, catalog, downloads, flow
+├── mcp_server.py the MCP server (coli mcp)
+├── openai_server.py OpenAI- and Anthropic-compatible HTTP gateway
+├── resource_plan.py RAM/VRAM planner behind coli plan and coli doctor
+├── tools/ conversion, fixtures and benchmarks
+└── tests/ dependency-free C and Python tests
+web/ the dashboard (a pure API client)
+desktop/ Tauri desktop shell around the dashboard
+docker/ container images
+docs/ reference docs, experiments, media
+site/ the website
```
-**モデルファミリーごとに `.c` を 1 つ、共有の単一ヘッダの上に。** エンジンは自身のアーキテクチャだけを
-持ち、それ以外は持ちません。2 つのエンジンが共に必要とするもの — safetensors リーダー、コンテナ
-デコーダ、トークナイザ、エキスパートキャッシュ — は両者がインクルードするヘッダに置かれるため、
-修正は一度にすべてのエンジンに届きます。このルールは飾りではありません。ここで繰り返し発生する
-不具合は、ある仕組みが 1 つのエンジンにだけ入り、兄弟エンジンに届かなかったケースなのです。
+**モデルファミリーごとに `.c` を 1 つ、共有の単一ヘッダの上に。** エンジンが持つのは自身のアーキテクチャだけで、それ以外は持ちません。2 つのエンジンが共に必要とするものは、両者がインクルードするヘッダに置かれるため、修正は一度にすべてのエンジンに届きます。リポジトリのルートからは、`make`、`make check`、`make clean` がエンジンの Makefile に委譲されます。
+
+## プロジェクトへの支援
+
+colibri は、RAM 25 GB の 12 コアのラップトップ上で、1 人のプロジェクトとして始まりました。今ではその数値は、実機を持つコミュニティから集まっています。役に立ったと感じたら:
-リポジトリのルートからは、`make`、`make check`、`make clean` がエンジンの Makefile に委譲されます。
+- リポジトリにスターを付けて、共有してください。
+- あなたのハードウェアでのベンチマーク数値を添えて issue を作成してください:データポイントは何よりもこのプロジェクトを前進させます。
+- [Discord コミュニティ](https://discord.gg/RXV83nSZdk)に参加して、実験、ハードウェアでの結果、研究の方向性について議論してください。
+- 開発のスポンサーやハードウェアの寄贈については、GitHub の issue からご連絡ください。
## なぜ「colibrì」なのか
-ハチドリ(イタリア語で colibrì)は体重わずか数グラムで、空中にとどまり、1 日に千もの花を訪れます。
-このエンジンは、7,440 億パラメータの巨人をハチドリの食事量で生かし続けます: RAM 25 GB、
-CPU 12 コア、そしてディスクへのたっぷりの忍耐です。
+ハチドリは体重わずか数グラムで、空中の一点にとどまり、1 日に千もの花を訪れます。このエンジンは、744B パラメータの巨人をハチドリの食事量で生かし続けます:RAM 25 GB、CPU 12 コア、そしてディスクへのたっぷりの忍耐です。
## 謝辞
-colibrì はエンジンにすぎず、それが動かす知性は贈り物です。フロンティア級の重みをオープンに
-公開しているチーム — **Z.ai**(GLM)、**Moonshot AI**(Kimi)、**Alibaba Qwen**、**MiniMax**、
-**Allen AI**(OLMoE)— そして、ベンチマークを取り、バイセクトし、アトラスの実行を再現し、
-パッチを送ってくれたすべてのコントリビューターに感謝します。
-このプロジェクトは、オープンウェイトが何を可能にするかの証明です。
-
-このプロジェクトのエキスパート配置、圧縮、ルーティングの実験は、以下のオープンな研究と
-システムのアイデアやエビデンスにも基づいています:
-
-- 出力を考慮した、ドメイン固有のエキスパート重要度については
- [REAP](https://github.com/CerebrasResearch/reap) と
- [EASY-EP](https://github.com/RUCAIBox/EASYEP)。
-- 類似度に基づくエキスパートの再ルーティングについては [SERE](https://github.com/JL-Cheng/SERE)、
- キャッシュ局所性を考慮したルーターのファインチューニングについては
- [ReMoE](https://github.com/BUAA-OSCAR/ReMoE)。
-- ルーティングに導かれたエキスパートのマージと圧縮については
- [MC-SMoE](https://github.com/UNITES-Lab/MC-SMoE)。
-- 共有エキスパート基底と低ランクのエキスパート差分については
- [MoBE](https://github.com/inclusionAI/MoBE) と
- [D²-MoE](https://github.com/lliai/D2MoE)。
-- CPU/GPU ハイブリッドのエキスパートスケジューリングについては
- [HybriMoE](https://github.com/PKU-SEC-Lab/HybriMoE)、エキスパート通信と計算のオーバーラップについては
- [ScMoE](https://arxiv.org/abs/2404.05019)、分散オンデマンドのエキスパートロードについては
- [OD-MoE](https://arxiv.org/abs/2512.03927)。
-- 比較を再現可能にしているオープンな推論システムとエキスパートオフロードの取り組みについては
- [vLLM](https://github.com/vllm-project/vllm)、
- [llama.cpp](https://github.com/ggml-org/llama.cpp)、
- [kTransformers](https://github.com/kvcache-ai/ktransformers)。
-
-エンジンはアイデアだけでなく、具体的なエンジニアリングの成果の上にも成り立っています。以下はいずれも
-現在ツリー内で使われているか、再実装されています:
-
-- [safetensors](https://github.com/huggingface/safetensors) — すべてのエンジンが読むコンテナ
- (`c/st.h`)。fp8 と I64 の dtype を含みます。
-- [tiktoken](https://github.com/openai/tiktoken) — `c/tok.h` はその `byte_pair_encode` を
- 正確に再実装しており、連結した結果の語彙 ID が最も小さい隣接ペアをマージするため、
- tiktoken 由来の語彙にはマージリストが不要です。
-- [llama.cpp](https://github.com/ggml-org/llama.cpp) — `c/grammar.h` の GBNF 文法サブセットは
- その構文とスタック集合による PDA に従っており、Metal の経路はその
- `newBufferWithBytesNoCopy` による常駐テクニックを借用しています。
-- [vLLM](https://github.com/vllm-project/vllm) — エンジンが位置ごとに一致させている出力
- セマンティクスのリファレンス(例: 最終ノルムが LM ヘッドに対してどこに入るか)。
-- [transformers](https://github.com/huggingface/transformers) — オラクル:
- CI はランダム初期化モデルをこれに対してトークン単位で再現します。
-- [DietGPU](https://github.com/facebookresearch/dietgpu) — 実験的な圧縮エキスパートティア
- (`COLI_ANS`)の背後にある GPU ANS コーデック。
-- [rocWMMA](https://github.com/ROCm/rocWMMA) — HIP バックエンドは CUDA の
- `nvcuda::wmma` の fragment/mma_sync API をこれにマッピングしており(`c/backend_gpu_compat.h`)、
- それによって 1 つの .cu ソースを両ベンダー向けにコンパイルできます。
+colibri はエンジンにすぎず、それが動かす知性は贈り物です。重みをオープンに公開しているチーム、**Z.ai**(GLM)、**Moonshot AI**(Kimi)、**Alibaba Qwen**、**DeepSeek**、**Xiaomi**(MiMo)、**Thinking Machines**(Inkling)、**Allen AI**(OLMoE)、**Convai Innovations**(Laya)、**fastino**(GLiNER2.5-Decide)、**Cloudflare**(Clef)に、変換済みコンテナを公開してくれる人々に、そしてベンチマークを取り、バイセクトし、アトラスの実行を再現し、パッチを送ってくれたすべてのコントリビューターに感謝します。このリポジトリに含まれるサードパーティのコードとそのライセンス:[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
## ライセンス
-Apache 2.0、Copyright 2026 Vincenzo Fornaro。[LICENSE](LICENSE) と [NOTICE](NOTICE) を参照してください。GLM-5.2 の重みは Z.ai により MIT ライセンスで公開されています。
+Apache 2.0、Copyright 2026 Vincenzo Fornaro。[LICENSE](LICENSE) と [NOTICE](NOTICE) を参照してください。各モデルには、その作者が付けたライセンスがそのまま適用されます(GLM-5.2 の重みは Z.ai により MIT ライセンスで公開されています。Qwen-Image-2.1 は非商用利用に限られます)。
diff --git a/README.md b/README.md
index 02230e22..18bd6efa 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
<p align="center">
- <img src="assets/colibri-logo.svg" width="560" alt="colibrì — tiny engine, immense model">
+ <img src="assets/colibri-logo.svg" width="560" alt="colibrì: tiny engine, immense model">
</p>
<p align="center">
@@ -13,800 +13,667 @@
English · <a href="README.zh-CN.md">简体中文</a> · <a href="README.zh-TW.md">繁體中文</a> · <a href="README.it.md">Italiano</a> · <a href="README.ja.md">日本語</a>
</p>
-**Tiny engine, immense model.** Run **frontier MoE models — 744B to 2.8T
-parameters** — on consumer and heterogeneous hardware, in pure C with zero
-engine dependencies, by treating storage, RAM, and VRAM as a single inference
-hierarchy (AI memory multitiering).
-
-Ten language-model families run today. We count engines, not checkpoints: one C
-file each, the same `coli chat` / `coli serve` / `coli web` front end, and some
-engines run more than one model. **GLM-5.2/5.3** (744B), **GLM-5.3-Flash** (321B,
-with vision), **Inkling** (975B), **Kimi K3** (2.8T), **DeepSeek V4 Flash** (284B),
-**DeepSeek V4.1 Flash** (552B, with vision), **MiMo-V2.6 Flash** (309B, with
-vision; the same engine runs **MiMo-V2.6 Pro**, 1.02T), **Qwen3.8-Flash-Next**
-(125B + 51B n-gram), **Qwen3.6** (35B-A3B; the same engine runs
-**Qwen3-Coder-30B-A3B** and the dense **Qwen3.8-27B**, with vision) and
-**OLMoE** (7B).
-Images too: an eleventh engine runs **Qwen-Image-2.1**, which generates pictures
-from text, shown inline in the terminal by `coli chat` and served at
-`POST /v1/images/generations` ([qwen-image.md](docs/qwen-image.md)).
-[Full roster ↓](#other-supported-models)
-
-> **Colibrì is an inference engine you can run today, and an open research
-> platform.** Its primary goal is to pursue inference-side performance across
-> the entire software/hardware boundary — model formats, memory hierarchy,
-> storage I/O, placement, scheduling, kernels, speculation, and CPU/GPU
-> overlap — so large models depend less on scarce hardware and cost less to run.
-
-Colibrì treats VRAM, RAM, and storage as a single multitier hierarchy, and it is
-deliberately a place to test aggressive systems ideas — so there is **no SLA on
-speed, and a hard guarantee on semantics**: experiments must earn their place
-through reproducible end-to-end measurements, and the default policy **never
-silently changes model precision or router semantics**. Insufficient fast memory
-may reduce speed; it must not quietly redefine the model.
+**Tiny engine, immense model.** colibri runs very large open models on the
+machine you already have. A mixture-of-experts model of hundreds of billions of
+parameters uses only a small part of itself for each token, so colibri keeps
+that part in RAM and reads the rest, the experts, from the disk when the model
+asks for them. Pure C, one file per model family, no GPU required.
+
+Thirteen engines run today. Ten are for language models: **GLM-5.2/5.3**,
+**GLM-5.3-Flash**, **Inkling**, **Kimi K3**, **DeepSeek V4 Flash**,
+**DeepSeek V4.1 Flash**, **MiMo-V2.6 Flash** (and Pro), **Qwen3.8-Flash-Next**,
+**Qwen3.6** (which also runs Qwen3-Coder and the dense Qwen3.8-27B) and
+**OLMoE**. One draws pictures: **Qwen-Image-2.1**. Two answer decisions:
+**Laya** and **GLiNER2.5-Decide**, with a third decision model, **Clef**, on the
+Qwen3.6 engine. [Which one for my machine](#which-model-for-my-machine)
```
$ ./coli chat
- 🐦 colibri v1.12.1 — GLM-5.2 · 744B MoE · int4 · streaming CPU
+ colibri v1.12.1 · GLM-5.2 · 744B MoE · int4 · streaming CPU
✓ ready in 32s · resident 9.9 GB
› ciao!
- ◆ Ciao! 😊 Come posso aiutarti oggi?
+ ◆ Ciao! Come posso aiutarti oggi?
```
-## See it running
-
-<p align="center">
- <img src="docs/media/colibri-dashboard.png" width="900" alt="colibrì web dashboard — live metrics, hardware panel, expert tiers">
-</p>
-<p align="center"><em>The web dashboard (<code>./coli web</code>), redesigned in 1.12.0: a workspace with a dock for the chat,
-System One mode, the Brain page and Profiling, in a light or a dark theme. Here Qwen3.6 answering on a CPU box,
-experts streamed from disk.</em></p>
-
-<p align="center">
- <img src="docs/media/colibri-brio.png" width="900" alt="the System One page: a document read once, a probability for every allowed answer, and an entropy">
-</p>
-<p align="center"><em><strong>System One mode</strong>: the same model, told to stop writing. Give it a document and the only answers
-it may pick; it reads the probability of each one, generates nothing, and reports an entropy that says when it is
-not sure. Here: <strong>request changes at 99.9%</strong>, entropy 0.005, 4 tokens read, 0 generated.</em></p>
-
-<p align="center">
- <img src="docs/media/colibri-brain.png" width="900" alt="the Brain page: the measured expert atlas of GLM-5.2 drawn as a cortex, ten regions to enter">
-</p>
-<p align="center"><em>The <strong>Brain</strong> page, <strong>Explore</strong>: the <a href="https://github.com/JustVugg/colibri/issues/175">measured expert atlas</a> of GLM-5.2
-drawn as a cortex. 13,260 characterised experts in ten regions (Python, SQL, mathematics, poetry, law, Chinese…);
-position is measured routing affinity, not a learned embedding. Choose a region to enter it. <strong>Live routing</strong> switches
-to the model actually running: one cell per expert, colour is the storage tier, and every expert routed in a turn flashes white.</em></p>
-
-<p align="center">
- <img src="docs/media/colibri-brain-region.png" width="900" alt="inside the Python region: 1,142 experts, one of them selected with its measured affinities">
-</p>
-<p align="center"><em>Inside the <strong>Python</strong> region: 1,142 experts as a constellation, each labelled by layer and index. The panel shows
-one of them, layer 17 expert 178: a generalist with entropy 3.13, whose measured affinity is 20.2% Python, 14.6% JSON,
-14.2% conversation, 13.3% SQL.</em></p>
-
-<p align="center">
- <img src="docs/media/colibri-profiling.png" width="900" alt="the Profiling page: where the engine spends each turn">
-</p>
-<p align="center"><em>The <strong>Profiling</strong> page: where the engine spends each turn, by phase, with the last 30 turns as a trend.
-Here Qwen3.6 on a CPU box: 19.0 s of wall time for 36 prompt and 55 generated tokens, 2.9 tok/s, 11.4 s of disk
-service overlapped with compute.</em></p>
-
-## The research mission
-
-With Colibrì, private frontier model access is not limited by availability of hyperscaler-class hardware.
-
-With its multitiering features Colibrì **removes proprietary hardware dependencies aggressively
-optimizing functional inference engine pipelines**.
-
-Our operational mission includes changing how weights are represented and moved, deciding what
-lives in VRAM, RAM, or storage, overlapping heterogeneous compute, reducing
-launch and synchronization overhead, exploiting sparsity and reuse, and testing
-new decoding algorithms. Nothing is protected merely because it is conventional;
-nothing is adopted merely because a microbenchmark looks fast. The deciding
-result is end-to-end inference on real machines, with correctness and quality
-measured alongside throughput, latency, memory, and cost.
-
-The practical consequence is **accessibility**: run a 744B-parameter model on
-hardware you already own, watch every expert fire in real time, and change the
-code that does it. Not renting intelligence behind an API — *holding* it:
-probing it, measuring it, improving it. The engine is deliberately small enough
-that the next useful optimization can come from anyone willing to measure it.
-
-## Core techniques and measured findings
-
-- **One hierarchy, not limited by tier capacity.** VRAM, RAM, and NVMe are placement
- tiers for the same weights; limited fast memory changes speed, not model semantics.
-- **A JIT for weights.** Measured routing heat drives a per-layer LRU, a learned
- pinned hot-store, and one-layer-ahead prefetch instead of loading every expert.
- It wins on repeatable workloads; history can overfit, and lookahead can lose on
- some hosts, so both remain measurable policies rather than promises.
-- **I/O is part of the engine.** Batched expert unions, overlapped reads and
- compute, `O_DIRECT`, and weighted dual-SSD striping attack the streaming path
- rather than pretending storage latency is free. `O_DIRECT` is drive-dependent,
- and dual-SSD still needs broader end-to-end community A/Bs.
-- **Heterogeneous execution.** CPU, CUDA, Metal, NUMA memory, and partial or full
- expert residency share one runtime and can be combined according to the machine;
- the profitable combination depends on compute, bandwidth, residency, and workload.
-- **Compressed state without a different model.** Token-exact forward validation,
- 57× smaller MLA KV state, persistent warm conversations, and faithful DSA keep
- optimization tied to correctness. These are memory, latency, and correctness
- properties — not a blanket throughput claim.
-- **Speculation that must earn its keep.** Native MTP and grammar-forced drafts
- are measured end to end and can be disabled when acceptance does not repay verification.
-
-## Open hypotheses, experiments, and how to help
-
-Colibrì treats an optimization as a hypothesis until a controlled end-to-end A/B
-shows otherwise. These are the main questions now:
-
-| hypothesis | evidence so far | experiment still needed |
-|---|---|---|
-| Routing history can place experts better than plain LRU | learned pins improve repeated workloads, but can overfit a prompt | held-out, cross-session A/Bs across coding, chat, multilingual, and long-context workloads |
-| Multiple SSDs can turn independent bandwidth into decode speed | two independent NVMe drives measured +37.5% decode; a slower third drive was neutral after weighted striping ([measurements](docs/multidisk.md#what-has-been-measured)) | reproduce across drive speeds, controller layouts, and cache states |
-| A hardware-aware planner can approach each machine's best configuration automatically | RAM/VRAM budgets and several backends are detected today | compare the generated plan with a controlled parameter sweep across laptops, workstations, NUMA hosts, and multi-GPU systems |
-| Lossless or quality-bounded representations can reduce weight movement enough to matter | format and quantization ablations exist, with correctness/quality gates | reproduce quality, bytes moved, latency, and cost per useful token together — not compression ratio alone |
-| Routing-aware speculation can pay before near-full residency | MTP and grammar drafts work, but MTP has also measured a 32% loss around 85% expert hit | map the break-even surface across acceptance, expert hit rate, batch union, and draft depth |
-| CPU/GPU overlap can hide transfer and synchronization rather than merely move the bottleneck | CUDA and Metal wins exist, but fast CPUs and low residency can erase them | per-stage profiles and one-variable A/Bs across PCIe, unified-memory, and full-resident machines |
-
-Want to help? Pick one row and publish the negative results too. Record the
-hardware, commit, model/container, exact command, prompt, cache state, throughput,
-TTFT, expert hit rate, bytes read, and quality check; change one variable, repeat
-the run, and attach raw logs. Start with
-[CONTRIBUTING.md](CONTRIBUTING.md), compare against
-[the benchmark protocol](docs/benchmarking.md), then
-[open an experiment issue](https://github.com/JustVugg/colibri/issues/new).
-A well-controlled failure is more valuable here than an unexplained fast number.
-
-## The idea
-
-A 744B Mixture-of-Experts model activates only ~40B parameters per token — and
-only ~11 GB of those change from token to token (the routed experts):
+<a id="get-started"></a>
+<a id="the-one-step-way"></a>
-<p align="center">
- <img src="docs/media/sparse.png" width="880" alt="only ~5.4% of parameters are active per token">
-</p>
-
-So the model doesn't need to *fit* in fast memory — it needs to be **placed**:
-
-- the **dense part** (attention, shared experts, embeddings — ~17B params) stays
- **resident in RAM at int4** (~9.9 GB);
-- the **19,456 routed experts** (75 MoE layers × 256 + the MTP head, ~19 MB each
- at int4) live **on disk** (~370 GB) and are **streamed on demand**, with a
- per-layer LRU cache, a learned pinned hot-store, and an optional VRAM tier.
+## Get started in one step
-Think of the core algorithm as **a JIT, but for weights**. A compiler JIT never
-compiles the whole program — it watches what actually runs and compiles the hot
-paths, just in time. colibrì makes the same bet about a 744B parameter space:
-parameters are not resident state to be held, they are **data to be staged**
-across a heterogeneous storage hierarchy (VRAM / RAM / NVMe), exactly when the
-router proves they are needed. Measured routing heat decides which experts earn
-which tier, the router runs a layer ahead so prefetch hides the staging latency,
-and — like a JIT — the engine learns your workload: the more you run, the hotter
-the right experts get. It works because routing has measurable structure (see
-the [expert atlas](https://github.com/JustVugg/colibri/issues/175)) — and
-structure is cacheable.
+You need a computer with **8 GB of RAM** at the very least (16 GB or more is
+better), **22 GB free on the disk** for the smallest model, and an internet
+connection. A graphics card is optional.
-The engine is a single C file (`c/colibri.c`) plus small headers. No BLAS, no
-Python at runtime, no GPU required.
+**Windows**
-### Local cluster mode
+1. On this page click **Code**, then **Download ZIP**, and unzip it.
+2. Double-click **`START-HERE.bat`** in the unzipped folder. If Python is
+ missing, it offers to install it for you.
-The coordinator keeps token generation, routing, and KV state local while
-disk-backed expert workers execute routed FFNs on other Macs. A layer's routed
-batch-union is sent as one persistent TCP request, so a token does not incur one
-round trip per expert.
-
-Start the optional registration service:
+**Linux** (Ubuntu and Debian; other distributions have the same packages under
+their own names)
```bash
-./coli cluster coordinator --host 0.0.0.0 --port 8765
+sudo apt install git python3 build-essential
+git clone https://github.com/JustVugg/colibri
+cd colibri
+./start-here.sh
```
-On each worker, with the same converted model available locally:
+**macOS** (with [Homebrew](https://brew.sh))
```bash
-./coli cluster worker --model /nvme/glm52_i4 --port 9100 \
- --coordinator http://COORDINATOR:8765 --advertise-host WORKER_IP
+xcode-select --install
+brew install libomp git python
+git clone https://github.com/JustVugg/colibri
+cd colibri
+./start-here.sh
```
-Run the coordinator with discovery, or provide `--cluster-workers
-HOST:PORT,...` for a static setup:
+You answer one question, which model, and Enter takes the recommendation. Then
+the setup:
+
+1. **looks at your machine**: RAM, free disk, CPU and GPUs;
+2. **recommends a model that fits**: the part of the model that always stays in
+ RAM, plus a minimum cache of experts, must fit in your RAM, and the download
+ on your disk;
+3. **gets the engine**: it builds it for your machine when a compiler is there,
+ otherwise it downloads the prebuilt one, which runs on the CPU. It builds
+ for your GPU when that pays: CUDA for an NVIDIA card on Linux when the CUDA toolkit is installed,
+ otherwise Vulkan. On a discrete GPU it always does; on an integrated GPU,
+ which shares the CPU's RAM, only for the models measured faster there
+ (Qwen3.6, Qwen3-Coder and Qwen3.8-Flash-Next). If a package is missing it
+ prints the exact command to install it and carries on with the CPU; run the
+ setup again afterwards and it rebuilds for the GPU;
+4. **downloads the model** with progress and resume: stop it whenever you like,
+ run it again and it continues where it stopped;
+5. **starts colibri and opens the dashboard** in your browser, and prints the
+ addresses other apps can use:
-```bash
-./coli serve --model /nvme/glm52_i4 \
- --cluster-coordinator http://127.0.0.1:8765
+```
+Starting colibri
+ Browser: http://127.0.0.1:8000/
+ OpenAI base URL: http://127.0.0.1:8000/v1
+ Anthropic base URL: http://127.0.0.1:8000
+ stop: press Ctrl+C here (or close this window)
```
-The transport is disabled unless workers are configured, so the existing
-single-machine path remains unchanged. Dense-layer sharding and browser/WebGPU
-workers are separate follow-up seams.
+**Next time**, run `START-HERE.bat` or `./start-here.sh` again: colibri starts
+straight away, with no download and no build. `c/coli status` shows what is
+installed and whether it runs, `c/coli stop` stops it (`c\coli.cmd status` and
+`c\coli.cmd stop` on Windows).
-## How it works
+Options go after `./start-here.sh` or `START-HERE.bat`:
-### The per-token path
+| Option | What it does |
+|---|---|
+| `--list` | every model against this machine, and why one does not fit |
+| `--model ID` | install that model (the ids are in [the tables below](#which-model-for-my-machine)) |
+| `--yes` | no questions: take the recommendation |
+| `--dir DIR` | put the models on another disk (default `~/colibri-models`) |
+| `--backend vulkan`, `cuda` or `cpu` | choose the engine build yourself; `--no-gpu` is `--backend cpu` |
+| `--model-dir DIR` | use a model you already downloaded |
+| `--reconfigure` | choose another model |
-<p align="center">
- <img src="docs/media/token-path.png" width="880" alt="route → union → place → overlap → learn">
-</p>
+What each step does, in detail: [docs/quickstart.md](docs/quickstart.md#the-one-step-way).
-Every layer of every token walks the same five steps. The design goal is that
-**placement only ever decides speed** — the router's decisions and the weights'
-precision are the same whether an expert answered from VRAM or from disk.
+### If something goes wrong
-### One memory hierarchy instead of one memory requirement
+| What you see | What to do |
+|---|---|
+| it stopped during the download | run the same command again: it resumes from the bytes already on disk |
+| `to use the GPU through ..., first run: <command>` | run that command, then the setup again: it rebuilds for the GPU and does not download again |
+| `the ... build failed` while building with CUDA, for example `Unsupported gpu architecture` when the installed CUDA toolkit no longer supports the card | `./start-here.sh --backend vulkan` uses the card through Vulkan; `--no-gpu` stays on the CPU |
+| `needs N GB free for the download` | `--dir` with a folder on a bigger disk |
+| on WSL, the model folder is under `/mnt/c` | keep it on the Linux disk (the default, `~/colibri-models`): `/mnt/c` is many times slower |
+| anything else | `c/coli logs -n 50` shows the server log and `c/coli logs --install` the setup's; open an [issue](https://github.com/JustVugg/colibri/issues) with the last lines the setup printed |
-<p align="center">
- <img src="docs/media/tiers.png" width="880" alt="VRAM / RAM / NVMe three-tier expert residency">
-</p>
+### Let your AI assistant set it up
-<a id="dual-ssd-two-copies-of-the-model-twice-the-read-bandwidth"></a>
+If you use an AI coding assistant, it can do all of this for you. Ask it:
-### Multiple SSDs: stream model copies from more than one drive
+> Set up colibri on this machine following docs/AI_SETUP.md from https://github.com/JustVugg/colibri
-When decode is disk-bound, a **second SSD** can help: put a copy of the model on
-it and let the engine read from both drives. For GLM-5.2, from `c/` in a source
-checkout (or from an unpacked release):
+[docs/AI_SETUP.md](docs/AI_SETUP.md) gives the assistant every step as a
+command with a machine-readable result, and tells it to ask you before it
+downloads a model or installs a system package. Assistants that speak the Model
+Context Protocol can use colibri's MCP server instead: `coli mcp` offers tools
+to detect the hardware, recommend a model, install, start, stop and check it
+([docs/MCP_SERVER.md](docs/MCP_SERVER.md)).
-```bash
-COLI_MODEL_MIRROR=/second/glm52_i4 python3 ./coli chat --model /fast/glm52_i4
-```
+### Or by hand
-The engine measures the drives at startup to weight the read split. Buffered
-reads use deterministic expert routing; eligible direct reads can stripe one
-expert across replicas. Independent drives provide bandwidth headroom, not a
-guaranteed token-rate multiplier: shared controllers, cache hits, and compute
-can limit the gain. See the [multi-disk guide](docs/multidisk.md) for Bash and
-PowerShell examples, measured gains and limits, and a single-drive comparison.
-Details worth knowing:
-
-- the mirror is **validated at startup** (per-file size + safetensors header must be byte-identical to the primary); divergent or missing files stay on the primary, so a **partial mirror is fine** — a smaller second SSD can serve the shards it holds;
-- the mirror is **never written**: `.coli_usage`, `.coli_kv` and all sidecars stay on the primary;
-- a read error on the mirror falls back to the primary (one warning, no crash), so unplugging the second drive mid-run degrades instead of killing the server;
-- routing never changes tokens — both copies are byte-identical; enable `PROF=1` for the `MIRROR:` profile counters showing GB served per drive.
-
-The same engine spans the whole range: on a 25 GB laptop everything streams from
-disk (slow but correct); on a large host the entire expert set becomes resident
-(`CUDA_EXPERT_GB=auto PIN_GB=all`) and disk drops out of the decode path
-entirely. Between the tiers sits a **learning cache**: the engine records which
-experts *your* workload routes to (`.coli_usage`, updated every turn) and pins
-the hottest ones automatically — colibrì literally gets faster the more you use
-it. On multi-socket hosts, `COLI_NUMA=1` interleaves the resident weights across
-memory controllers ([#82](https://github.com/JustVugg/colibri/issues/82)).
-
-For a second drive that cannot hold the whole model, Colibri can rank a partial
-mirror from the expert history it already learns. Run a few representative
-prompts first so `.coli_usage` reflects the workload, then plan, stage, and
-verify the mirror:
+To choose each step yourself (a prebuilt release or a source build, any model
+from the tables below, then `coli chat`, `coli web` or `coli serve`), see
+[Install by hand](#install-by-hand), or the
+[Quick Start guide](docs/quickstart.md) for every platform step by step.
-```bash
-./c/coli mirror plan --model /fast/glm52_i4 --mirror /second/glm52_i4 \
- --budget-gib 200 --reserve-gib 20
-./c/coli mirror stage --model /fast/glm52_i4 --mirror /second/glm52_i4 \
- --budget-gib 200 --reserve-gib 20
-./c/coli mirror verify --model /fast/glm52_i4 --mirror /second/glm52_i4
-```
+## What colibri is, and why
-The planner reads safetensors headers directly, follows split-model directories
-from `COLI_MODEL_DIRS`, and prioritizes shards that can serve the hottest routed
-experts. Staging never changes the primary model: it copies through temporary
-files, preserves the requested free-space reserve, verifies every shard with
-SHA-256, never deletes an existing mirror shard, and atomically publishes a
-receipt only after the selected mirror is ready.
-
-### Never wait for the disk twice
-
-Misses are expensive, so the engine spends most of its cleverness avoiding and
-overlapping them: each expert's three matrices are stored adjacent and read in
-one `pread`; a bounded async I/O pool (`PIPE=1`, default) loads missing experts
-while resident ones compute; batched positions read each unique expert once
-(**batch-union**); and a router-lookahead thread (`PILOT=1`) prefetches the next
-layer's experts — routing is measurably **71.6% predictable one layer ahead**.
-On GPUs, the resident pipeline (`COLI_CUDA_PIPE=2`) keeps the residual stream
-on-device across layers so the CPU expert loop runs uninterrupted; on Apple
-Silicon an experimental [Metal backend](docs/metal.md) does the batched expert
-math on the unified-memory GPU; and a [Vulkan backend](docs/vulkan.md) brings
-the expert tier, dense projections, and the MLA attention core to any GPU with
-a Vulkan 1.2 driver — including AMD cards via Mesa/RADV (the only backend for
-cards the vendor stacks no longer support, like the RX 580, and competitive
-with ROCm on RDNA4 — see [the benchmarking notes](docs/vulkan.md)).
-Every other engine now opens the same backend for its resident matrices with
-`COLI_VULKAN=1` in a `VK=1` build; it is checked against the CPU's tokens in CI,
-but on the first real GPU they have been measured on, an integrated Radeon 780M,
-it is slower than the CPU today ([the other engines](docs/vulkan.md#the-other-engines)).
-
-> **On real NVMe, measure `DIRECT=1`.** O_DIRECT bypasses the page cache and is
-> often a large win on drives with DRAM cache and bandwidth headroom (+34%
-> decode measured with `PIPE=1` on a Blackwell/Windows box; 4.25→9.69 GB/s in
-> iobench on a GB10) — but it is drive-dependent: QLC/DRAM-less or virtualised
-> disks can be neutral to negative. Try it first; keep what your hardware
-> rewards.
-
-### Faithful model, compressed state
-
-The forward pass is validated against a `transformers` oracle (teacher-forcing
-typically 30-32/32; two tiny-oracle positions are floating-point near-ties and
-toolchain-dependent). MLA attention stores a compressed KV state — 576
-floats/token instead of 32,768 (**57× smaller**) — and persists it across
-restarts (`.coli_kv`): conversations reopen warm with zero re-prefill,
-byte-identical to an uninterrupted session. DSA sparse attention (GLM-5.2's
-lightning indexer) is implemented faithfully and validated by forcing full-key
-selection to reproduce dense attention exactly.
-
-### Speculative decoding, honestly
-
-GLM-5.2's native MTP head drafts tokens that the main model verifies in one
-batched forward — 2.2–2.8 tokens/forward when it pays. Two hard-won rules ship
-as defaults: the MTP head must be **int8** (int4 heads collapse to 0–4%
-acceptance, [#8](https://github.com/JustVugg/colibri/issues/8)), and draft and
-verify must compute **the same function** — `SPEC_PIN=1` pins both to one
-kernel family ([#163](https://github.com/JustVugg/colibri/issues/163) is the
-full forensic story). Grammar-forced drafts
-([`GRAMMAR=file.gbnf`](docs/grammar-draft.md)) add ~free acceptance on
-constrained JSON output. Whether speculation is a net win depends on your
-cache temperature — measure, and use `DRAFT=0` when it doesn't pay.
-
-Verify batches can also opt into an **exact attention core** with
-`COLI_EXACT_VERIFY=1` ([#689](https://github.com/JustVugg/colibri/issues/689)):
-the CPU MLA-absorb score and context dots accumulate integer products and round
-once, so a near-tie in a verify row resolves the same way on every host, at
-roughly 0.6x tok/s on a tiny oracle (the dot itself is ~5–7x the float loop).
-Two limits to know: with a quantised KV cache (`tq1`, TQ or int8 KV) the
-context dot keeps the float path, so exactness there is not provided; and a
-real near-tie flip has only been argued, not yet caught on GLM-5.2 at n=64.
-
-## What it achieves
+A mixture-of-experts model is huge on disk and small per token. GLM-5.2 has
+744B parameters, uses about 40B for each token, and only about 11 GB of those
+change from one token to the next: the routed experts.
<p align="center">
- <img src="docs/media/ladder.png" width="880" alt="measured decode speed by hardware class">
+ <img src="docs/media/sparse.png" width="880" alt="only about 5.4% of parameters are active per token">
</p>
-Same engine, same int4 container — the hardware only changes where the experts
-live. Highlights from the [full benchmark tables](docs/benchmarks.md):
-
-- **6× RTX 5090, full residency:** 5.8–6.8 tok/s decode, TTFT ~13 s
- ([experiment log](docs/experiments/glm52-6x5090-2026-07-12.md));
-- **128 GB CPU-only desktop:** ~1.8 tok/s warm ([#200](https://github.com/JustVugg/colibri/issues/200));
-- **single RTX 5070 Ti laptop-class box:** 1.07 tok/s via the GPU-resident
- pipeline ([#273](https://github.com/JustVugg/colibri/issues/273));
-- **25 GB dev box:** 0.05–0.1 tok/s cold — the proven floor where this project
- started, and still the honest baseline.
-
-Quality is measured, not assumed: the int4 container's quantization cost and the
-scale-granularity/rotation ablations live in
-[docs/benchmarks.md](docs/benchmarks.md#quality-benchmark) and
-[#108](https://github.com/JustVugg/colibri/issues/108)/[#81](https://github.com/JustVugg/colibri/issues/81).
-
-## Get started
+So the model does not have to fit in fast memory; it has to be **placed**. The
+dense part (attention, shared experts, embeddings) stays in RAM. The routed
+experts stay on the disk and are read when the router asks for them, through a
+cache that learns which experts your work uses. A GPU, when there is one, holds
+the hottest experts and the dense layers. Where a weight sits changes how fast
+the answer comes, not which weights or which router decisions produce it.
+
+Why: to run models of this size on hardware people already own, to watch them
+work (the dashboard shows every expert as it fires), and to keep the engine
+small enough that anyone can measure it and make it faster. colibri is also an
+open research platform: an optimisation earns its place with a reproducible
+end-to-end measurement, and the default policy never silently changes model
+precision or router semantics. Less fast memory may cost speed; it must not
+quietly redefine the model. [How it works](#how-it-works) has the details.
+
+## Which model for my machine
+
+The setup recommends the most capable model that runs from RAM on your
+machine, and lists the larger ones that stream from the disk right below it.
+`./start-here.sh --list` shows them all against your machine. The tables follow
+the setup's own catalog ([`c/setup_catalog.py`](c/setup_catalog.py)); the
+downloads are the sizes Hugging Face lists for each repository.
+
+- **RAM** is two numbers: below the first the model does not start, from the
+ second it runs as measured.
+- **GPU** is what the setup can build for that engine ([GPUs](#gpus)).
+ *Integrated too* means it also uses an integrated GPU, where these engines
+ were measured faster; the others use a discrete GPU only.
+- **Measured** is what was timed on the machine named, decode speed for the
+ chat models. The letters are machines listed under the tables. A blank means
+ nobody has measured it yet.
+
+**Small models, which run from RAM**
+
+| Model | `--model` | Download | RAM | GPU | Measured |
+|---|---|---|---|---|---|
+| **Qwen3.6-35B-A3B**: chat with thinking and tools | `qwen36-35b` | 23 GB | 10 / 20 GB | CUDA, Vulkan (integrated too) | 6.0 tok/s on the CPU, 9.9 with Vulkan on the integrated GPU (A); 30.0 with CUDA (C) |
+| Qwen3-Coder-30B-A3B: code and tool calls, no thinking | `qwen3-coder-30b` | 19 GB | 8 / 18 GB | CUDA, Vulkan (integrated too) | 8.5-9.6 tok/s with every expert in RAM, 5.1 with 32 per layer (A, CPU) |
+| **Qwen-Image-2.1**: text to picture, non-commercial licence | `qwen-image-2.1` | 33 GB | 12 / 18 GB | Vulkan | one 768x512 picture in 2 min 40 s (8 Zen 4 cores, CPU) |
+
+**Large models, whose experts stream from the disk** (the disk sets the speed:
+a fast NVMe drive helps most)
+
+| Model | `--model` | Download | RAM | GPU | Measured |
+|---|---|---|---|---|---|
+| DeepSeek V4 Flash REAP 150B: 132 of the 256 experts | `deepseek-v4-flash-reap` | 85 GB | 16 / 32 GB | CUDA, Vulkan | |
+| **DeepSeek V4 Flash** (284B): tools | `deepseek-v4-flash` | 167 GB | 16 / 32 GB | CUDA, Vulkan | 0.93 tok/s with 32 GB (Ryzen 7 5800X), 1.24 with 63 GB (Ryzen 9 5950X), CPU only; 1.5-1.6 with CUDA (RTX 5080, 32 GB, two NVMe) |
+| **MiMo-V2.6 Flash** (309B): vision and tools | `mimo-v2.6-flash` | 172 GB | 32 / 52 GB | Vulkan | 2.34-3.37 tok/s (A, CPU) |
+| **Qwen3.8-Flash-Next** (125B + 51B n-gram): vision and tools | `qwen38-flash-next` | 186 GB | 24 / 32 GB | CUDA, Vulkan (integrated too) | 1.91-2.56 tok/s with 32-96 experts per layer; 3.99 with the optional int4 experts (A, CPU) |
+| **GLM-5.2** (744B): the reference model, with the MTP head | `glm-5.2` | 429 GB | 16 / 24 GB | CUDA, Vulkan | 0.05-0.1 tok/s cold on a 25 GB laptop; 1.83 on a 128 GB Ryzen AI Max+ 395; 9.0-9.2 on 6x RTX 5090 |
+| GLM-5.3 (744B): the same engine, no MTP head | `glm-5.3` | 419 GB | 16 / 24 GB | CUDA, Vulkan | |
+| **Inkling** (975B): int4 experts, bf16 dense weights | `inkling` | 514 GB | 120 / 128 GB as downloaded; 25 GB after a [dense conversion](docs/inkling.md) | CUDA, Vulkan | 0.25 tok/s (Ryzen 9 7900, 187 GB, RTX A6000) |
+| MiMo-V2.6 Pro (1.02T): vision and tools | `mimo-v2.6-pro` | 564 GB | 54 / 64 GB | Vulkan | 0.66-0.79 tok/s (A, CPU) |
+| **Kimi K3** (2.8T): the largest | `kimi-k3` | 1.56 TB | 32 / 64 GB | CUDA, Vulkan | about 9.4 s per token, experts read at 6.3 GB/s |
+
+<a id="other-supported-models"></a>
+
+**By hand: a conversion or preparation step after the download**
+
+| Model | Download, then on disk | RAM | GPU | Measured |
+|---|---|---|---|---|
+| **OLMoE** (7B): small, to learn the tools on | 14 GB, 7 GB after conversion to int8 | 8 GB | Vulkan | 22-23 tok/s (A, CPU) |
+| Qwen3.8-27B (dense): text and images | 56 GB, 51 GB after conversion | 20 GB in int4, 30 GB in int8 | Vulkan | 3.45 tok/s in int4, 2.1 in int8 (16-thread CPU server) |
+| **GLM-5.3-Flash** (321B): vision and tools | 328 GB, converted shard by shard to 195 GB | 25 GB | CUDA, Vulkan | about 20 s per token warm, 44 s cold (6 cores, 25 GB, ordinary disk) |
+| **DeepSeek V4.1 Flash** (552B): vision and tools, no conversion but a one-off preparation | 510 GB | about 18 GB plus the expert cache (24.8 GB peak with 8 per layer) | Vulkan | 0.21-0.24 tok/s (16-thread CPU server holding 68% of the experts) |
-You need two things: **the program** (a few hundred KB) and **the model**
-(429 GB). Step-by-step for every platform in the
-[Quick Start guide](docs/quickstart.md).
+**Decision models** (they answer [System One](#system-one-a-decision-with-a-probability) questions, they do not chat)
-### The one-step way
+| Model | Download, then on disk | RAM | GPU | Measured |
+|---|---|---|---|---|
+| **Laya** (Convai Innovations), English | 0.85 GB | 1.7 GB | CPU | 219 ms for one question, 882 ms for three (B) |
+| **GLiNER2.5-Decide** (fastino), English | 1.95 GB | 1.9 GB | CPU | 294 ms for one question, 897 ms for three (B, under load) |
+| **Clef** (Cloudflare): Qwen3.8-27B with a decision head, it also chats | 55 GB, 52 GB after conversion | 19 GB in int4 to 55 GB in f16 | CPU | 20.4 s per request in int8 (A) |
+
+The machines:
+**A** a Ryzen 7 PRO 8700GE desktop (8 cores, 61-64 GB DDR5, NVMe, integrated
+Radeon 780M);
+**B** an i7-1355U laptop;
+**C** an RTX 3070 8 GB in a Threadripper 3945WX box, with the dense layers and
+the DeltaNet layers on the card (per-row int4 container).
+Each number comes from its model's page in [docs/](docs/) or from
+[the benchmark tables](docs/benchmarks.md), with the exact settings.
+
+Each family has its page: [qwen36.md](docs/qwen36.md) (Qwen3.6, Qwen3-Coder,
+Qwen3.8-27B), [qwen38.md](docs/qwen38.md), [deepseek-v4.md](docs/deepseek-v4.md),
+[deepseek-v41.md](docs/deepseek-v41.md), [mimo.md](docs/mimo.md),
+[glm53-flash.md](docs/glm53-flash.md), [inkling.md](docs/inkling.md),
+[kimi_k3.md](docs/kimi_k3.md), [qwen-image.md](docs/qwen-image.md),
+[laya.md](docs/laya.md), [gliner_decide.md](docs/gliner_decide.md),
+[clef.md](docs/clef.md), and GLM-5.2 in the [Quick Start](docs/quickstart.md#3-get-the-model).
+Checkpoints with the same architecture as a supported one, such as
+KAT-Coder v2.5 on the Qwen3.6 engine, run unchanged.
+
+## GPUs
+
+### No GPU needed
+
+Every engine runs on the CPU with nothing else installed. A GPU is a faster
+place to keep weights, not a requirement: for the large models the disk sets
+the speed, for the small ones the RAM.
+
+### Vulkan: any GPU
+
+Every MoE engine can use any GPU with a Vulkan 1.2 driver (AMD, Intel, NVIDIA,
+integrated or discrete) in two ways:
+
+- **the expert tier**: a cache of routed experts in GPU memory, filled at
+ startup from the experts your past conversations used and adapting while you
+ chat. The GPU computes the experts it holds while the CPU computes the rest;
+- **the dense chain**: a whole layer recorded as one GPU submission, with the
+ model's running state kept on the GPU from one layer to the next.
+
+Measured on the integrated Radeon 780M of machine A, the model files dropped
+from the page cache before each run, 100 tokens decoded
+([vulkan.md](docs/vulkan.md#the-chain-on-a-radeon-780m)):
+
+| | CPU | Vulkan, expert tier | Vulkan, tier and dense chain |
+|---|---|---|---|
+| Qwen3.6-35B-A3B, decode | 6.0 tok/s | 8.0 tok/s | **9.9 tok/s** |
+| Qwen3.6-35B-A3B, a 512-token prompt | 35.7 s | 12.2 s | **9.5 s** |
+| Qwen3.8-Flash-Next (int4 experts), decode | 3.5 tok/s | **3.8 tok/s** | 3.2 tok/s |
+| Qwen3.8-Flash-Next, a 512-token prompt | 43.6 s | 38.7 s | **30.1 s** |
+| OLMoE, decode (warm) | **23.1 tok/s** | 12.8 tok/s | 17.3 tok/s |
+
+An integrated GPU shares the CPU's RAM. What it saves is the work and the disk
+reads of the experts it holds, so it pays on a model like Qwen3.6, and a small
+model whose experts already sit in RAM, like OLMoE, can lose. That is why the
+setup turns Vulkan on for an integrated GPU only for Qwen3.6, Qwen3-Coder and
+Qwen3.8-Flash-Next, and why each engine decides for itself whether to run the
+dense chain there (Qwen3.6 yes, Qwen3.8 no). `--backend vulkan` asks for Vulkan
+anyway.
+
+On a discrete GPU the setup builds Vulkan for every engine (CUDA first, where
+the engine has it and the toolkit is installed), with the dense layers on the
+card. That is the case the design is for, and it is **not measured yet: no
+discrete GPU has run the expert tier or the dense chain.** (Before them,
+GLM-5.2's earlier Vulkan path decoded 1.7-1.8 tok/s on a discrete RX 9070.)
+Numbers from your card are welcome.
+
+**Cards without Resizable BAR** now work. Such a card (every Turing card,
+Ampere cards on their launch firmware, older AMD cards with the option off)
+lets the CPU write only about 256 MB of its memory directly; colibri now copies
+the weights in through a staging buffer, on its own. The path is tested by
+forcing it and by emulating the small window on three devices, and it costs
+nothing measurable on the 780M; it has not been measured on a card without
+Resizable BAR ([vulkan.md](docs/vulkan.md#memory-placement-without-resizable-bar)).
+
+CI checks every engine's Vulkan path against the CPU's tokens on a software
+driver. The GPU adds numbers in a different order, and keeps some activations
+in f32 where the CPU rounds them, so a long answer can drift from the CPU's by
+a word ([vulkan.md](docs/vulkan.md#the-other-engines)).
+
+### CUDA: NVIDIA cards
+
+The setup builds CUDA on Linux when the CUDA toolkit is installed, for the
+engines that have a CUDA path: GLM-5.2/5.3, GLM-5.3-Flash, Inkling, Kimi K3,
+DeepSeek V4 Flash, Qwen3.8-Flash-Next, and Qwen3.6 with Qwen3-Coder. On
+Windows the CUDA engine is a separate DLL ([windows.md](docs/windows.md)).
+
+- **The VRAM expert tier** keeps the hottest experts on the card, chosen from
+ measured routing; misses compute on the CPU at the same time. Qwen3.6 on two
+ 8 GB cards (RTX 3070 and Quadro RTX 4000) decoded 11.3 tok/s with a warm
+ history ([qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md)); GLM-5.2 on six
+ RTX 5090 with every expert resident, 9.0-9.2 tok/s
+ ([benchmarks.md](docs/benchmarks.md)); DeepSeek V4 Flash on an RTX 5080,
+ 1.5-1.6 tok/s and a 3,324-token prompt in 90 s
+ ([deepseek-v4.md](docs/deepseek-v4.md)).
+- **New for Qwen3.6: the DeltaNet layers on the card** (`Q36_DN_GPU=1`,
+ opt-in). Each of Qwen3.6's 30 DeltaNet layers used to copy its data between
+ the card and the CPU four times per token; now a decode token runs the whole layer
+ on the card, with its recurrent state kept in VRAM. On an RTX 3070 with the
+ dense layers in VRAM: 25.4 to 30.0 tok/s
+ ([qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md#the-deltanet-layer-on-the-card-q36_dn_gpu1)).
+- **Older cards.** If the CUDA toolkit no longer compiles for your card (CUDA
+ 13 and a V100, in [#1852](https://github.com/JustVugg/colibri/issues/1852)),
+ the build stops: `--backend vulkan` uses the card through Vulkan instead.
+ DeepSeek V4's CUDA tier also builds for Pascal and Turing
+ (`CUDA_ARCH=portable-pre-ampere NO_TC=1`).
+
+All of it: [docs/cuda.md](docs/cuda.md).
+
+### Apple Silicon
+
+A Metal backend does the expert math on the unified-memory GPU for several
+engines; build with `METAL=1` ([docs/metal.md](docs/metal.md)). On macOS the
+one-step setup builds for the CPU.
+
+<a id="system-one-mode-ask-a-closed-question"></a>
+
+## System One: a decision with a probability
-**Windows:** download the repository (**Code**, then **Download ZIP**, or
-`git clone`), unzip it and double-click **`START-HERE.bat`**.
-**Linux and macOS:**
+Most of what people ask a model for is a choice, not a paragraph: which queue,
+which verdict, yes or no. `POST /v1/systemone` takes a state (text or JSON) and
+typed questions, and answers each one with the probability of every allowed
+option and a confidence. Nothing is generated, so no answer can fall outside
+your list, and "the model is not sure" is a number you can put a threshold on.
```bash
-git clone https://github.com/JustVugg/colibri && cd colibri
-./start-here.sh
+curl -s http://127.0.0.1:8000/v1/systemone -H 'Content-Type: application/json' -d '{
+ "state": "340 lines, 8 files, no tests. CI is green but nothing covers that path.",
+ "questions": {
+ "review": {"type": "choice", "instructions": "What should the reviewer do?",
+ "criteria": {"merge": null, "request changes": null, "close": null}},
+ "risky": {"type": "noul", "instructions": "Is this change risky?"}}}'
```
-It finds your RAM, disk and GPU, recommends a model that fits this machine
-(Enter takes it), builds the engine with Vulkan or CUDA when your GPU can use
-it (or fetches the prebuilt one), downloads the model with resume (interrupt
-it any time, run it again to continue), and opens the dashboard in your
-browser. It also prints the OpenAI and Anthropic base URLs for other apps.
-Run it again later and colibri starts straight away; `c/coli stop` stops it.
-What each step does: [quickstart.md](docs/quickstart.md#the-one-step-way).
+A `choice` comes back with the chosen label, a probability for every label and a
+`confidence` from 0 (flat) to 1 (certain); a `noul` with the probability of yes;
+a `score` with the expected level.
-Use an AI coding assistant? Ask it to set up colibri following [docs/AI_SETUP.md](docs/AI_SETUP.md).
-Assistants that speak the Model Context Protocol can use `coli mcp`
-([MCP_SERVER.md](docs/MCP_SERVER.md)).
+Who answers:
-The manual path follows.
+- **Any chat model colibri runs**, by scoring: it reads the probability of each
+ option instead of writing an answer. Many questions about one document read
+ the document once: on Qwen3.6, four questions about one document came back
+ 5.7x faster than generating the same answers on the same CPU box.
+- **Three decision models**, natively, in one forward pass with the calibration
+ their authors fitted: [Laya](docs/laya.md) (Convai Innovations),
+ [GLiNER2.5-Decide](docs/gliner_decide.md) (fastino) and [Clef](docs/clef.md)
+ (Cloudflare; it also chats). Their sizes and speeds are in
+ [the decision models table](#which-model-for-my-machine).
-### 1. Get colibri
+**Switching from Jev.** The request and the reply are those of TypeSafe's Jev
+API, so a Jev client switches to colibri by changing its base URL and nothing
+else: `TYPESAFE_BASE_URL=http://127.0.0.1:8000` (the key it already sends is
+accepted by a server started without `COLI_API_KEY`). The two official SDKs,
+unmodified, are tested against `coli serve`.
-**Download a prebuilt release** — Linux, macOS and Windows, no compiler needed.
-Take the archive for your platform from
-[Releases](https://github.com/JustVugg/colibri/releases) and unpack it:
+The same mode is in the terminal (`/decide merge | request changes | close` in
+`coli chat`) and on the dashboard's System One page. The request and reply in
+full, the scoring rules and where it does not help:
+[docs/systemone.md](docs/systemone.md).
-```bash
-mkdir colibri && tar xzf colibri-v1.8.0-linux-x86_64.tar.gz -C colibri && cd colibri
-python3 coli info # engine ready ✓
-```
+## The dashboard
-Inside you get the engine (`colibri`, `colibri.exe` on Windows), the `coli`
-launcher and its Python helpers. Nothing to rename or configure — `coli` finds
-the engine next to itself. You only need
-[Python 3](https://www.python.org/downloads/) installed: the launcher and the
-API gateway are Python scripts, while the engine itself is pure C with zero
-dependencies.
+`coli web` opens it, and so does the one-step setup: the chat, the System One
+page, the Brain and the Profiling page, in a light or a dark theme.
-**Or build from source** — needs `gcc` (or clang) with OpenMP:
+<p align="center">
+ <img src="docs/media/colibri-dashboard.png" width="900" alt="the colibri web dashboard: chat, live metrics, hardware panel, expert tiers">
+</p>
+<p align="center"><em>Qwen3.6 answering on a CPU box, experts streamed from disk.</em></p>
-```bash
-git clone https://github.com/JustVugg/colibri && cd colibri/c
-./setup.sh # checks gcc/OpenMP, builds, self-tests
-```
+<p align="center">
+ <img src="docs/media/colibri-brio.png" width="900" alt="the System One page: a document read once, a probability for every allowed answer, and an entropy">
+</p>
+<p align="center"><em><strong>System One</strong>: give the model a document and the only answers it may pick. Here:
+<strong>request changes at 99.9%</strong>, entropy 0.005, 4 tokens read, 0 generated.</em></p>
-Want `coli` on your PATH? From a checkout, `pip install -e .` registers it (the
-engine still lives in `c/` — an editable install from the clone, not a wheel).
+<p align="center">
+ <img src="docs/media/colibri-brain.png" width="900" alt="the Brain page: the measured expert atlas of GLM-5.2 drawn as a cortex, ten regions to enter">
+</p>
+<p align="center"><em>The <strong>Brain</strong>: the <a href="https://github.com/JustVugg/colibri/issues/175">measured expert atlas</a> of GLM-5.2,
+13,260 characterised experts in ten regions (Python, SQL, mathematics, poetry, law, Chinese...), placed by measured
+routing affinity. <strong>Live routing</strong> shows the model that is running: one cell per expert, coloured by
+storage tier, and every expert routed in a turn flashes.</em></p>
+
+The **Profiling** page shows where each turn spends its time, phase by phase,
+with the last 30 turns as a trend.
+
+## Use it from other apps
+
+`coli serve` (which the setup starts for you) is one server with several APIs:
+
+- **OpenAI-compatible**: `/v1/chat/completions`, `/v1/completions` and
+ `/v1/models`, with streaming, JSON replies, stop sequences and logprobs;
+- **Anthropic-compatible**: `/v1/messages`, so Claude Code and the Anthropic
+ SDKs work against it;
+- **tool calling** on every chat engine except Inkling and OLMoE, each in its
+ model's native format ([the per-engine table](docs/api.md#tool-calling-support));
+- **images in** on GLM-5.3-Flash, DeepSeek V4.1 Flash, MiMo-V2.6,
+ Qwen3.8-Flash-Next and Qwen3.8-27B: a path in a `coli chat` message, an
+ attachment in `coli web`, or an `image_url` part;
+- **pictures out** with Qwen-Image-2.1 on `POST /v1/images/generations`,
+ and drawn inside the terminal by `coli chat`
+ ([qwen-image.md](docs/qwen-image.md));
+- **decisions** on `POST /v1/systemone` ([above](#system-one-a-decision-with-a-probability)).
+
+Coding CLIs and editors connect as to any OpenAI-compatible provider: base URL
+`http://127.0.0.1:8000/v1`, the model id `coli status` prints, any non-empty key
+([docs/api.md](docs/api.md#connect-a-coding-cli-or-editor)).
-### 2. Get the model
+## How it works
-A pre-converted **GLM-5.2 int4** container is on Hugging Face — use the
-**group-scaled (gs64)** build with the **int8 MTP head**. It is about **429 GB**,
-so put it on a disk with the room, ideally a fast one:
+<p align="center">
+ <img src="docs/media/token-path.png" width="880" alt="route, union, place, overlap, learn">
+</p>
-**https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp**
+Every layer of every token walks the same five steps: route, union, place,
+overlap, learn. The design goal is that **placement only ever decides speed**:
+the router's decisions and the weights' precision are the same whether an
+expert answered from VRAM, from RAM or from disk.
-**GLM-5.3** is the same family and loads with the same engine. It has its own
-container, also group-scaled (gs64), about **419 GB**. It ships **without** the
-MTP head, so speculative decoding stays off:
+<p align="center">
+ <img src="docs/media/tiers.png" width="880" alt="VRAM, RAM and NVMe as three tiers of expert residency">
+</p>
-**https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64**
+- **A JIT for weights.** A compiler JIT never compiles the whole program: it
+ watches what runs and compiles the hot paths. colibri makes the same bet
+ about weights. Measured routing heat decides which experts earn VRAM, RAM or
+ disk: a per-layer LRU cache, plus a pinned hot set learned from your own
+ conversations (`.coli_usage`, updated every turn). colibri gets faster the
+ more you use it. It works because routing has measurable structure (the
+ [expert atlas](https://github.com/JustVugg/colibri/issues/175)).
+- **Never wait for the disk twice.** An expert's three matrices are read in one
+ `pread`; a pool of loaders reads the missing experts while the resident ones
+ compute; a batch of positions reads each expert once; a router-lookahead
+ thread can prefetch the next layer (GLM-5.2's routing is 71.6% predictable
+ one layer ahead). `DIRECT=1` (O_DIRECT) is often a large win on fast NVMe drives and
+ neutral or worse on others: measure it on yours ([tuning.md](docs/tuning.md)).
+- **More than one SSD.** `COLI_MODEL_MIRROR=/second/glm52_i4 ./coli chat --model /fast/glm52_i4`
+ reads from a copy on a second drive. Two NVMe drives on independent
+ controllers measured +37.5% decode; a partial mirror on a smaller drive works
+ too ([multidisk.md](docs/multidisk.md)).
+- **From a laptop to a rack.** On a 25 GB laptop every expert streams from
+ disk, slowly and correctly; on a large host every expert is resident
+ (`CUDA_EXPERT_GB=auto PIN_GB=all`) and the disk drops out of decoding.
+ `COLI_NUMA=1` spreads the resident weights over the memory controllers of a
+ multi-socket host, and a local cluster mode runs routed experts on other
+ machines ([cluster.md](docs/cluster.md)).
+- **A faithful model.** Every engine is checked in CI against its model's
+ reference implementation on a tiny fixture. GLM-5.2's MLA attention keeps a
+ compressed KV state (576 floats per token instead of 32,768, 57x smaller)
+ that survives restarts, so a conversation reopens with no prompt to read
+ again.
+- **Speculation that earns its keep.** GLM-5.2's int8 MTP head drafts 2.2-2.8
+ tokens per forward when it pays; Qwen3.8-Flash-Next's MTP head, opt-in, adds
+ 12-14% with the same output. Where drafting costs more than it saves (DeepSeek V4)
+ it stays off ([tuning.md](docs/tuning.md#speculation-and-reproducibility)).
+
+The engine is one C file per model family (`c/colibri.c` for GLM-5.2) over
+shared headers, with no BLAS and no Python at runtime: Python runs only the
+setup, the launcher, the converters and the API gateway.
+
+<a id="what-it-achieves"></a>
+
+## Benchmarks
-> ⚠️ Use the **gs64** container above, not the older per-row int4 mirrors
-> (`mateogrgic/…`, `jlnsrk/…`): those measure ~9pp worse on quality and are the
-> root cause of the original think-mode loops and never-terminating generations
-> in [#455](https://github.com/JustVugg/colibri/issues/455). The gs64 container
-> fixed those controlled per-row A/Bs, but it is not a general repetition or
-> EOS-starvation guard. The MTP head must also be **int8, not int4**
-> (int4 → 0% draft acceptance, [#8](https://github.com/JustVugg/colibri/issues/8)):
-> `ls -l <model>/out-mtp-*` — int8 (correct) is `3527131672 / 5366238584 / 1065950496`
-> as three files, or a single `out-mtp-00000.safetensors` of `9959321520` bytes
-> (the current upload of the recommended container ships it as one file: same
-> int8 tensors, 777 of them at one byte per element).
+<p align="center">
+ <img src="docs/media/ladder.png" width="880" alt="measured GLM-5.2 decode speed by hardware class">
+</p>
-Or convert from the FP8 source yourself — one resumable command that never needs
-the full 756 GB on disk at once:
+The same engine and the same int4 container: the hardware only changes where
+the experts live. GLM-5.2 decode, from [the full tables](docs/benchmarks.md):
-```bash
-./coli convert --model /nvme/glm52_i4 # download+convert shard by shard (python, one-time)
-```
+- **6x RTX 5090, every expert resident:** 5.8-6.8 tok/s, 9.0-9.2 with selective
+ NUMA interleave ([experiment log](docs/experiments/glm52-6x5090-2026-07-12.md));
+- **128 GB, CPU only** (Ryzen AI Max+ 395): 1.83 tok/s warm
+ ([#200](https://github.com/JustVugg/colibri/issues/200));
+- **a single RTX 5070 Ti laptop-class box:** 1.07 tok/s
+ ([#273](https://github.com/JustVugg/colibri/issues/273));
+- **the 25 GB laptop where this started:** 0.05-0.1 tok/s cold, the honest
+ floor.
-#### Other supported models
-
-GLM-5.2 is the reference model, but the same streaming approach runs nine more
-language-model families, and one engine generates images. Each is a **sibling
-engine**: one C file, its own architecture, the same `coli chat` / `coli serve` /
-`coli web` front end (the launcher picks the binary from the model's `config.json`,
-or from `model_index.json` for the image model):
-
-> **What each one needs.** These differ a lot, and reading two of them together
-> has confused people into thinking the requirements contradict each other
-> ([#191](https://github.com/JustVugg/colibri/issues/191)). They do not — they
-> are different models. **None of them needs a GPU.**
->
-> | Model | Disk for the weights | RAM | GPU |
-> |---|---|---|---|
-> | **OLMoE** | ~7 GB (int8 container) | 8 GB | not needed; Vulkan opt-in |
-> | **GLM-5.2/5.3** | ~429 GB (5.2) / ~419 GB (5.3) | 16 GB min, 24 GB comfortable | not needed; Vulkan opt-in |
-> | **GLM-5.3-Flash** | ~195 GB converted | 25 GB (12 GB weights at int4 + expert cache) | not needed; Vulkan opt-in |
-> | **Inkling** | ~469 GB | 25 GB with the int4 dense container, ~120 GB without | not needed; Vulkan opt-in |
-> | **Kimi K3** | ~1.6 TB | 32 GB+ | not needed; Vulkan opt-in |
-> | **DeepSeek V4 Flash** | ~167 GB (REAP 150B: ~85 GB) | 16 GB min, 32 GB comfortable | optional; any NVIDIA card from the GTX 10 series up (Pascal/Turing via `CUDA_ARCH=portable-pre-ampere NO_TC=1`, best on RTX 50) makes prefill 5-10x and decode ~2.5x faster; Vulkan opt-in |
-> | **DeepSeek V4.1 Flash** | ~510 GB (official checkpoint; 203 GB of it is an n-gram memory read a few hundred bytes at a time) | ~18 GB resident (dense, embeddings, vision) plus the expert cache `--ram` sizes; 24.8 GB peak RSS measured at cap 8 | not needed; Vulkan opt-in |
-> | **MiMo-V2.6 Flash** | ~178 GB (official checkpoint) | 30.1 GB resident measured with 32 experts cached per layer, 49.8 GB with 64; `--ram` sizes the cache | not needed; Vulkan opt-in |
-> | **MiMo-V2.6 Pro** | ~574 GB (~564 GB without the three files the engine never loads) | dense set 30.2 GiB as released, 21.7 GiB in int8; 48.0 GB resident measured with 12 experts cached per layer (dense as released), 50.7 GB with 20 (dense in int8) | not needed; Vulkan opt-in |
-> | **Qwen3.8-Flash-Next** | ~185.5 GB (official FP8 checkpoint), plus 68.0 GB for the optional int4-g64 expert sidecar | 24 GB comfortable at the default context with the FP8 experts (cap 32; 16 GB is below the floor); 11.6 GB RSS measured at cap 32 with the int4-g64 sidecar | optional; the CUDA VRAM expert tier (FP8 experts only) with dense trunk quantized to int8 in VRAM; Vulkan opt-in |
-> | **Qwen3.8-27B** (dense, text and images) | ~51 GB converted (f16) | 20 GB with int4 dense weights, 30 GB in int8 | not needed; no CUDA tier yet; Vulkan opt-in |
-> | **Qwen3.6-35B-A3B** | ~23 GB (int4-gs64 container) | 24 GB (needs full RAM residency) | optional; the CUDA VRAM expert tier measured **1.44 -> 10.05 tok/s (7.0x)** on two 8 GB cards, output bit-identical to CPU; Vulkan opt-in |
-> | **Qwen3-Coder-30B-A3B** | ~19 GB (int4-gs64 container; 30 GB in int8) | 6.5 GB resident measured with 32 experts cached per layer, 15.2 GB with all 128 | not needed; Vulkan opt-in |
-> | **Qwen-Image-2.1** (text to image) | ~33 GB (official diffusers checkpoint) | 16.0 GB with everything resident, 8.5 GB peak with the text encoder loaded per prompt, plus working buffers (9.0 GB peak measured for one 768x512 image) | not needed; Vulkan opt-in, not timed on a GPU yet |
->
-> A GPU never changes what the model answers, only where the work runs. Speed is
-> set by your disk, because the experts are streamed from it: expect a fraction
-> of a token per second on a slow drive and a few per second on a fast one with
-> the cache warm.
->
-> **Vulkan opt-in** means a `VK=1` build. Run with `COLI_VULKAN=1`, the engine
-> puts its resident matrices on any GPU with a Vulkan 1.2 driver (GLM-5.2 has a
-> full decode path there), and CI checks
-> those engines against the CPU's tokens on a software driver
-> ([vulkan.md](docs/vulkan.md#the-other-engines)). Correct is not yet faster. On
-> the first real GPU measured for these engines, an integrated Radeon 780M (Ryzen 7
-> PRO 8700GE, same binaries, cold page cache), it is slower than the CPU today:
-> Qwen3.6-35B-A3B decoded 3.06 tok/s against 5.97 on the CPU, with identical
-> output, and Qwen3.8-Flash-Next with int4 experts 1.53 against 3.55. Every matmul
-> is a synchronous submit, about 726 per token, and an integrated GPU reads the
-> same RAM as the CPU.
-
-| Family | Total / active | Weights | Build | Docs |
-|---|---|---|---|---|
-| **GLM-5.2/5.3** | 744B / 40B | [`mastouri/…-int4-g64-with-int8-mtp`](https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp) (429 GB) or [`Justvugg/GLM-5.3-colibri-int4-g64`](https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64) (419 GB) | `make -C c glm` | this page |
-| **Inkling** (Thinking Machines) | 975B / 41B | [`nbeerbower/Inkling-colibri-int4`](https://huggingface.co/nbeerbower/Inkling-colibri-int4) (469 GB) | `make -C c inkling` | [inkling.md](docs/inkling.md) |
-| **GLM-5.3-Flash** (Z.ai) | 321B / 18B | [`zai-org/GLM-5.3-Flash`](https://huggingface.co/zai-org/GLM-5.3-Flash), converted to **int4-gs64** routed experts, dense stays BF16 and the precision is a load-time choice; vision included | `make -C c glm53` | [glm53-flash.md](docs/glm53-flash.md) |
-| **Kimi K3** (Moonshot) | 2.8T / 104B | [`moonshotai/Kimi-K3`](https://huggingface.co/moonshotai/Kimi-K3) — original checkpoint, routed experts stay **native MXFP4** | `make -C c kimi_k3` | [kimi_k3.md](docs/kimi_k3.md) |
-| **DeepSeek V4 Flash** | 284B / 13B | official sharded checkpoint — routed experts stay **native fp4**, dense stays fp8-e4m3; the **REAP-pruned 150B** ([`puwaer/DeepSeek-V4-Flash-0731-reap-150b`](https://huggingface.co/puwaer/DeepSeek-V4-Flash-0731-reap-150b), 85 GB, 132 of 256 experts) loads with the same engine and no conversion | `make -C c deepseek-v4` | [deepseek-v4.md](docs/deepseek-v4.md) |
-| **DeepSeek V4.1 Flash** | 552B / 16B | official checkpoint, **no conversion**: experts are already fp4, dense is fp8-e4m3. 203 GB of it is an n-gram memory read from disk a few hundred bytes at a time, and the routed experts cost **4.5 GB per token** against GLM-5.2's 12.7. Vision, tool calling and the DSpark draft head are all on | `make -C c deepseek_v41` | [deepseek-v41.md](docs/deepseek-v41.md) |
-| **MiMo-V2.6 Flash** (Xiaomi) | 309B / 15B | [`XiaomiMiMo/MiMo-V2.6-Flash-MOPD`](https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Flash-MOPD) (178 GB), official checkpoint, **no conversion**: routed experts stay **native MXFP4**, dense stays FP8/BF16. 39 of its 48 layers attend a 128-token window, so a long context costs the KV of 9. Vision and tool calling on | `make -C c mimo` | [mimo.md](docs/mimo.md) |
-| **MiMo-V2.6 Pro** (Xiaomi) | 1.02T / 42B | [`XiaomiMiMo/MiMo-V2.6-Pro-MOPD`](https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Pro-MOPD) (573.5 GB), official checkpoint, **no conversion**, on the MiMo engine: the same architecture at 70 layers and 384 experts. Checked against Xiaomi's own modeling code on the first 32 of its 70 layers. Vision and tool calling on | `make -C c mimo` | [mimo.md](docs/mimo.md#pro) |
-| **Qwen3.8-Flash-Next** (Alibaba) | 125B + 51B n-gram / 6B | [`Qwen/Qwen3.8-Flash-Next-FP8`](https://huggingface.co/Qwen/Qwen3.8-Flash-Next-FP8), original checkpoint; PLE stays pageable and experts stay **native block-FP8**, or are read as **int4-g64** from an optional sidecar (see below). Opt-in MTP drafting (`Q38_MTP=1`) | `make -C c qwen38` (`CUDA=1` for the VRAM expert tier) | [qwen38.md](docs/qwen38.md) |
-| **Qwen3.6** (Alibaba) | 35B / 3B | [`Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64`](https://huggingface.co/Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64) (~23 GB, **recommended**) — hybrid Gated Attention + Gated DeltaNet | `make -C c qwen36` (`CUDA=1` for the VRAM expert tier) | [qwen36.md](docs/qwen36.md) |
-| **Qwen3.8-27B** (Alibaba) | 27B, dense | [`Qwen/Qwen3.8-27B`](https://huggingface.co/Qwen/Qwen3.8-27B) converted with `c/tools/convert_qwen36.py` to an f16 container (51 GB); the engine quantizes it to int8, or int4 with `COLI_DENSE_BITS=4`, while loading. One MLP per layer and no router, on the Qwen3.6 engine. Text and images | `make -C c qwen36` | [qwen36.md](docs/qwen36.md#the-dense-27b) |
-| **Qwen3-Coder-30B-A3B** (Alibaba) | 30B / 3B | [`Justvugg/Qwen3-Coder-30B-A3B-colibri-int4`](https://huggingface.co/Justvugg/Qwen3-Coder-30B-A3B-colibri-int4) (19 GB, int4-gs64), converted from [`Qwen/Qwen3-Coder-30B-A3B-Instruct`](https://huggingface.co/Qwen/Qwen3-Coder-30B-A3B-Instruct). All-attention Qwen3 MoE on the Qwen3.6 engine, 128 experts top-8, its own XML tool-call form and no thinking; teacher forced, the int4 container picks the bf16 release's top-1 token at 96.9% of positions | `make -C c qwen36` | [qwen36.md](docs/qwen36.md#qwen3-coder-30b-a3b) |
-| **OLMoE** (AI2) | 7B / 1B | converted with `c/tools/convert_olmoe_merged.py` — **int8** container, ~7 GB | `make -C c olmoe` | — |
-| **Qwen-Image-2.1** (Alibaba) | image model | [`Qwen/Qwen-Image-2.1`](https://huggingface.co/Qwen/Qwen-Image-2.1) (~33 GB), official diffusers checkpoint, **no conversion**: the text encoder and the diffusion transformer are quantized to int8 while loading. Pictures inline in `coli chat`, `POST /v1/images/generations` on `coli serve`. Qwen Research License: non-commercial use only | `make -C c qwenimage` | [qwen-image.md](docs/qwen-image.md) |
-| **Laya** (Convai Innovations) | decision model, 421M | [`convaiinnovations/laya`](https://huggingface.co/convaiinnovations/laya) (842 MB), official checkpoint, **no conversion**: a ModernBERT encoder with a decision head that answers typed questions (choice, score, noul) with calibrated probabilities instead of generating. Served on `POST /v1/systemone` by `coli serve`. Apache-2.0 | `make -C c laya` | [laya.md](docs/laya.md) |
-| **GLiNER2.5-Decide** (fastino) | decision model, 340M | [`fastino/GLiNER2.5-Decide`](https://huggingface.co/fastino/GLiNER2.5-Decide) (1.9 GB), official checkpoint, **no conversion**: a DeBERTa-v3 encoder with GLiNER2's classification head; the questions of a request and the state are read in one pass and every option gets a probability. Served on `POST /v1/systemone` by `coli serve`. Apache-2.0 | `make -C c gliner_decide` | [gliner_decide.md](docs/gliner_decide.md) |
-| **Clef** (Cloudflare) | decision model + chat, 27B | [`Cloudflare/clef`](https://huggingface.co/Cloudflare/clef) (55 GB), converted with `c/tools/convert_qwen36.py` (52 GB, head included): Qwen3.8-27B post-trained with a joint schema head that scores every option of every question in one pass. `POST /v1/systemone` answers natively, chat works as on Qwen3.8-27B. Apache-2.0 | `make -C c qwen36` | [clef.md](docs/clef.md) |
-
-Qwen3.6 ships three pre-converted containers: **int4-gs64** (recommended — measured
-cosine to the int8 anchor 0.98777 → 0.99313 and KL 0.109 → 0.080 against per-row, i.e.
-~44% less quantization error), [int4 per-row](https://huggingface.co/Kreuzzelg/qwen36-35b-a3b-colibri-i4)
-as the A/B baseline, and [KAT-Coder v2.5](https://huggingface.co/Kreuzzelg/kat-coder-v2.5-dev-colibri-i4-gs64),
-which the same engine runs unchanged — any architecture-identical checkpoint works
-without a code path of its own. With `CUDA=1` the VRAM expert tier measured
-**1.44 → 10.05 tok/s (7.0×) on two 8 GB cards**, output bit-identical to the CPU path.
-
-Qwen3.8-Flash-Next reads its routed experts as released, in block-FP8. An optional
-**int4-g64 sidecar** (`c/tools/convert_qwen38_experts_int4.py`, 68.0 GB written next
-to the FP8 shards) makes each miss read 56% of the bytes. Measured on a Ryzen 7 PRO
-8700GE (16 threads, 61 GiB, NVMe), it decodes 1.4-1.5x faster at the same cache
-size and 1.56x faster at the same RAM, for +0.017 nats per token of perplexity on
-average ([qwen38.md](docs/qwen38.md#routed-experts-as-int4-g64)). Speculative
-decoding with the checkpoint's own MTP head is opt-in (`Q38_MTP=1`), and the output
-is identical to plain decoding. On the same machine with the int4 experts, 94-96%
-of drafts were accepted, 1.94 tokens per forward, for +12-14% tok/s (3.57 to 4.01
-at cap 96, 4.15 to 4.74 at cap 170). The gain is small there because the expert
-reads from disk do not shrink ([qwen38.md](docs/qwen38.md)).
-
-Kimi K3 needs no conversion: its QAT-trained MXFP4 experts are streamed straight from
-the original Hugging Face shards, and the bf16 dense set is quantized at load time.
-Long agent sessions can opt into recurrent-state checkpoints (`COLI_K3_CKPT=N`
-slots in RAM, or parked on disk with `COLI_K3_CKPT_DIR`): an edited or follow-up
-prompt restores the deepest surviving checkpoint and re-prefills only the tail,
-instead of replaying the whole conversation through the SSM layers. On Vulkan
-hosts (`COLI_VULKAN=1`) its routed experts join the shared expert tier, filled from
-the expert history and evicting as the routing moves. The
-engine's KDA and MLA paths are validated token-exact in CI against the vendor
-implementation.
-
-Inkling ships int4 experts but **bf16 dense weights** (49.4 GB resident); on a host
-that cannot hold those, [inkling.md](docs/inkling.md) has a one-pass tool that brings
-the dense set to 15.3 GB and lets the 975B run on a 25 GB box — with the honest
-trade-off written down.
-
-### 3. Run it
+Quality is measured, not assumed: the int4 container's cost and the
+quantization ablations are in
+[benchmarks.md](docs/benchmarks.md#quality-benchmark). To add your machine,
+follow [the benchmark protocol](docs/benchmarking.md) and open an issue with
+the numbers.
-```bash
-COLI_MODEL=/nvme/glm52_i4 ./coli chat # RAM budget, cache and MTP auto-detected
-COLI_MODEL=/nvme/glm52_i4 ./coli plan # inspect the planned VRAM/RAM/disk placement
-COLI_MODEL=/nvme/glm52_i4 ./coli doctor # read-only readiness check
-COLI_MODEL=/nvme/glm52_i4 ./coli doctor --deep # strict tensors/shards/index/mirror preflight
-COLI_MODEL=/nvme/glm52_i4 ./coli tune # measure and save this machine's fastest safe execution profile
-./coli web --model /nvme/glm52_i4 # API + dashboard, and opens a browser
-./coli serve --model /nvme/glm52_i4 # API + dashboard, no browser (headless)
-```
+## Install by hand
-#### System One mode: ask a closed question
+<a id="1-get-colibri"></a>
-Most of what people ask a model for is a choice, not a paragraph: which queue,
-which verdict, which of the four values a field may take. System One mode hands the
-engine the options and reads the probability of each one instead of
-generating: nothing is generated, no answer can fall outside your list, and
-every answer comes with a confidence, so "the model is not sure" is a number
-you can put a threshold on. It runs on all ten families, on the same server,
-and it is opt-in per request: chat is byte-identical for everyone who does not
-ask for it.
+**1. The program.** Take the archive for your platform from
+[Releases](https://github.com/JustVugg/colibri/releases) (Linux x86_64, macOS,
+Windows; no compiler needed, only [Python 3](https://www.python.org/downloads/)
+for the launcher and the API) and unpack it, then `python3 coli info`. Or build
+from source with `gcc` (or clang) and OpenMP:
```bash
-# in the TUI: the same model, told to stop writing
-./coli chat --model /nvme/qwen36_i4_gs64
-> /decide merge | request changes | close
-> 340 lines, 8 files, no tests. CI is green but nothing covers that path.
-
-# from anywhere: one JSON request on the running server
-curl -s http://127.0.0.1:8000/v1/systemone -H 'Content-Type: application/json' -d '{
- "state": "340 lines, 8 files, no tests. CI is green but nothing covers that path.",
- "questions": {"review": {"type": "choice", "instructions": "What should the reviewer do?",
- "criteria": {"merge": null, "request changes": null, "close": null}}}}'
+git clone https://github.com/JustVugg/colibri && cd colibri/c
+./setup.sh # checks gcc/OpenMP, builds, self-tests
+make qwen36 VK=1 # one engine, here with Vulkan (CUDA=1 for CUDA)
```
-`POST /v1/systemone` speaks the request and the reply of TypeSafe's Jev API: a
-Jev client switches to colibri by changing its base URL. Many questions about
-one document read it once: measured on Qwen3.6 against generating the same
-answers on the same CPU box, 5.7x on four questions about one document. The
-whole mode, the request and reply shapes, and where it does not help:
-[docs/systemone.md](docs/systemone.md). The dashboard has a System One page as well.
+<a id="2-get-the-model"></a>
+**2. A model.** Any download in [the tables above](#which-model-for-my-machine):
+the setup's ids map to Hugging Face repositories, and each model's page has the
+download and conversion command. For GLM-5.2 use the group-scaled (gs64)
+container with the int8 MTP head,
+[`mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp`](https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp)
+(429 GB), or [`Justvugg/GLM-5.3-colibri-int4-g64`](https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64)
+for GLM-5.3 (419 GB, no MTP head). Not the older per-row int4 mirrors: they
+measure about 9 points worse on quality and caused the looping answers of
+[#455](https://github.com/JustVugg/colibri/issues/455). `./coli convert --model
+/nvme/glm52_i4` builds the same container from the FP8 release, shard by shard,
+without ever needing its 756 GB on disk at once. How to check the MTP head and
+the rest: [quickstart.md](docs/quickstart.md#3-get-the-model).
-On Windows a release archive ships `coli.cmd`: double-click it for the quick
-start, or run `coli.cmd chat --model D:\glm52_i4` from cmd or PowerShell.
-From a source checkout the same commands work with `python coli chat --model
-D:\glm52_i4`. The `.exe` files are the engines, not the launcher: started on
-their own they have no model to load and exit immediately.
-The engine at runtime is pure C — python is only used by the one-time converter
-and the optional API gateway.
+<a id="3-run-it"></a>
-#### The same commands run any of the models
-
-`coli` reads the model's `config.json`, picks the matching engine binary, and
-renders that family's chat template — so **nothing about the command line
-changes between models**. Build the engine you want once, then just point
-`COLI_MODEL` at the right directory:
+**3. Run it.** From `c/` in a source checkout, or from the unpacked release.
+The launcher reads the model's `config.json` and picks the engine and its chat
+template, so the commands are the same for every model:
```bash
-make -C c glm # GLM-5.2
-make -C c inkling # Inkling
-make -C c kimi_k3 # Kimi K3
+./coli chat --model /nvme/qwen36 # chat in the terminal
+./coli web --model /nvme/qwen36 # API + dashboard, opens a browser
+./coli serve --model /nvme/qwen36 # API + dashboard, no browser
+./coli plan --model /nvme/qwen36 # where the model will live: VRAM, RAM, disk
+./coli doctor --model /nvme/qwen36 # read-only check: is everything ready?
+./coli tune --model /nvme/qwen36 # measure and save this machine's fastest safe settings
+```
-COLI_MODEL=/nvme/glm52_i4 ./coli chat # TUI
-COLI_MODEL=/nvme/inkling_i4 ./coli chat
-COLI_MODEL=/nvme/kimi_k3 ./coli chat
+On Windows a release archive ships `coli.cmd` (`coli.cmd chat --model
+D:\qwen36`); from a source checkout use `py -3 c\coli`. The `.exe` files are
+the engines, not the launcher. Every option and variable:
+[SETTINGS.md](docs/SETTINGS.md), [ENVIRONMENT.md](docs/ENVIRONMENT.md).
-./coli web --model /nvme/inkling_i4 # API + dashboard, opens a browser
-./coli web --model /nvme/kimi_k3
-./coli serve --model /nvme/inkling_i4 # API + dashboard, no browser
-```
+## Research, and how to help
-For the non-GLM engines `coli chat` starts the gateway locally and attaches the
-TUI to it, so the TUI, the API and the dashboard all go through the same
-arch-aware chat template — you never have to pass the template yourself.
+colibri wants frontier models to depend less on scarce hardware and to cost
+less to run. That means changing how weights are stored and moved, deciding
+what lives in VRAM, RAM or storage, overlapping CPU and GPU work, and testing
+new ways to decode. Nothing is kept because it is conventional, and nothing is
+adopted because a microbenchmark looks fast: the deciding result is end-to-end
+inference on real machines, with quality measured alongside speed. The open
+questions:
-Two things that differ per model, both documented in the per-model page:
+| hypothesis | evidence so far | experiment still needed |
+|---|---|---|
+| Routing history can place experts better than plain LRU | learned pins improve repeated workloads, but can overfit a prompt | held-out, cross-session A/Bs across coding, chat, multilingual, and long-context workloads |
+| Multiple SSDs can turn independent bandwidth into decode speed | two independent NVMe drives measured +37.5% decode; a slower third drive was neutral after weighted striping ([measurements](docs/multidisk.md#what-has-been-measured)) | reproduce across drive speeds, controller layouts, and cache states |
+| A hardware-aware planner can approach each machine's best configuration automatically | RAM/VRAM budgets and several backends are detected today, and the setup picks the build | compare the generated plan with a controlled parameter sweep across laptops, workstations, NUMA hosts, and multi-GPU systems |
+| Lossless or quality-bounded representations can reduce weight movement enough to matter | format and quantization ablations exist, with correctness/quality gates | reproduce quality, bytes moved, latency, and cost per useful token together, not compression ratio alone |
+| Routing-aware speculation can pay before near-full residency | MTP and grammar drafts work, but MTP has also measured a 32% loss around 85% expert hit | map the break-even surface across acceptance, expert hit rate, batch union, and draft depth |
+| CPU/GPU overlap can hide transfer and synchronization rather than merely move the bottleneck | CUDA, Metal and Vulkan wins exist, but fast CPUs, integrated GPUs and low residency can erase them | per-stage profiles and one-variable A/Bs across PCIe, unified-memory, and full-resident machines, and the first discrete-GPU numbers for the Vulkan tier and chain |
-- **Inkling on a RAM-tight host** needs the int4 dense container and a small
- expert cache: `./coli chat --model /nvme/inkling_i4 --cap 2`
- (see [inkling.md](docs/inkling.md) — the default `--cap 8` wants ~14 GB of
- cache on top of the resident set).
-- **Kimi K3** streams its MXFP4 experts from the original checkpoint, so there
- is nothing to convert — but the snapshot is ~1.6 TB
- (see [kimi_k3.md](docs/kimi_k3.md)).
+Want to help? Pick a row and publish the negative results too. Record the
+hardware, commit, model, exact command, prompt, cache state, throughput, time
+to first token, expert hit rate, bytes read and a quality check; change one
+variable, repeat, and attach the raw logs. Start with
+[CONTRIBUTING.md](CONTRIBUTING.md) and [the benchmark protocol](docs/benchmarking.md),
+then [open an issue](https://github.com/JustVugg/colibri/issues/new). A
+well-controlled failure is worth more here than an unexplained fast number.
-### 4. Go deeper
+## Documentation
| topic | doc |
|---|---|
-| Benchmarks, community datapoints, quality measurements | [docs/benchmarks.md](docs/benchmarks.md) |
-| Reproducible benchmark protocol and minimum report | [docs/benchmarking.md](docs/benchmarking.md) |
-| Tuning knobs, policies, the learning cache, prefetch | [docs/tuning.md](docs/tuning.md) |
-| Windows 11 native build (+ CUDA DLL) | [docs/windows.md](docs/windows.md) |
-| CUDA backend, VRAM expert tier, full residency | [docs/cuda.md](docs/cuda.md) |
-| Vulkan backend (any GPU: AMD via RADV, incl. cards ROCm dropped) | [docs/vulkan.md](docs/vulkan.md) |
-| Apple Silicon Metal backend | [docs/metal.md](docs/metal.md) |
-| OpenAI-compatible API, KV slots, web dashboard | [docs/api.md](docs/api.md) |
-| System One mode: score a closed set of options instead of generating | [docs/systemone.md](docs/systemone.md) |
-| Experimental layer-segment embedding ABI | [docs/segment-runtime.md](docs/segment-runtime.md) |
-| Experimental tokenizer/embedding/head Edge ABI | [docs/edge-runtime.md](docs/edge-runtime.md) |
-| Grammar-forced drafts (structured output) | [docs/grammar-draft.md](docs/grammar-draft.md) |
-| Environment variable inventory | [docs/ENVIRONMENT.md](docs/ENVIRONMENT.md) |
-
-## DeepSeek V4
-
-**DeepSeek V4 Flash** streams the official checkpoint with no conversion: routed
-experts stay **native fp4**, the dense set stays **fp8-e4m3** with UE8M0 block
-scales. MLA + DSA sparse attention, 43 layers, 256 routed experts plus one
-shared, top-6. Supported on x86-64/aarch64 Linux and Windows/MSYS2 (CPU), with
-an optional CUDA tier (Windows runtime DLL; Linux `CUDA=1` direct link,
-verified under WSL2) that keeps every stage CPU-canonical and falls back per stage.
-
-```bash
-cd c
-make deepseek-v4
-python ./coli chat --model /path/to/DeepSeek-V4-Flash --ram 32
-# also: coli run / coli serve / coli web
-# Windows CUDA tier: make cuda-dsv4-dll CUDA_ARCH=portable (+ make cuda-dsv4-dg-dll on RTX 50)
-```
-
-Two opt-in GPU levers are new and looking for community numbers, both default
-off and byte-identical when unset: `DSV4_HYBRID=1` splits VRAM-tier misses
-between the GPU fill branch and the CPU branch using bandwidths measured at
-runtime, and `COLI_CUDA_MOE_DOUBLE=1` (on top of `COLI_CUDA_MOE_BATCH=1`)
-prefetches the next layer's full expert set into a second VRAM bank while the
-current layer computes, falling back to the single bank when VRAM is short.
-The CUDA tier also runs on Pascal and Turing cards now (GTX 10 / RTX 20
-series): build with `CUDA_ARCH=portable-pre-ampere NO_TC=1`.
-
-Greedy decode and one KV slot. Tool calling is wired through the HTTP gateway
-with V4's native prompt and DSML call blocks; grammar is not supported. See the
-[per-engine API matrix](docs/api.md#tool-calling-support). Prefix checkpoints
-(in memory + on disk) make agent sessions and follow-up turns start in seconds
-after the first prefill of a system prompt. Measured on an RTX 5080 + 2 NVMe:
-3324-token prefill 90 s, 8.3k-token first turn ~4 min once, later
-sessions/turns 6-9 s, decode ~1.6 tok/s at 3k context — see
-[docs/deepseek-v4.md](docs/deepseek-v4.md).
-
-**Give it RAM.** 43 × 256 routed experts are ~137 GiB on disk and a token
-touches 301 of them, so the expert cache hit rate is what sets tok/s — `--ram`
-is the single most valuable knob, and it changes speed only, never output.
-
-**Speculative drafting exists and is off.** DSpark's markov drafter and full MTP
-are both implemented and verified: a draft can save forward passes but never
-change a token, because every accepted token is still the target's own argmax.
-Measured on real multi-turn chat, they accepted 1 in 15 and 10 in 24, and the
-rejected-suffix replay of this engine's recurrent attention state cost more than
-the drafts saved — one 14-token answer took 495 seconds. So `V4_DRAFT` and
-`V4_MTP` default to `0` and the code stays, with the numbers beside it, for
-whoever retries this on faster storage.
-
-See [docs/deepseek-v4.md](docs/deepseek-v4.md) for the CUDA tier (build, DLL
-selection, GPU coverage), the environment reference, performance numbers,
-checkpoint validation, and the generated tiny independent oracle.
-
-## What's next
-
-- **Inference-systems research is the product.** The current hierarchy is LRU +
- a learned pin set; active work spans model formats, compression, placement,
- scheduling, I/O, CPU/GPU kernels, heterogeneous overlap, KV state, and
- routing-aware speculation. The objective is lower hardware requirements and
- lower cost per useful token. Everything lands the way this project works:
- measured end to end, reviewed, and developed in the open.
-- **More open models.** The tiering algorithm is model-agnostic: any MoE with
- routed experts can be staged the same way. Ten language-model families run today
- (GLM-5.2/5.3, GLM-5.3-Flash, Inkling, Kimi K3, DeepSeek V4 Flash, DeepSeek V4.1
- Flash, MiMo-V2.6, Qwen3.8-Flash-Next, Qwen3.6, OLMoE), plus Qwen-Image-2.1 for
- pictures; further open-weight families, **MiniMax** among the candidates, earn an
- engine the way these did: when someone measures one end to end.
-
-## Supporting the project
-
-colibrì started as a one-person project on a 12-core laptop with 25 GB of RAM;
-today its numbers come from a community of real machines. If it's useful to you:
-
-- ⭐ star the repo and share it;
-- 🐛 open issues with benchmark numbers from your hardware — datapoints move
- this project more than anything else;
-- 💬 join the [Discord community](https://discord.gg/RXV83nSZdk) to discuss
- experiments, hardware results, and research directions;
-- 💬 reach out via GitHub issues to sponsor development or donate hardware.
+| The one-step setup and the manual install, every platform | [quickstart.md](docs/quickstart.md) |
+| Setting up through an AI assistant, and the MCP server | [AI_SETUP.md](docs/AI_SETUP.md), [MCP_SERVER.md](docs/MCP_SERVER.md) |
+| The API: OpenAI, Anthropic, tools, KV slots, dashboard | [api.md](docs/api.md) |
+| System One and the decision models | [systemone.md](docs/systemone.md), [laya.md](docs/laya.md), [gliner_decide.md](docs/gliner_decide.md), [clef.md](docs/clef.md) |
+| Vulkan: the expert tier, the dense chain, cards without Resizable BAR | [vulkan.md](docs/vulkan.md) |
+| CUDA, and Qwen3.6's CUDA tier | [cuda.md](docs/cuda.md), [qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md) |
+| Apple Silicon, Windows | [metal.md](docs/metal.md), [windows.md](docs/windows.md) |
+| Tuning, the learning cache, prefetch, speculation | [tuning.md](docs/tuning.md) |
+| Several SSDs, several machines | [multidisk.md](docs/multidisk.md), [cluster.md](docs/cluster.md) |
+| Benchmarks and how to measure | [benchmarks.md](docs/benchmarks.md), [benchmarking.md](docs/benchmarking.md) |
+| Every option and environment variable | [SETTINGS.md](docs/SETTINGS.md), [ENVIRONMENT.md](docs/ENVIRONMENT.md) |
+| Grammar-forced drafts, and the experimental embedding ABIs | [grammar-draft.md](docs/grammar-draft.md), [segment-runtime.md](docs/segment-runtime.md), [edge-runtime.md](docs/edge-runtime.md) |
## Repo layout
```
-Makefile root build/check entry point
+start-here.sh, START-HERE.bat the one-step setup (Linux and macOS, Windows)
+Makefile root build/check entry point
c/
-├── colibri.c GLM-5.2 engine (make glm)
-├── inkling.c Inkling engine (make inkling)
-├── kimi_k3.c Kimi K3 engine (make kimi_k3)
-├── glm53.c GLM-5.3-Flash engine (make glm53)
-├── deepseek_v4.c DeepSeek V4 Flash engine (make deepseek-v4)
-├── deepseek_v41.c DeepSeek V4.1 Flash engine (make deepseek_v41)
-├── mimo.c MiMo-V2.6 Flash and Pro engine (make mimo)
-├── qwen38.c Qwen3.8-Flash-Next engine (make qwen38)
-├── qwen36.c Qwen3.6, Qwen3-Coder, Qwen3.8-27B engine (make qwen36)
-├── olmoe.c OLMoE engine (make olmoe)
-├── qwenimage.c Qwen-Image-2.1 engine (make qwenimage)
+├── colibri.c GLM-5.2/5.3 engine (make glm)
+├── glm53.c GLM-5.3-Flash (make glm53)
+├── inkling.c Inkling (make inkling)
+├── kimi_k3.c Kimi K3 (make kimi_k3)
+├── deepseek_v4.c DeepSeek V4 Flash (make deepseek-v4)
+├── deepseek_v41.c DeepSeek V4.1 Flash (make deepseek_v41)
+├── mimo.c MiMo-V2.6 Flash and Pro (make mimo)
+├── qwen38.c Qwen3.8-Flash-Next (make qwen38)
+├── qwen36.c Qwen3.6, Qwen3-Coder, Qwen3.8-27B, Clef (make qwen36)
+├── olmoe.c OLMoE (make olmoe)
+├── qwenimage.c Qwen-Image-2.1 (make qwenimage)
+├── laya.c Laya (make laya)
+├── gliner_decide.c GLiNER2.5-Decide (make gliner_decide)
│
-├── st.h safetensors index and range reads
-├── quant.h canonical container decoders
-├── expert_ffn.h routed-expert FFN kernel shared by the MoE engines (planar int4, layer runner)
-├── tok.h, json.h tokenizer and JSON parser
-├── compat.h Windows/macOS shims (POSIX names, one place)
-├── expert_store.h streaming expert cache
-├── route_trace.h routing telemetry and .coli_usage, engine-agnostic
-├── kv_prefix.h KV prefix reuse across turns
+├── st.h, quant.h, idot.h safetensors reads, container decoders, integer kernels
+├── expert_ffn.h, expert_store.h routed-expert kernel and streaming expert cache
+├── tok.h, json.h, compat.h tokenizer, JSON, Windows/macOS shims
+├── route_trace.h, kv_prefix.h routing telemetry (.coli_usage), KV prefix reuse
+├── decide_serve.h the decision engines' side of System One
│
├── backend_cuda.* optional CUDA tier (CUDA=1)
├── backend_metal.* optional Metal tier (METAL=1)
-├── backend_vulkan.* optional Vulkan tier (VK=1)
+├── backend_vulkan.*, vk_tier.c, vk_chain.c optional Vulkan tier and dense chain (VK=1)
│
-├── Makefile build and local checks
├── coli user-facing CLI
-├── openai_server.py OpenAI-compatible HTTP gateway
-├── resource_plan.py RAM/VRAM planner behind `coli plan` and `coli doctor`
-├── tools/ offline conversion, fixtures and benchmarks
-├── scripts/ long-running conversion helpers
+├── setup_*.py the one-step setup: hardware, catalog, downloads, flow
+├── mcp_server.py the MCP server (coli mcp)
+├── openai_server.py OpenAI- and Anthropic-compatible HTTP gateway
+├── resource_plan.py RAM/VRAM planner behind coli plan and coli doctor
+├── tools/ conversion, fixtures and benchmarks
└── tests/ dependency-free C and Python tests
-web/ browser UI (pure OpenAI-API client)
-desktop/ Tauri v2 desktop shell wrapping the web UI
+web/ the dashboard (a pure API client)
+desktop/ Tauri desktop shell around the dashboard
docker/ container images
docs/ reference docs, experiments, media
+site/ the website
```
**One `.c` per model family, over shared single headers.** An engine owns its
-architecture and nothing else; anything two engines both need — the safetensors
-reader, the container decoders, the tokenizer, the expert cache — lives in a
-header they both include, so a fix reaches all of them at once. That rule is not
-decorative: the defects that keep recurring here are the ones where a mechanism
-landed in one engine and never reached its siblings.
+architecture and nothing else; anything two engines both need lives in a header
+they both include, so a fix reaches all of them at once. From the repository
+root, `make`, `make check` and `make clean` delegate to the engine Makefile.
+
+## Supporting the project
+
+colibri started as a one-person project on a 12-core laptop with 25 GB of RAM;
+today its numbers come from a community of real machines. If it is useful to
+you:
-From the repository root, `make`, `make check` and `make clean` delegate to the
-engine Makefile.
+- star the repository and share it;
+- open issues with benchmark numbers from your hardware: datapoints move this
+ project more than anything else;
+- join the [Discord community](https://discord.gg/RXV83nSZdk) to discuss
+ experiments, hardware results and research directions;
+- reach out through GitHub issues to sponsor development or donate hardware.
## Why "colibrì"
@@ -816,58 +683,15 @@ hummingbird rations: 25 GB of RAM, twelve CPU cores, and a lot of disk patience.
## Acknowledgements
-colibrì is an engine; the minds it runs are a gift. Thank you to the teams
-releasing frontier-class weights in the open — **Z.ai** (GLM), **Moonshot AI**
-(Kimi), **Alibaba Qwen**, **MiniMax**, and **Allen AI** (OLMoE) — and to every
-contributor who benchmarked, bisected, replicated an atlas run, or sent a patch.
-This project is proof of what open weights make possible.
-
-The project's expert placement, compression, and routing experiments also build
-on ideas and evidence from the following open research and systems work:
-
-- [REAP](https://github.com/CerebrasResearch/reap) and
- [EASY-EP](https://github.com/RUCAIBox/EASYEP) for output-aware and
- domain-specific expert importance.
-- [SERE](https://github.com/JL-Cheng/SERE) for similarity-based expert
- re-routing, and [ReMoE](https://github.com/BUAA-OSCAR/ReMoE) for
- cache-locality-aware router fine-tuning.
-- [MC-SMoE](https://github.com/UNITES-Lab/MC-SMoE) for routing-guided expert
- merging and compression.
-- [MoBE](https://github.com/inclusionAI/MoBE) and
- [D²-MoE](https://github.com/lliai/D2MoE) for shared expert bases and
- low-rank expert deltas.
-- [HybriMoE](https://github.com/PKU-SEC-Lab/HybriMoE) for hybrid CPU/GPU expert
- scheduling, [ScMoE](https://arxiv.org/abs/2404.05019) for overlapping expert
- communication with computation, and
- [OD-MoE](https://arxiv.org/abs/2512.03927) for distributed on-demand expert
- loading.
-- [vLLM](https://github.com/vllm-project/vllm),
- [llama.cpp](https://github.com/ggml-org/llama.cpp), and
- [kTransformers](https://github.com/kvcache-ai/ktransformers) for the open
- inference systems and expert-offload work that make comparisons reproducible.
-
-The engine also stands on concrete engineering work, not only ideas. Each of
-these is used or reimplemented in the tree today:
-
-- [safetensors](https://github.com/huggingface/safetensors) — the container
- every engine reads (`c/st.h`), including its fp8 and I64 dtypes.
-- [tiktoken](https://github.com/openai/tiktoken) — `c/tok.h` reimplements its
- `byte_pair_encode` exactly, merging the adjacent pair whose concatenation has
- the lowest vocab id, so a tiktoken-derived vocabulary needs no merges list.
-- [llama.cpp](https://github.com/ggml-org/llama.cpp) — the GBNF grammar subset
- in `c/grammar.h` follows its syntax and its set-of-stacks PDA, and the Metal
- path borrows its `newBufferWithBytesNoCopy` residency trick.
-- [vLLM](https://github.com/vllm-project/vllm) — the reference for output
- semantics the engine matches position by position (e.g. where the final norm
- lands relative to the LM head).
-- [transformers](https://github.com/huggingface/transformers) — the oracle:
- CI reproduces a random-init model token for token against it.
-- [DietGPU](https://github.com/facebookresearch/dietgpu) — the GPU ANS codec
- behind the experimental compressed expert tier (`COLI_ANS`).
-- [rocWMMA](https://github.com/ROCm/rocWMMA) — the HIP backend maps CUDA's
- `nvcuda::wmma` fragment/mma_sync API onto it (`c/backend_gpu_compat.h`), which
- is what lets one .cu source compile for both vendors.
+colibri is an engine; the minds it runs are a gift. Thank you to the teams who
+release their weights in the open: **Z.ai** (GLM), **Moonshot AI** (Kimi),
+**Alibaba Qwen**, **DeepSeek**, **Xiaomi** (MiMo), **Thinking Machines**
+(Inkling), **Allen AI** (OLMoE), **Convai Innovations** (Laya), **fastino**
+(GLiNER2.5-Decide) and **Cloudflare** (Clef); to the people who publish
+converted containers; and to every contributor who benchmarked, bisected,
+replicated an atlas run or sent a patch. Third-party code in this repository
+and its licences: [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
## License
-Apache 2.0, Copyright 2026 Vincenzo Fornaro. See [LICENSE](LICENSE) and [NOTICE](NOTICE). GLM-5.2 weights are released by Z.ai under MIT.
+Apache 2.0, Copyright 2026 Vincenzo Fornaro. See [LICENSE](LICENSE) and [NOTICE](NOTICE). Each model keeps the licence its authors gave it (GLM-5.2 weights are released by Z.ai under MIT; Qwen-Image-2.1 is for non-commercial use only).
diff --git a/README.zh-CN.md b/README.zh-CN.md
index e005f76a..7b7837c1 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -1,10 +1,10 @@
<p align="center">
- <img src="assets/colibri-logo.svg" width="560" alt="colibrì——小巧引擎,庞大模型">
+ <img src="assets/colibri-logo.svg" width="560" alt="colibrì:小巧引擎,庞大模型">
</p>
<p align="center">
- <a href="https://justvugg.github.io/colibri"><img src="https://img.shields.io/badge/website-justvugg.github.io%2Fcolibri-1f6feb" alt="Website"></a>
- <a href="https://github.com/JustVugg/colibri/releases"><img src="https://img.shields.io/github/v/release/JustVugg/colibri?color=2ea043" alt="Latest release"></a>
+ <a href="https://justvugg.github.io/colibri"><img src="https://img.shields.io/badge/website-justvugg.github.io%2Fcolibri-1f6feb" alt="网站"></a>
+ <a href="https://github.com/JustVugg/colibri/releases"><img src="https://img.shields.io/github/v/release/JustVugg/colibri?color=2ea043" alt="最新版本"></a>
</p>
<p align="center">
@@ -13,740 +13,447 @@
<a href="README.md">English</a> · 简体中文 · <a href="README.zh-TW.md">繁體中文</a> · <a href="README.it.md">Italiano</a> · <a href="README.ja.md">日本語</a>
</p>
-**小巧引擎,庞大模型。**在消费级与异构硬件上运行**前沿 MoE 模型——从 744B 到
-2.8T 参数**——以引擎零依赖的纯 C 实现,将存储、RAM 与 VRAM 视为统一的推理层级。
-
-目前可运行十个语言模型家族。这里按引擎计数,而不是按 checkpoint:各自一个 C 文件,
-共用同一套 `coli chat` / `coli serve` / `coli web` 前端,部分引擎可运行不止一个模型。
-**GLM-5.2/5.3**(744B)、**GLM-5.3-Flash**(321B,含视觉)、**Inkling**(975B)、
-**Kimi K3**(2.8T)、**DeepSeek V4 Flash**(284B)、**DeepSeek V4.1 Flash**(552B,含视觉)、
-**MiMo-V2.6 Flash**(309B,含视觉;同一引擎也运行 **MiMo-V2.6 Pro**,1.02T)、
-**Qwen3.8-Flash-Next**(125B + 51B n-gram)、**Qwen3.6**(35B-A3B;同一引擎也运行
-**Qwen3-Coder-30B-A3B** 与稠密的 **Qwen3.8-27B**,含视觉)以及 **OLMoE**(7B)。
-也能生成图像:第十一个引擎运行 **Qwen-Image-2.1**,根据文字生成图片,`coli chat` 直接在终端中显示,
-`coli serve` 通过 `POST /v1/images/generations` 提供([qwen-image.md](docs/qwen-image.md))。
-[完整列表 ↓](#other-supported-models)
-
-> **Colibrì 既是今天就能运行的推理引擎,也是一个开放的研究平台**。它的首要目标是在
-> 完整的软硬件边界上追求推理侧性能——模型格式、内存层级、存储 I/O、放置、调度、内核、
-> 推测解码以及 CPU/GPU 重叠执行——让大模型减少对稀缺硬件的依赖,并降低运行成本。
-
-Colibrì 将 VRAM、RAM 与存储视为统一的多层级结构,并刻意用于验证激进的系统思路,因此
-**对速度不作 SLA 承诺,对语义则给出硬性保证**:实验必须通过可复现的端到端测量证明价值;
-默认策略**绝不会在未告知的情况下改变模型精度或路由语义**。高速内存不足可以降低速度,
-但不能悄悄重新定义模型。
+**小巧引擎,庞大模型。** colibri 在你现有的机器上运行超大规模的开放模型。一个拥有数千亿参数的专家混合(mixture-of-experts,MoE)模型,每个 token 只会用到自身的一小部分,因此 colibri 把这一部分放在内存中,其余部分,也就是各个专家,则在模型需要时从磁盘读取。纯 C 实现,每个模型家族一个文件,不需要 GPU。
+
+目前有十三个引擎可以运行。其中十个用于语言模型:**GLM-5.2/5.3**、**GLM-5.3-Flash**、**Inkling**、**Kimi K3**、**DeepSeek V4 Flash**、**DeepSeek V4.1 Flash**、**MiMo-V2.6 Flash**(以及 Pro)、**Qwen3.8-Flash-Next**、**Qwen3.6**(它也能运行 Qwen3-Coder 和稠密的 Qwen3.8-27B)以及 **OLMoE**。一个用于生成图片:**Qwen-Image-2.1**。两个用于回答决策问题:**Laya** 和 **GLiNER2.5-Decide**,第三个决策模型 **Clef** 运行在 Qwen3.6 引擎上。[我的机器适合哪一个](#which-model-for-my-machine)
```
$ ./coli chat
- 🐦 colibri v1.12.1 — GLM-5.2 · 744B MoE · int4 · streaming CPU
+ colibri v1.12.1 · GLM-5.2 · 744B MoE · int4 · streaming CPU
✓ ready in 32s · resident 9.9 GB
› ciao!
- ◆ Ciao! 😊 Come posso aiutarti oggi?
+ ◆ Ciao! Come posso aiutarti oggi?
```
-## 实际运行效果
+<a id="get-started"></a>
+<a id="the-one-step-way"></a>
-<p align="center">
- <img src="docs/media/colibri-dashboard.png" width="900" alt="colibrì 网页仪表盘——实时指标、硬件面板与专家存储层级">
-</p>
-<p align="center"><em>网页仪表盘(<code>./coli web</code>),1.12.0 重新设计:一个工作区,底部停靠栏切换聊天、System One 模式、
-Brain 页面和性能分析,支持浅色与深色主题。图中是 Qwen3.6 在纯 CPU 机器上作答,专家从磁盘流式读取。</em></p>
+## 一步开始使用
-<p align="center">
- <img src="docs/media/colibri-brio.png" width="900" alt="System One 页面:文档只读一次,每个允许的答案各有一个概率,并给出熵">
-</p>
-<p align="center"><em><strong>System One 模式</strong>:同一个模型,只是不再让它写。给它一段文档和唯一允许的几个答案,
-它读出每个答案的概率,不生成任何 token,并给出一个熵,说明它何时没有把握。图中:<strong>request changes,99.9%</strong>,
-熵 0.005,读取 4 个 token,生成 0 个。</em></p>
+你需要一台内存至少 **8 GB** 的电脑(16 GB 或更多更好),磁盘上要有 **22 GB 可用空间**来放最小的模型,还需要网络连接。显卡是可选的。
-<p align="center">
- <img src="docs/media/colibri-brain.png" width="900" alt="大脑页面:GLM-5.2 的实测专家图谱绘成一块皮层,十个可进入的区域">
-</p>
-<p align="center"><em><strong>大脑(Brain)</strong>页面的 <strong>Explore</strong> 视图:将 GLM-5.2 的<a href="https://github.com/JustVugg/colibri/issues/175">实测专家图谱</a>绘成一块皮层。
-13,260 个已分析专家分为十个区域(Python、SQL、数学、诗歌、法律、中文……);位置取自实测路由亲和度,而非学习出的嵌入向量。
-选择一个区域即可进入。<strong>Live routing</strong> 视图切换到正在运行的模型:每个专家一格,颜色代表存储层级,每轮被路由到的专家都会闪白。</em></p>
+**Windows**
-<p align="center">
- <img src="docs/media/colibri-brain-region.png" width="900" alt="Python 区域内部:1,142 个专家,其中一个被选中并显示其实测亲和度">
-</p>
-<p align="center"><em><strong>Python</strong> 区域内部:1,142 个专家组成的星座,每个都标注了层号和序号。面板显示其中一个:第 17 层第 178 号专家,
-一个熵为 3.13 的通才,其实测亲和度为 Python 20.2%、JSON 14.6%、对话 14.2%、SQL 13.3%。</em></p>
+1. 在本页面点击 **Code**,再点击 **Download ZIP**,然后解压。
+2. 在解压后的文件夹中双击 **`START-HERE.bat`**。如果电脑上没有 Python,它会提出帮你安装。
-<p align="center">
- <img src="docs/media/colibri-profiling.png" width="900" alt="性能剖析页面:引擎在每一轮中的时间去向">
-</p>
-<p align="center"><em><strong>性能剖析(Profiling)</strong>页面:引擎在每一轮中的时间去向,按阶段划分,并以最近 30 轮作为趋势。
-此处为 CPU 机器上的 Qwen3.6:36 个提示词元与 55 个生成词元共用时 19.0 秒,2.9 tok/s,其中 11.4 秒的磁盘服务与计算重叠。</em></p>
+**Linux**(Ubuntu 和 Debian;其他发行版也有同样的软件包,只是名称不同)
-## 研究使命
+```bash
+sudo apt install git python3 build-essential
+git clone https://github.com/JustVugg/colibri
+cd colibri
+./start-here.sh
+```
+
+**macOS**(需要 [Homebrew](https://brew.sh))
+
+```bash
+xcode-select --install
+brew install libomp git python
+git clone https://github.com/JustVugg/colibri
+cd colibri
+./start-here.sh
+```
-有了 Colibrì,私有部署的前沿模型不再受限于能否获得超大规模云厂商级别的硬件。
+你只需要回答一个问题:用哪个模型,直接按回车就采用推荐。然后安装程序会:
-凭借多层级(multitiering)特性,Colibrì **通过积极优化推理引擎的各条功能流水线,消除对专有硬件的依赖**。
+1. **检查你的机器**:内存、磁盘可用空间、CPU 和 GPU;
+2. **推荐一个装得下的模型**:模型中始终留在内存里的部分,加上最小的专家缓存,必须放得进你的内存,下载的文件必须放得进你的磁盘;
+3. **获取引擎**:如果机器上有编译器,就为你的机器编译引擎,否则下载预编译版本,该版本在 CPU 上运行。在值得的时候,它会为你的 GPU 编译:Linux 上的 NVIDIA 显卡在装有 CUDA toolkit 时用 CUDA,否则用 Vulkan。在独立显卡上总是这样做;集成显卡与 CPU 共用内存,只有实测在集成显卡上更快的模型(Qwen3.6、Qwen3-Coder 和 Qwen3.8-Flash-Next)才会这样做。如果缺少某个软件包,它会打印出安装该软件包的确切命令,并继续使用 CPU;之后再运行一次安装程序,它就会为 GPU 重新编译;
+4. **下载模型**,显示进度并支持断点续传:随时可以中断,再次运行就会从中断的地方继续;
+5. **启动 colibri,并在浏览器中打开仪表盘**,同时打印出其他应用可以使用的地址:
-我们的具体使命包括:改变权重的表示与移动方式,决定哪些内容常驻 VRAM、RAM 或存储,重叠异构计算,
-降低启动与同步开销,利用稀疏性与复用,并验证新的解码算法。传统做法不是免责理由,
-微基准快也不是采用理由;最终依据是在真实机器上的端到端推理,同时测量正确性、质量、
-吞吐、延迟、内存与成本。
+```
+Starting colibri
+ Browser: http://127.0.0.1:8000/
+ OpenAI base URL: http://127.0.0.1:8000/v1
+ Anthropic base URL: http://127.0.0.1:8000
+ stop: press Ctrl+C here (or close this window)
+```
+
+**下次使用时**,再次运行 `START-HERE.bat` 或 `./start-here.sh` 即可:colibri 会直接启动,不再下载,也不再编译。`c/coli status` 显示安装了什么以及它是否在运行,`c/coli stop` 用来停止它(Windows 上为 `c\coli.cmd status` 和 `c\coli.cmd stop`)。
-它带来的实际结果是**可及性**:在已有硬件上运行 744B 模型,实时观察每个专家,并直接修改实现。
-不是从 API 租用智能,而是*持有*它:探测、测量和改进它。引擎刻意保持足够小,让任何愿意测量
-的人都可能贡献下一项有效优化。
+选项写在 `./start-here.sh` 或 `START-HERE.bat` 后面:
-## 核心技术与实测结论
+| 选项 | 作用 |
+|---|---|
+| `--list` | 列出所有模型与这台机器的对照,以及某个模型为什么装不下 |
+| `--model ID` | 安装指定的模型(id 见[下面的表格](#which-model-for-my-machine)) |
+| `--yes` | 不提问:直接采用推荐 |
+| `--dir DIR` | 把模型放到另一块磁盘上(默认 `~/colibri-models`) |
+| `--backend vulkan`、`cuda` 或 `cpu` | 自己选择引擎的构建版本;`--no-gpu` 等同于 `--backend cpu` |
+| `--model-dir DIR` | 使用你已经下载好的模型 |
+| `--reconfigure` | 换一个模型 |
-- **统一层级,不受单一层级容量限制**。VRAM、RAM 与 NVMe 是同一份权重的不同放置层级;
- 高速内存不足只影响速度,不改变模型语义。
-- **权重的 JIT**。实测路由热度驱动逐层 LRU、学习型热门专家固定区和提前一层的预取,
- 无需加载所有专家。它在可重复负载上有收益,但历史可能过拟合,预取在部分主机上也可能
- 负优化,因此它们是需要测量的策略,不是性能承诺。
-- **I/O 本身就是引擎的一部分**。专家批次并集、读算重叠、`O_DIRECT` 与加权双 SSD
- 分流直接优化流式路径,而不是假装存储延迟不存在。`O_DIRECT` 取决于磁盘,双 SSD
- 仍需要更多社区端到端 A/B。
-- **异构执行**。CPU、CUDA、Metal、NUMA 内存以及专家的部分或全部常驻共用一个运行时,
- 可按机器条件组合;最佳组合取决于算力、带宽、驻留率与负载。
-- **压缩状态,不篡改模型**。逐 token 精确的前向验证、缩小 57 倍的 MLA KV 状态、
- 持久化热会话与忠实 DSA,让优化始终受正确性约束。这些是内存、延迟和正确性属性,
- 不是笼统的吞吐承诺。
-- **必须证明收益的推测解码**。原生 MTP 与语法强制草稿均接受端到端测量;
- 接受率无法覆盖验证成本时可以关闭。
+每一步的详细说明:[docs/quickstart.md](docs/quickstart.md#the-one-step-way)。
-## 开放猜想、实验与参与方式
+### 如果出了问题
-在受控的端到端 A/B 证明之前,Colibrì 将每项优化都视为猜想。当前主要问题如下:
+| 你看到的情况 | 怎么办 |
+|---|---|
+| 下载过程中停止了 | 再次运行同一条命令:它会从磁盘上已有的字节处继续 |
+| `to use the GPU through ..., first run: <command>` | 运行这条命令,然后再运行一次安装程序:它会为 GPU 重新编译,不会重新下载 |
+| 用 CUDA 编译时出现 `the ... build failed`,例如已安装的 CUDA toolkit 不再支持这张显卡时出现的 `Unsupported gpu architecture` | `./start-here.sh --backend vulkan` 通过 Vulkan 使用这张显卡;`--no-gpu` 则只使用 CPU |
+| `needs N GB free for the download` | 用 `--dir` 指定一个更大磁盘上的文件夹 |
+| 在 WSL 中,模型文件夹位于 `/mnt/c` 下 | 把它放在 Linux 磁盘上(即默认的 `~/colibri-models`):`/mnt/c` 要慢很多倍 |
+| 其他情况 | `c/coli logs -n 50` 显示服务器日志,`c/coli logs --install` 显示安装程序的日志;提交一个 [issue](https://github.com/JustVugg/colibri/issues),附上安装程序最后打印的几行 |
-| 猜想 | 当前证据 | 仍需完成的实验 |
-|---|---|---|
-| 路由历史能比普通 LRU 更好地放置专家 | 学习型固定区能改善重复负载,但也会对 prompt 过拟合 | 在代码、对话、多语言和长上下文负载上做留出集、跨会话 A/B |
-| 多块 SSD 能将独立带宽转化为解码速度 | 两块独立 NVMe 实测解码 +37.5%;经加权分流后,较慢的第三块盘影响持平([测量数据](docs/multidisk.md#what-has-been-measured)) | 在不同磁盘速度、控制器布局与缓存状态下复现 |
-| 硬件感知规划器能自动接近每台机器的最优配置 | 当前已检测 RAM/VRAM 预算与多个后端 | 将自动方案与参数扫描对比,覆盖笔记本、工作站、NUMA 和多 GPU 主机 |
-| 无损或质量受控的表示能充分减少权重搬运 | 已有格式与量化消融,并设置正确性/质量门槛 | 同时复现质量、搬运字节、延迟和每个有效 token 成本,而非只看压缩率 |
-| 路由感知推测能在接近全驻留前盈利 | MTP 与语法草稿可用,但 MTP 在约 85% expert hit 时也实测过 -32% | 绘制接受率、命中率、批次并集与草稿深度的盈亏边界 |
-| CPU/GPU 重叠能隐藏传输与同步,而非仅转移瓶颈 | CUDA 与 Metal 有成功数据,但强 CPU 和低驻留率会抹平收益 | 在 PCIe、统一内存与全驻留机器上做逐阶段 profile 和单变量 A/B |
+### 让 AI 助手帮你安装
-想参与就任选一行,负结果也请公开。请记录硬件、commit、模型容器、完整命令、prompt、
-缓存状态、吞吐、TTFT、expert hit、读取字节数与质量检查;每次只改一个变量,重复运行并附上
-原始日志。先阅读 [CONTRIBUTING.md](CONTRIBUTING.md),对照
-[benchmark 协议](docs/benchmarking.md),然后
-[创建实验 issue](https://github.com/JustVugg/colibri/issues/new)。
-在这里,一个受控的失败比一个无法解释的高数字更有价值。
+如果你在用 AI 编程助手,它可以替你完成以上所有步骤。这样告诉它:
-## 核心概念
+> 按照 https://github.com/JustVugg/colibri 中的 docs/AI_SETUP.md,在这台机器上安装 colibri
-744B 的专家混合(Mixture-of-Experts)模型,每个 token 只会激活约 40B 参数——
-其中每个 token 之间会变动的只有约 11 GB(被路由到的专家):
+[docs/AI_SETUP.md](docs/AI_SETUP.md) 把每一步都写成一条命令,并给出机器可读的结果,还要求助手在下载模型或安装系统软件包之前先征求你的同意。支持 Model Context Protocol 的助手也可以改用 colibri 的 MCP 服务器:`coli mcp` 提供检测硬件、推荐模型、安装、启动、停止和检查的工具([docs/MCP_SERVER.md](docs/MCP_SERVER.md))。
+
+### 或者手动安装
+
+如果想自己决定每一步(用预编译的发布版还是从源码编译,从下面的表格中选哪个模型,然后用 `coli chat`、`coli web` 还是 `coli serve`),请看[手动安装](#install-by-hand),或者查看按平台逐步说明的 [Quick Start 指南](docs/quickstart.md)。
+
+## colibri 是什么,为什么做它
+
+专家混合模型在磁盘上很大,但每个 token 用到的部分很小。GLM-5.2 有 744B 参数,每个 token 用到约 40B,而其中在 token 之间会变化的只有约 11 GB:也就是被路由到的专家。
<p align="center">
- <img src="docs/media/sparse.png" width="880" alt="每个 token 只会激活约 5.4% 的参数">
+ <img src="docs/media/sparse.png" width="880" alt="每个 token 只激活约 5.4% 的参数">
</p>
-所以模型不必完整**装进**高速内存,而是需要正确**放置**:
+所以模型不必完整装进高速内存,而是需要被正确地**放置**。稠密部分(注意力、共享专家、嵌入)留在内存中。路由专家留在磁盘上,在路由器需要时读取,中间经过一个缓存,它会学习你的工作用到哪些专家。如果有 GPU,它会保存最热的专家和稠密层。权重放在哪里,只改变回答出来的速度,不改变由哪些权重、哪些路由决策产生这个回答。
-- **稠密部分**(注意力、共享专家、嵌入——约 17B 参数)以 int4
- **常驻 RAM**(约 9.9 GB);
-- **19,456 个路由专家**(75 个 MoE 层 × 256,加上 MTP head;每个在 int4 下约 19 MB)
- **存放在磁盘**(约 370 GB),并**按需流式加载**,配合逐层 LRU 缓存、
- 会学习的热门专家固定存储区,以及可选的 VRAM 层级。
+为什么做它:为了在人们已有的硬件上运行这种规模的模型,为了看着它们工作(仪表盘会显示每一个被激活的专家),也为了让引擎保持足够小,让任何人都能测量它、把它变得更快。colibri 也是一个开放的研究平台:一项优化要靠可复现的端到端测量才能被采纳,默认策略绝不会在不告知的情况下改变模型精度或路由语义。高速内存少了,可以慢一些;但不能悄悄地重新定义模型。详见[工作原理](#how-it-works)。
-可以把核心算法理解为**权重的 JIT**。编译器的 JIT 从不编译整个程序:它观察实际运行的部分,
-及时编译热点路径。colibrì 对 744B 的参数空间下了同样的赌注:参数不是需要一直持有的常驻状态,
-而是**需要分级调度的数据**,在路由器证明需要它们的那一刻,于异构存储层级(VRAM / RAM / NVMe)
-之间就位。实测路由热度决定哪些专家进入哪一层级,路由器提前一层运行,让预取隐藏调度延迟;
-而且像 JIT 一样,引擎会学习你的工作负载:运行得越多,正确的专家就越热。之所以可行,是因为
-路由具有可测量的结构(见[专家图谱](https://github.com/JustVugg/colibri/issues/175)),
-而结构是可以缓存的。
+<a id="which-model-for-my-machine"></a>
-引擎是一个 C 主文件(`c/colibri.c`)加上若干头文件。不需要 BLAS,
-运行时不需要 Python,也不需要 GPU。
+## 我的机器适合哪个模型
-### 本地集群模式
+安装程序会推荐能在你的机器上完全从内存运行的最强模型,并在它下面列出从磁盘流式读取的更大模型。`./start-here.sh --list` 会把所有模型与你的机器逐一对照。下面的表格与安装程序自己的目录([`c/setup_catalog.py`](c/setup_catalog.py))一致;下载大小是 Hugging Face 为每个仓库列出的大小。
-协调节点(coordinator)在本地保留 token 生成、路由与 KV 状态,而以磁盘为后端的专家 worker
-在其他 Mac 上执行被路由的 FFN。一层的路由批量并集作为一个持久 TCP 请求发送,因此一个 token
-不会为每个专家各付出一次往返。
+- **内存**一栏是两个数字:低于第一个数字时模型无法启动,达到第二个数字时,它的运行速度与实测一致。
+- **GPU** 一栏是安装程序能为该引擎编译的 GPU 版本([GPU](#gpus))。*含集成显卡*表示它也会使用集成显卡,这些引擎在集成显卡上实测更快;其他引擎只使用独立显卡。
+- **实测**一栏是在所注明的机器上计时得到的结果,对聊天模型而言是解码速度。字母代表表格下方列出的机器。空白表示还没有人测过。
-启动可选的注册服务:
+**小模型,完全在内存中运行**
-```bash
-./coli cluster coordinator --host 0.0.0.0 --port 8765
-```
+| 模型 | `--model` | 下载大小 | 内存 | GPU | 实测 |
+|---|---|---|---|---|---|
+| **Qwen3.6-35B-A3B**:聊天,支持思考和工具调用 | `qwen36-35b` | 23 GB | 10 / 20 GB | CUDA、Vulkan(含集成显卡) | CPU 上 6.0 tok/s,在集成显卡上用 Vulkan 9.9(A);用 CUDA 30.0(C) |
+| Qwen3-Coder-30B-A3B:写代码和工具调用,不带思考 | `qwen3-coder-30b` | 19 GB | 8 / 18 GB | CUDA、Vulkan(含集成显卡) | 全部专家都在内存中时 8.5-9.6 tok/s,每层 32 个时 5.1(A,CPU) |
+| **Qwen-Image-2.1**:文生图,非商业许可 | `qwen-image-2.1` | 33 GB | 12 / 18 GB | Vulkan | 一张 768x512 的图片用时 2 分 40 秒(8 个 Zen 4 核心,CPU) |
-在每个 worker 上,本地需有同一个已转换的模型:
+**大模型,专家从磁盘流式读取**(速度由磁盘决定:快速的 NVMe 硬盘帮助最大)
-```bash
-./coli cluster worker --model /nvme/glm52_i4 --port 9100 \
- --coordinator http://COORDINATOR:8765 --advertise-host WORKER_IP
-```
+| 模型 | `--model` | 下载大小 | 内存 | GPU | 实测 |
+|---|---|---|---|---|---|
+| DeepSeek V4 Flash REAP 150B:保留 256 个专家中的 132 个 | `deepseek-v4-flash-reap` | 85 GB | 16 / 32 GB | CUDA、Vulkan | |
+| **DeepSeek V4 Flash**(284B):工具调用 | `deepseek-v4-flash` | 167 GB | 16 / 32 GB | CUDA、Vulkan | 32 GB 时 0.93 tok/s(Ryzen 7 5800X),63 GB 时 1.24(Ryzen 9 5950X),仅用 CPU;用 CUDA 1.5-1.6(RTX 5080,32 GB,两块 NVMe) |
+| **MiMo-V2.6 Flash**(309B):视觉和工具调用 | `mimo-v2.6-flash` | 172 GB | 32 / 52 GB | Vulkan | 2.34-3.37 tok/s(A,CPU) |
+| **Qwen3.8-Flash-Next**(125B + 51B n-gram):视觉和工具调用 | `qwen38-flash-next` | 186 GB | 24 / 32 GB | CUDA、Vulkan(含集成显卡) | 每层 32-96 个专家时 1.91-2.56 tok/s;使用可选的 int4 专家时 3.99(A,CPU) |
+| **GLM-5.2**(744B):参考模型,带 MTP head | `glm-5.2` | 429 GB | 16 / 24 GB | CUDA、Vulkan | 25 GB 笔记本上冷启动 0.05-0.1 tok/s;128 GB 的 Ryzen AI Max+ 395 上 1.83;6x RTX 5090 上 9.0-9.2 |
+| GLM-5.3(744B):同一个引擎,没有 MTP head | `glm-5.3` | 419 GB | 16 / 24 GB | CUDA、Vulkan | |
+| **Inkling**(975B):int4 专家,bf16 稠密权重 | `inkling` | 514 GB | 按下载格式为 120 / 128 GB;经过[稠密部分转换](docs/inkling.md)后为 25 GB | CUDA、Vulkan | 0.25 tok/s(Ryzen 9 7900,187 GB,RTX A6000) |
+| MiMo-V2.6 Pro(1.02T):视觉和工具调用 | `mimo-v2.6-pro` | 564 GB | 54 / 64 GB | Vulkan | 0.66-0.79 tok/s(A,CPU) |
+| **Kimi K3**(2.8T):最大的模型 | `kimi-k3` | 1.56 TB | 32 / 64 GB | CUDA、Vulkan | 每个 token 约 9.4 秒,专家读取速度为 6.3 GB/s |
-以发现模式运行协调节点,或为静态部署提供 `--cluster-workers
-HOST:PORT,...`:
+<a id="other-supported-models"></a>
-```bash
-./coli serve --model /nvme/glm52_i4 \
- --cluster-coordinator http://127.0.0.1:8765
-```
+**手动安装:下载后还需要一步转换或准备**
-除非配置了 worker,否则传输层保持关闭,现有的单机路径不受影响。稠密层分片与
-浏览器/WebGPU worker 是另行跟进的扩展点。
+| 模型 | 下载大小,以及之后在磁盘上的大小 | 内存 | GPU | 实测 |
+|---|---|---|---|---|
+| **OLMoE**(7B):小模型,适合用来熟悉工具 | 14 GB,转换为 int8 后为 7 GB | 8 GB | Vulkan | 22-23 tok/s(A,CPU) |
+| Qwen3.8-27B(稠密):文本和图像 | 56 GB,转换后为 51 GB | int4 时 20 GB,int8 时 30 GB | Vulkan | int4 时 3.45 tok/s,int8 时 2.1(16 线程 CPU 服务器) |
+| **GLM-5.3-Flash**(321B):视觉和工具调用 | 328 GB,逐个 shard 转换为 195 GB | 25 GB | CUDA、Vulkan | 热缓存时每个 token 约 20 秒,冷启动 44 秒(6 核心,25 GB,普通磁盘) |
+| **DeepSeek V4.1 Flash**(552B):视觉和工具调用,无需转换,但需要一次性准备 | 510 GB | 约 18 GB,再加上专家缓存(每层 8 个时峰值 24.8 GB) | Vulkan | 0.21-0.24 tok/s(16 线程 CPU 服务器,容纳 68% 的专家) |
-## 工作原理
+**决策模型**(它们回答 [System One](#system-one-a-decision-with-a-probability) 问题,不用于聊天)
-### 每个 token 的处理路径
+| 模型 | 下载大小,以及之后在磁盘上的大小 | 内存 | GPU | 实测 |
+|---|---|---|---|---|
+| **Laya**(Convai Innovations),英语 | 0.85 GB | 1.7 GB | CPU | 一个问题 219 ms,三个问题 882 ms(B) |
+| **GLiNER2.5-Decide**(fastino),英语 | 1.95 GB | 1.9 GB | CPU | 一个问题 294 ms,三个问题 897 ms(B,有负载时) |
+| **Clef**(Cloudflare):带决策头的 Qwen3.8-27B,也能聊天 | 55 GB,转换后为 52 GB | 从 int4 的 19 GB 到 f16 的 55 GB | CPU | int8 时每个请求 20.4 秒(A) |
-<p align="center">
- <img src="docs/media/token-path.png" width="880" alt="路由 → 并集 → 放置 → 重叠执行 → 学习">
-</p>
+机器:**A** 是一台 Ryzen 7 PRO 8700GE 台式机(8 核心,61-64 GB DDR5,NVMe,集成显卡 Radeon 780M);**B** 是一台 i7-1355U 笔记本;**C** 是 Threadripper 3945WX 主机中的一张 RTX 3070 8 GB,稠密层和 DeltaNet 层都放在显卡上(per-row int4 容器)。每个数字都来自 [docs/](docs/) 中对应模型的页面或[基准测试表格](docs/benchmarks.md),其中写明了确切的设置。
-每个 token 的每一层都会经过相同的五个步骤。设计目标是让
-**放置只决定速度**——无论专家是从 VRAM 还是磁盘响应,路由器的决策与权重精度都完全相同。
+每个家族都有自己的页面:[qwen36.md](docs/qwen36.md)(Qwen3.6、Qwen3-Coder、Qwen3.8-27B)、[qwen38.md](docs/qwen38.md)、[deepseek-v4.md](docs/deepseek-v4.md)、[deepseek-v41.md](docs/deepseek-v41.md)、[mimo.md](docs/mimo.md)、[glm53-flash.md](docs/glm53-flash.md)、[inkling.md](docs/inkling.md)、[kimi_k3.md](docs/kimi_k3.md)、[qwen-image.md](docs/qwen-image.md)、[laya.md](docs/laya.md)、[gliner_decide.md](docs/gliner_decide.md)、[clef.md](docs/clef.md),GLM-5.2 则见 [Quick Start](docs/quickstart.md#3-get-the-model)。与已支持模型架构相同的 checkpoint,例如运行在 Qwen3.6 引擎上的 KAT-Coder v2.5,无需任何修改即可运行。
-### 统一内存层级,取代单一内存门槛
+<a id="gpus"></a>
-<p align="center">
- <img src="docs/media/tiers.png" width="880" alt="VRAM/RAM/NVMe 三层专家常驻架构">
-</p>
+## GPU
-<a id="dual-ssd-two-copies-of-the-model-twice-the-read-bandwidth"></a>
+### 不需要 GPU
-### 多块 SSD:从不止一块盘流式读取模型副本
+每个引擎都能在 CPU 上运行,无需安装任何其他东西。GPU 只是一个存放权重的更快的地方,而不是必要条件:大模型的速度由磁盘决定,小模型的速度由内存决定。
-当解码受磁盘限制时,**第二块 SSD** 会有帮助:在上面放一份模型副本,让引擎同时从两块盘读取。
-以 GLM-5.2 为例,在源码 checkout 的 `c/` 目录下(或在解压后的发布包中):
+### Vulkan:任意 GPU
-```bash
-COLI_MODEL_MIRROR=/second/glm52_i4 python3 ./coli chat --model /fast/glm52_i4
-```
+每个 MoE 引擎都能以两种方式使用任何具有 Vulkan 1.2 驱动的 GPU(AMD、Intel、NVIDIA,集成显卡或独立显卡均可):
-引擎会在启动时测量各块盘,以确定读取分配的权重。缓冲读取采用确定性的专家路由;符合条件的
-直接读取可以把一个专家条带化分布到多个副本上。独立的磁盘提供的是带宽余量,而不是有保证的
-token 速率倍数:共享控制器、缓存命中与计算都可能限制收益。Bash 与 PowerShell 示例、实测收益
-与限制,以及与单盘的对比,见[多磁盘指南](docs/multidisk.md)。值得了解的细节:
+- **专家层级**:GPU 显存中的一个路由专家缓存,启动时根据你过去对话用到的专家来填充,并在你聊天的过程中不断调整。GPU 计算它所持有的专家,同时 CPU 计算其余的专家;
+- **稠密链**:把整个层记录为一次 GPU 提交,模型的运行状态从一层到下一层都保留在 GPU 上。
-- 镜像会在**启动时校验**(每个文件的大小与 safetensors 头必须与主副本逐字节一致);不一致或缺失的文件仍由主副本提供,因此**部分镜像也可以**:较小的第二块 SSD 可以提供它所持有的 shard;
-- 镜像**从不写入**:`.coli_usage`、`.coli_kv` 与所有 sidecar 都保留在主副本上;
-- 镜像读取出错时会回退到主副本(一条警告,不会崩溃),因此运行中拔掉第二块盘只会降级,不会让服务器退出;
-- 路由从不改变 token:两份副本逐字节相同;启用 `PROF=1` 可看到 `MIRROR:` 性能计数器,显示每块盘提供了多少 GB。
+在机器 A 的集成显卡 Radeon 780M 上实测,每次运行前都把模型文件从页缓存中清除,解码 100 个 token([vulkan.md](docs/vulkan.md#the-chain-on-a-radeon-780m)):
-同一套引擎覆盖完整硬件范围:在 25 GB 笔记本上,一切都从磁盘流式加载
-(慢,但结果正确);在大内存主机上,则可让整组专家常驻
-(`CUDA_EXPERT_GB=auto PIN_GB=all`),让磁盘完全退出解码路径。
-两端之间有一层**学习型缓存**:引擎会记录*你的*工作负载路由到哪些专家
-(`.coli_usage`,每轮更新),并自动固定最热门的专家——colibrì 确实会越用越快。
-在多路主机上,`COLI_NUMA=1` 会将常驻权重交错分配到各内存控制器
-([#82](https://github.com/JustVugg/colibri/issues/82))。
+| | CPU | Vulkan,专家层级 | Vulkan,专家层级加稠密链 |
+|---|---|---|---|
+| Qwen3.6-35B-A3B,解码 | 6.0 tok/s | 8.0 tok/s | **9.9 tok/s** |
+| Qwen3.6-35B-A3B,512 个 token 的提示词 | 35.7 秒 | 12.2 秒 | **9.5 秒** |
+| Qwen3.8-Flash-Next(int4 专家),解码 | 3.5 tok/s | **3.8 tok/s** | 3.2 tok/s |
+| Qwen3.8-Flash-Next,512 个 token 的提示词 | 43.6 秒 | 38.7 秒 | **30.1 秒** |
+| OLMoE,解码(热缓存) | **23.1 tok/s** | 12.8 tok/s | 17.3 tok/s |
-对于装不下整个模型的第二块盘,Colibri 可以根据它已经学到的专家历史,为部分镜像排序。
-先运行几个有代表性的 prompt,让 `.coli_usage` 反映实际负载,然后规划、暂存并校验镜像:
+集成显卡与 CPU 共用内存。它节省的是它所持有的那些专家的计算量和磁盘读取,因此在 Qwen3.6 这样的模型上有收益,而像 OLMoE 这样专家本来就在内存中的小模型,反而可能变慢。正因如此,安装程序只为 Qwen3.6、Qwen3-Coder 和 Qwen3.8-Flash-Next 在集成显卡上开启 Vulkan,并且每个引擎自行决定是否在集成显卡上运行稠密链(Qwen3.6 会,Qwen3.8 不会)。`--backend vulkan` 则无论如何都会使用 Vulkan。
-```bash
-./c/coli mirror plan --model /fast/glm52_i4 --mirror /second/glm52_i4 \
- --budget-gib 200 --reserve-gib 20
-./c/coli mirror stage --model /fast/glm52_i4 --mirror /second/glm52_i4 \
- --budget-gib 200 --reserve-gib 20
-./c/coli mirror verify --model /fast/glm52_i4 --mirror /second/glm52_i4
-```
+在独立显卡上,安装程序会为每个引擎编译 Vulkan 版本(如果引擎有 CUDA 路径且装有 toolkit,则优先使用 CUDA),并把稠密层放在显卡上。这正是该设计所针对的情形,但它**尚未实测:还没有任何独立显卡运行过专家层级或稠密链。**(在它们之前,GLM-5.2 较早的 Vulkan 路径在独立显卡 RX 9070 上的解码速度为 1.7-1.8 tok/s。)欢迎提供你的显卡上的数据。
-规划器直接读取 safetensors 头,跟随 `COLI_MODEL_DIRS` 中的分割模型目录,并优先选择能服务
-最热路由专家的 shard。暂存从不改动主模型:它经由临时文件复制,保留所要求的剩余空间,
-用 SHA-256 校验每个 shard,从不删除已有的镜像 shard,并且只在所选镜像就绪后才以原子方式
-发布回执。
-
-### 绝不为同一次磁盘读取等待两遍
-
-缓存未命中的代价很高,因此引擎大部分的巧思都用来避免或重叠这些读取:
-每个专家的三个矩阵相邻存储,并以一次 `pread` 读取;有界异步 I/O 池
-(`PIPE=1`,默认启用)会在常驻专家计算时加载缺失的专家;批量位置只读取每个
-不重复专家一次(**批量并集**);路由前瞻线程(`PILOT=1`)则预取下一层专家——
-实测显示,路由结果提前一层时有 **71.6% 的可预测性**。
-在 GPU 上,常驻管线(`COLI_CUDA_PIPE=2`)让残差流跨层保留在设备端,
-使 CPU 专家循环不中断;在 Apple Silicon 上,实验性的
-[Metal 后端](docs/metal.md)会用统一内存 GPU 执行批量专家运算;
-[Vulkan 后端](docs/vulkan.md)则把专家层级、稠密投影与 MLA 注意力核心带到任何具有
-Vulkan 1.2 驱动的 GPU 上,包括通过 Mesa/RADV 的 AMD 显卡(对于厂商软件栈已不再支持的显卡,
-例如 RX 580,它是唯一的后端;在 RDNA4 上与 ROCm 不相上下,见[基准测试说明](docs/vulkan.md))。
-其余所有引擎现在也会在 `VK=1` 构建中通过 `COLI_VULKAN=1` 使用同一后端放置常驻矩阵;
-CI 会将其与 CPU 的 token 对照检查,但在它们首次实测的真实 GPU(集成显卡 Radeon 780M)上,
-目前比 CPU 慢([其他引擎](docs/vulkan.md#the-other-engines))。
-
-> **在真实 NVMe 上,请实测 `DIRECT=1`。** O_DIRECT 绕过页缓存,在带 DRAM 缓存且带宽有余量
-> 的磁盘上往往有显著收益(在一台 Blackwell/Windows 机器上配合 `PIPE=1` 实测解码 +34%;
-> 在 GB10 上 iobench 为 4.25→9.69 GB/s),但它取决于磁盘:QLC/无 DRAM 或虚拟化的磁盘
-> 可能没有收益甚至变慢。先试一试,保留你的硬件真正受益的设置。
-
-### 忠实模型,压缩状态
-
-前向传播已通过 `transformers` oracle 验证(teacher-forcing 通常为 30-32/32;
-tiny oracle 中有两个位置是浮点数近似平局,结果取决于工具链)。MLA 注意力存储压缩后的
-KV 状态(每个 token 为 576 个浮点数,而非 32,768 个,**缩小 57×**),并跨重启持久保存
-(`.coli_kv`):对话可暖启恢复,不需重新 prefill,结果与不中断的会话
-逐字节相同。DSA 稀疏注意力(GLM-5.2 的 lightning indexer)已忠实实现,
-并通过强制选取所有 key,验证可精确复现稠密注意力。
-
-### 诚实的推测解码
-
-GLM-5.2 原生 MTP head 会起草 token,再由主模型以一次批量前向传播验证——
-条件合适时每次 forward 可产生 2.2–2.8 个 token。两条来之不易的规则已成为默认值:
-MTP head 必须是 **int8**(int4 head 的接受率会崩塌到 0–4%,见
-[#8](https://github.com/JustVugg/colibri/issues/8)),且草稿与验证必须计算
-**相同函数**——`SPEC_PIN=1` 会把两者固定在同一 kernel family
-(完整取证过程见 [#163](https://github.com/JustVugg/colibri/issues/163))。
-语法强制草稿([`GRAMMAR=file.gbnf`](docs/grammar-draft.md))可在受限 JSON 输出中,
-以近乎免费的代价提高接受率。推测解码是否带来净收益取决于缓存热度——请实测,
-若不划算就使用 `DRAFT=0`。
-
-验证批次还可以通过 `COLI_EXACT_VERIFY=1` 选用**精确注意力核心**
-([#689](https://github.com/JustVugg/colibri/issues/689)):CPU 上 MLA-absorb 的 score 与
-context 点积改为累加整数乘积并只舍入一次,因此验证行中的近似平局在每台主机上都会得到相同的
-结果;在 tiny oracle 上速度约为 0.6x tok/s(点积本身约为浮点循环的 5–7x)。需要了解两点
-限制:使用量化 KV 缓存(`tq1`、TQ 或 int8 KV)时,context 点积仍走浮点路径,因此那里不提供
-精确性;而真正的近似平局翻转目前只是推论,尚未在 GLM-5.2 的 n=64 上实际捕捉到。
-
-## 实际成果
+**没有 Resizable BAR 的显卡**现在也能用了。这类显卡(所有 Turing 显卡、使用首发固件的 Ampere 显卡、关闭了该选项的较旧 AMD 显卡)只允许 CPU 直接写入其显存中约 256 MB 的部分;colibri 现在会自动通过一个暂存缓冲区(staging buffer)把权重复制进去。这条路径已通过强制启用以及在三种设备上模拟小窗口进行了测试,在 780M 上没有可测量的开销;尚未在真正没有 Resizable BAR 的显卡上实测([vulkan.md](docs/vulkan.md#memory-placement-without-resizable-bar))。
-<p align="center">
- <img src="docs/media/ladder.png" width="880" alt="各硬件级别的实测解码速度">
-</p>
+CI 在软件驱动上将每个引擎的 Vulkan 路径与 CPU 的 token 对照检查。GPU 做加法的顺序不同,而且在 CPU 会舍入的地方把部分激活值保留为 f32,因此较长的回答可能与 CPU 的回答相差一个词([vulkan.md](docs/vulkan.md#the-other-engines))。
+
+### CUDA:NVIDIA 显卡
-同一套引擎、同一个 int4 容器——硬件只会改变专家的存放位置。
-[完整 benchmark 表格](docs/benchmarks.md)中的重点如下:
+在 Linux 上,如果装有 CUDA toolkit,安装程序会为具有 CUDA 路径的引擎编译 CUDA 版本:GLM-5.2/5.3、GLM-5.3-Flash、Inkling、Kimi K3、DeepSeek V4 Flash、Qwen3.8-Flash-Next,以及 Qwen3.6 和 Qwen3-Coder。在 Windows 上,CUDA 引擎是一个单独的 DLL([windows.md](docs/windows.md))。
-- **6× RTX 5090,全部常驻**:解码 5.8–6.8 tok/s,TTFT 约 13 秒
- ([实验记录](docs/experiments/glm52-6x5090-2026-07-12.md));
-- **128 GB、仅使用 CPU 的台式机**:热缓存后约 1.8 tok/s
- ([#200](https://github.com/JustVugg/colibri/issues/200));
-- **单张 RTX 5070 Ti 的笔记本级主机**:通过 GPU 常驻管线达到 1.07 tok/s
- ([#273](https://github.com/JustVugg/colibri/issues/273));
-- **25 GB 开发机**:冷启动 0.05–0.1 tok/s——这是项目起步时已证实的下限,
- 也仍是诚实的基准。
+- **显存专家层级**把最热的专家放在显卡上,这些专家根据实测路由选出;未命中的专家同时在 CPU 上计算。Qwen3.6 在两张 8 GB 显卡(RTX 3070 和 Quadro RTX 4000)上、有热的路由历史时,解码速度为 11.3 tok/s([qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md));GLM-5.2 在六张 RTX 5090 上、全部专家常驻时为 9.0-9.2 tok/s([benchmarks.md](docs/benchmarks.md));DeepSeek V4 Flash 在一张 RTX 5080 上为 1.5-1.6 tok/s,3,324 个 token 的提示词用时 90 秒([deepseek-v4.md](docs/deepseek-v4.md))。
+- **Qwen3.6 新功能:DeltaNet 层放在显卡上**(`Q36_DN_GPU=1`,需手动开启)。以前,Qwen3.6 的 30 个 DeltaNet 层中,每一层对每个 token 都要在显卡和 CPU 之间复制四次数据;现在,解码一个 token 时整个层都在显卡上运行,其循环状态保留在显存中。在 RTX 3070 上、稠密层位于显存时:从 25.4 提升到 30.0 tok/s([qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md#the-deltanet-layer-on-the-card-q36_dn_gpu1))。
+- **较旧的显卡。** 如果 CUDA toolkit 已不再支持为你的显卡编译(例如 CUDA 13 与 V100,见 [#1852](https://github.com/JustVugg/colibri/issues/1852)),编译会停止:此时 `--backend vulkan` 会改为通过 Vulkan 使用这张显卡。DeepSeek V4 的 CUDA 层级也可以为 Pascal 和 Turing 编译(`CUDA_ARCH=portable-pre-ampere NO_TC=1`)。
-质量来自测量,而非假设:int4 容器的量化损失,以及 scale granularity/rotation
-消融实验,收录于 [docs/benchmarks.md](docs/benchmarks.md#quality-benchmark)、
-[#108](https://github.com/JustVugg/colibri/issues/108) 与
-[#81](https://github.com/JustVugg/colibri/issues/81)。
+全部内容:[docs/cuda.md](docs/cuda.md)。
-## 开始使用
+### Apple Silicon
-你需要两样东西:**程序本体**(几百 KB)和**模型**(429 GB)。各平台的分步
-指引见 [Quick Start 指南](docs/quickstart.md)。
+Metal 后端为多个引擎在统一内存 GPU 上执行专家运算;用 `METAL=1` 编译([docs/metal.md](docs/metal.md))。在 macOS 上,一步安装程序编译的是 CPU 版本。
-### 一步完成
+<a id="system-one-mode-ask-a-closed-question"></a>
+<a id="system-one-a-decision-with-a-probability"></a>
-**Windows:** 下载仓库(**Code** 中的 **Download ZIP**,或 `git clone`),解压后
-双击 **`START-HERE.bat`**。
-**Linux 和 macOS:**
+## System One:一个带概率的决策
+
+人们向模型提出的请求,大多数是要它做一个选择,而不是写一段文字:哪个队列、哪个结论、是或否。`POST /v1/systemone` 接收一个状态(文本或 JSON)和若干带类型的问题,对每个问题给出每个允许选项的概率以及一个置信度。不生成任何内容,因此答案不可能落在你的列表之外,而“模型没有把握”就成了一个可以设阈值的数字。
```bash
-git clone https://github.com/JustVugg/colibri && cd colibri
-./start-here.sh
+curl -s http://127.0.0.1:8000/v1/systemone -H 'Content-Type: application/json' -d '{
+ "state": "340 lines, 8 files, no tests. CI is green but nothing covers that path.",
+ "questions": {
+ "review": {"type": "choice", "instructions": "What should the reviewer do?",
+ "criteria": {"merge": null, "request changes": null, "close": null}},
+ "risky": {"type": "noul", "instructions": "Is this change risky?"}}}'
```
-它会检测内存、磁盘和 GPU,推荐一个适合这台机器的模型(按回车即采用推荐),在 GPU
-可用时用 Vulkan 或 CUDA 编译引擎(或获取预编译版本),以可续传的方式下载模型(随时
-可以中断,再次运行即从断点继续),并在浏览器中打开仪表盘。它还会打印供其他应用使用的
-OpenAI 和 Anthropic 基础 URL。之后再次运行,colibri 会直接启动;`c/coli stop` 可以
-停止它。每一步做什么:[quickstart.md](docs/quickstart.md#the-one-step-way)。
+`choice` 类型的问题返回所选的标签、每个标签的概率,以及一个从 0(毫无倾向)到 1(完全确定)的 `confidence`;`noul` 返回“是”的概率;`score` 返回期望等级。
-在用 AI 编程助手?让它按照 [docs/AI_SETUP.md](docs/AI_SETUP.md) 来安装 colibri。
-支持 Model Context Protocol 的助手可以使用 `coli mcp`
-([MCP_SERVER.md](docs/MCP_SERVER.md))。
+由谁来回答:
-下面是手动安装的步骤。
+- **colibri 运行的任何聊天模型**,通过打分:它读出每个选项的概率,而不是写出一个答案。关于同一文档的多个问题只读取文档一次:在 Qwen3.6 上,关于同一文档的四个问题,比在同一台 CPU 机器上生成同样的答案快 5.7 倍。
+- **三个决策模型**,原生作答,一次前向传播完成,使用其作者拟合的校准:[Laya](docs/laya.md)(Convai Innovations)、[GLiNER2.5-Decide](docs/gliner_decide.md)(fastino)和 [Clef](docs/clef.md)(Cloudflare;它也能聊天)。它们的大小和速度见[决策模型表格](#which-model-for-my-machine)。
-### 1. 获取 colibri
+**从 Jev 切换过来。** 请求和回复与 TypeSafe 的 Jev API 相同,因此 Jev 客户端只需更改 base URL 即可切换到 colibri,其他什么都不用改:`TYPESAFE_BASE_URL=http://127.0.0.1:8000`(没有设置 `COLI_API_KEY` 就启动的服务器会接受客户端已经在发送的密钥)。两个官方 SDK 未经任何修改,已针对 `coli serve` 测试。
-**下载预编译版本**——Linux、macOS 与 Windows 均已提供,无需编译器。从
-[Releases](https://github.com/JustVugg/colibri/releases) 下载对应平台的压缩包并解压:
+同样的模式也可以在终端中使用(`coli chat` 中的 `/decide merge | request changes | close`),也可以在仪表盘的 System One 页面使用。完整的请求与回复、打分规则,以及它在哪些情况下帮不上忙:[docs/systemone.md](docs/systemone.md)。
-```bash
-mkdir colibri && tar xzf colibri-v1.8.0-linux-x86_64.tar.gz -C colibri && cd colibri
-python3 coli info # engine ready ✓
-```
+## 仪表盘
-包内含引擎(`colibri`,Windows 上为 `colibri.exe`)、`coli` 启动器及其 Python
-辅助脚本。无需重命名或配置:`coli` 会自动找到同目录下的引擎。你只需安装
-[Python 3](https://www.python.org/downloads/)——启动器和 API gateway 是 Python
-脚本,而引擎本身是零依赖的纯 C 程序。
+`coli web` 会打开它,一步安装程序也会:包括聊天、System One 页面、大脑(Brain)页面和性能剖析(Profiling)页面,支持浅色和深色主题。
-**或者从源码构建**——需要带 OpenMP 的 `gcc`(或 clang):
+<p align="center">
+ <img src="docs/media/colibri-dashboard.png" width="900" alt="colibri 网页仪表盘:聊天、实时指标、硬件面板、专家存储层级">
+</p>
+<p align="center"><em>Qwen3.6 在 CPU 机器上作答,专家从磁盘流式读取。</em></p>
-```bash
-git clone https://github.com/JustVugg/colibri && cd colibri/c
-./setup.sh # 检查 gcc/OpenMP、构建并运行自测
-```
+<p align="center">
+ <img src="docs/media/colibri-brio.png" width="900" alt="System One 页面:文档只读一次,每个允许的答案各有一个概率,并给出一个熵">
+</p>
+<p align="center"><em><strong>System One</strong>:给模型一份文档,以及它唯一可以选择的几个答案。图中:<strong>request changes 的概率为 99.9%</strong>,熵 0.005,读取 4 个 token,生成 0 个。</em></p>
-想把 `coli` 加入 PATH?在 checkout 中执行 `pip install -e .` 即可注册(引擎仍位于
-`c/` 目录——这是从克隆目录做的可编辑安装,而非独立 wheel)。
+<p align="center">
+ <img src="docs/media/colibri-brain.png" width="900" alt="大脑页面:GLM-5.2 的实测专家图谱绘成一块皮层,有十个可进入的区域">
+</p>
+<p align="center"><em><strong>大脑(Brain)</strong>:GLM-5.2 的<a href="https://github.com/JustVugg/colibri/issues/175">实测专家图谱</a>,13,260 个已分析的专家分布在十个区域(Python、SQL、数学、诗歌、法律、中文……),位置取决于实测的路由亲和度。<strong>Live routing</strong> 显示正在运行的模型:每个专家一格,颜色表示存储层级,一轮中每个被路由到的专家都会闪烁。</em></p>
-### 2. 获取模型
+**性能剖析**(Profiling)页面按阶段显示每一轮的时间花在了哪里,并以最近 30 轮作为趋势。
-Hugging Face 上已有预转换的 **GLM-5.2 int4** 容器——请务必使用
-**含 int8 MTP head 的 group-scaled(gs64)版本**。它约为 **429 GB**,请放在空间足够的磁盘上,最好是快盘:
+## 在其他应用中使用
-**https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp**
+`coli serve`(安装程序会替你启动它)是一个同时提供多种 API 的服务器:
-**GLM-5.3** 属于同一家族,使用同一引擎加载。它有自己的 group-scaled(gs64)容器,
-约 **419 GB**,且**不含** MTP head,因此推测解码保持关闭:
+- **兼容 OpenAI**:`/v1/chat/completions`、`/v1/completions` 和 `/v1/models`,支持流式输出、JSON 回复、停止序列和 logprobs;
+- **兼容 Anthropic**:`/v1/messages`,因此 Claude Code 和 Anthropic SDK 可以直接连接它;
+- **工具调用**:除 Inkling 和 OLMoE 之外的每个聊天引擎都支持,各自使用其模型的原生格式([各引擎对照表](docs/api.md#tool-calling-support));
+- **图像输入**:GLM-5.3-Flash、DeepSeek V4.1 Flash、MiMo-V2.6、Qwen3.8-Flash-Next 和 Qwen3.8-27B 支持,方式可以是 `coli chat` 消息中的一个路径、`coli web` 中的一个附件,或一个 `image_url` 部分;
+- **图像输出**:Qwen-Image-2.1 通过 `POST /v1/images/generations` 提供,`coli chat` 还能直接在终端中显示图片([qwen-image.md](docs/qwen-image.md));
+- **决策**:通过 `POST /v1/systemone`([见上文](#system-one-a-decision-with-a-probability))。
-**https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64**
+编程 CLI 和编辑器的连接方式与连接任何兼容 OpenAI 的服务商相同:base URL 为 `http://127.0.0.1:8000/v1`,模型 id 用 `coli status` 打印出的那个,密钥任意非空即可([docs/api.md](docs/api.md#connect-a-coding-cli-or-editor))。
-> ⚠️ 请使用上面的 **gs64** 容器,不要使用较旧的 per-row int4 镜像
->(`mateogrgic/…`、`jlnsrk/…`):后者质量实测低约 9 个百分点,也是
-> [#455](https://github.com/JustVugg/colibri/issues/455) 最初 think-mode 循环与生成不终止的根因。
-> gs64 修复了受控的 per-row A/B 问题,但不是通用的重复或 EOS starvation 防护。
-> MTP head 也必须是 **int8,而非 int4**(int4 的草稿接受率为 0%,
-> [#8](https://github.com/JustVugg/colibri/issues/8)):
-> `ls -l <model>/out-mtp-*`:正确的 int8 是三个文件,大小为 `3527131672 / 5366238584 / 1065950496`,
-> 或单个 `out-mtp-00000.safetensors`,大小为 `9959321520` 字节(推荐容器当前的上传版本就是单个文件:
-> 同样的 int8 张量,共 777 个,每个元素一个字节)。
+<a id="how-it-works"></a>
-你也可以自行从 FP8 源转换——只需一条可断点续传的命令,且任何时候都不需要
-在磁盘上同时存放完整的 756 GB:
+## 工作原理
-```bash
-./coli convert --model /nvme/glm52_i4 # 逐 shard 下载并转换(仅此一次需要 python)
-```
+<p align="center">
+ <img src="docs/media/token-path.png" width="880" alt="路由、并集、放置、重叠、学习">
+</p>
-<a id="other-supported-models"></a>
-#### 其他支持的模型
-
-GLM-5.2 是参考模型,但同样的流式方法还能运行另外九个语言模型家族,另有一个引擎用于生成图像。
-每个都是一个**同级引擎**:一个 C 文件、自己的架构、同一套 `coli chat` / `coli serve` /
-`coli web` 前端(启动器根据模型的 `config.json` 选择二进制文件,图像模型则根据
-`model_index.json`):
-
-> **各自需要什么。** 这些模型差别很大,有人把其中两个放在一起读,误以为要求互相矛盾
-> ([#191](https://github.com/JustVugg/colibri/issues/191))。它们并不矛盾,只是不同的模型。
-> **它们都不需要 GPU。**
->
-> | 模型 | 权重所需磁盘 | RAM | GPU |
-> |---|---|---|---|
-> | **OLMoE** | 约 7 GB(int8 容器) | 8 GB | 不需要;可选 Vulkan |
-> | **GLM-5.2/5.3** | 约 429 GB(5.2)/约 419 GB(5.3) | 最低 16 GB,舒适 24 GB | 不需要;可选 Vulkan |
-> | **GLM-5.3-Flash** | 转换后约 195 GB | 25 GB(int4 权重 12 GB + 专家缓存) | 不需要;可选 Vulkan |
-> | **Inkling** | 约 469 GB | 使用 int4 稠密容器时 25 GB,不使用时约 120 GB | 不需要;可选 Vulkan |
-> | **Kimi K3** | 约 1.6 TB | 32 GB 以上 | 不需要;可选 Vulkan |
-> | **DeepSeek V4 Flash** | 约 167 GB(REAP 150B:约 85 GB) | 最低 16 GB,舒适 32 GB | 可选;GTX 10 系列及以上的任意 NVIDIA 显卡(Pascal/Turing 通过 `CUDA_ARCH=portable-pre-ampere NO_TC=1`,RTX 50 上效果最佳)可使 prefill 快 5-10 倍、解码快约 2.5 倍;可选 Vulkan |
-> | **DeepSeek V4.1 Flash** | 约 510 GB(官方 checkpoint;其中 203 GB 是每次只读取几百字节的 n-gram 记忆) | 约 18 GB 常驻(稠密部分、嵌入、视觉),加上由 `--ram` 决定大小的专家缓存;cap 8 时实测峰值 RSS 24.8 GB | 不需要;可选 Vulkan |
-> | **MiMo-V2.6 Flash** | 约 178 GB(官方 checkpoint) | 每层缓存 32 个专家时实测常驻 30.1 GB,64 个时 49.8 GB;缓存大小由 `--ram` 决定 | 不需要;可选 Vulkan |
-> | **MiMo-V2.6 Pro** | 约 574 GB(不含引擎从不加载的三个文件时约 564 GB) | 稠密部分按发布格式为 30.2 GiB,int8 下为 21.7 GiB;每层缓存 12 个专家时实测常驻 48.0 GB(稠密部分按发布格式),20 个时 50.7 GB(稠密部分为 int8) | 不需要;可选 Vulkan |
-> | **Qwen3.8-Flash-Next** | 约 185.5 GB(官方 FP8 checkpoint),可选的 int4-g64 专家 sidecar 另需 68.0 GB | 使用 FP8 专家、默认上下文时舒适为 24 GB(cap 32;16 GB 低于下限);使用 int4-g64 sidecar 时 cap 32 实测 RSS 11.6 GB | 可选;CUDA VRAM 专家层级(仅限 FP8 专家),稠密主干在 VRAM 中量化为 int8;可选 Vulkan |
-> | **Qwen3.8-27B**(稠密,文本与图像) | 转换后约 51 GB(f16) | 稠密权重为 int4 时 20 GB,int8 时 30 GB | 不需要;暂无 CUDA 层级;可选 Vulkan |
-> | **Qwen3.6-35B-A3B** | 约 23 GB(int4-gs64 容器) | 24 GB(需要完全常驻 RAM) | 可选;CUDA VRAM 专家层级在两张 8 GB 显卡上实测 **1.44 -> 10.05 tok/s(7.0x)**,输出与 CPU 逐位一致;可选 Vulkan |
-> | **Qwen3-Coder-30B-A3B** | 约 19 GB(int4-gs64 容器;int8 为 30 GB) | 每层缓存 32 个专家时实测常驻 6.5 GB,全部 128 个时 15.2 GB | 不需要;可选 Vulkan |
-> | **Qwen-Image-2.1**(文生图) | 约 33 GB(官方 diffusers checkpoint) | 全部常驻 16.0 GB;每个 prompt 加载文本编码器时峰值 8.5 GB,另加工作缓冲区(生成一张 768x512 图像实测峰值 9.0 GB) | 不需要;可选 Vulkan,尚未在 GPU 上计时 |
->
-> GPU 从不改变模型的回答,只改变计算在哪里进行。速度由你的磁盘决定,因为专家是从磁盘
-> 流式读取的:慢盘上每秒不到一个 token,快盘在缓存预热后每秒几个 token。
->
-> **可选 Vulkan** 指的是 `VK=1` 构建。以 `COLI_VULKAN=1` 运行时,引擎会把常驻矩阵放到任何
-> 具有 Vulkan 1.2 驱动的 GPU 上(GLM-5.2 在那里有完整的解码路径),CI 在软件驱动上将这些
-> 引擎与 CPU 的 token 对照检查
-> ([vulkan.md](docs/vulkan.md#the-other-engines))。正确还不等于更快。在这些引擎首次实测的
-> 真实 GPU,即集成显卡 Radeon 780M(Ryzen 7 PRO 8700GE,同样的二进制文件,冷页缓存)上,
-> 目前比 CPU 慢:Qwen3.6-35B-A3B 解码 3.06 tok/s,CPU 为 5.97,输出完全相同;使用 int4 专家的
-> Qwen3.8-Flash-Next 为 1.53,CPU 为 3.55。每次矩阵乘法都是一次同步提交,每个 token 约 726 次,
-> 而集成 GPU 读取的是与 CPU 相同的 RAM。
-
-| 家族 | 总参数 / 激活参数 | 权重 | 构建 | 文档 |
-|---|---|---|---|---|
-| **GLM-5.2/5.3** | 744B / 40B | [`mastouri/…-int4-g64-with-int8-mtp`](https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp)(429 GB)或 [`Justvugg/GLM-5.3-colibri-int4-g64`](https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64)(419 GB) | `make -C c glm` | 本页 |
-| **Inkling**(Thinking Machines) | 975B / 41B | [`nbeerbower/Inkling-colibri-int4`](https://huggingface.co/nbeerbower/Inkling-colibri-int4)(469 GB) | `make -C c inkling` | [inkling.md](docs/inkling.md) |
-| **GLM-5.3-Flash**(Z.ai) | 321B / 18B | [`zai-org/GLM-5.3-Flash`](https://huggingface.co/zai-org/GLM-5.3-Flash),路由专家转换为 **int4-gs64**,稠密部分保持 BF16,精度在加载时选择;含视觉 | `make -C c glm53` | [glm53-flash.md](docs/glm53-flash.md) |
-| **Kimi K3**(Moonshot) | 2.8T / 104B | [`moonshotai/Kimi-K3`](https://huggingface.co/moonshotai/Kimi-K3),原始 checkpoint,路由专家保持**原生 MXFP4** | `make -C c kimi_k3` | [kimi_k3.md](docs/kimi_k3.md) |
-| **DeepSeek V4 Flash** | 284B / 13B | 官方分片 checkpoint,路由专家保持**原生 fp4**,稠密部分保持 fp8-e4m3;**REAP 剪枝的 150B**([`puwaer/DeepSeek-V4-Flash-0731-reap-150b`](https://huggingface.co/puwaer/DeepSeek-V4-Flash-0731-reap-150b),85 GB,256 个专家中保留 132 个)用同一引擎加载,无需转换 | `make -C c deepseek-v4` | [deepseek-v4.md](docs/deepseek-v4.md) |
-| **DeepSeek V4.1 Flash** | 552B / 16B | 官方 checkpoint,**无需转换**:专家本身已是 fp4,稠密部分为 fp8-e4m3。其中 203 GB 是每次只从磁盘读取几百字节的 n-gram 记忆,路由专家**每个 token 4.5 GB**,而 GLM-5.2 为 12.7 GB。视觉、工具调用与 DSpark 草稿 head 全部启用 | `make -C c deepseek_v41` | [deepseek-v41.md](docs/deepseek-v41.md) |
-| **MiMo-V2.6 Flash**(Xiaomi) | 309B / 15B | [`XiaomiMiMo/MiMo-V2.6-Flash-MOPD`](https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Flash-MOPD)(178 GB),官方 checkpoint,**无需转换**:路由专家保持**原生 MXFP4**,稠密部分保持 FP8/BF16。48 层中有 39 层只关注 128 个 token 的窗口,因此长上下文只需 9 层的 KV。支持视觉与工具调用 | `make -C c mimo` | [mimo.md](docs/mimo.md) |
-| **MiMo-V2.6 Pro**(Xiaomi) | 1.02T / 42B | [`XiaomiMiMo/MiMo-V2.6-Pro-MOPD`](https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Pro-MOPD)(573.5 GB),官方 checkpoint,**无需转换**,运行在 MiMo 引擎上:同一架构,70 层、384 个专家。已在 70 层中的前 32 层上与 Xiaomi 自己的建模代码对照验证。支持视觉与工具调用 | `make -C c mimo` | [mimo.md](docs/mimo.md#pro) |
-| **Qwen3.8-Flash-Next**(Alibaba) | 125B + 51B n-gram / 6B | [`Qwen/Qwen3.8-Flash-Next-FP8`](https://huggingface.co/Qwen/Qwen3.8-Flash-Next-FP8),原始 checkpoint;PLE 保持可分页,专家保持**原生 block-FP8**,或从可选的 sidecar 以 **int4-g64** 读取(见下文)。可选 MTP 草稿(`Q38_MTP=1`) | `make -C c qwen38`(VRAM 专家层级需 `CUDA=1`) | [qwen38.md](docs/qwen38.md) |
-| **Qwen3.6**(Alibaba) | 35B / 3B | [`Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64`](https://huggingface.co/Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64)(约 23 GB,**推荐**),Gated Attention + Gated DeltaNet 混合架构 | `make -C c qwen36`(VRAM 专家层级需 `CUDA=1`) | [qwen36.md](docs/qwen36.md) |
-| **Qwen3.8-27B**(Alibaba) | 27B,稠密 | 用 `c/tools/convert_qwen36.py` 将 [`Qwen/Qwen3.8-27B`](https://huggingface.co/Qwen/Qwen3.8-27B) 转换为 f16 容器(51 GB);引擎在加载时将其量化为 int8,设置 `COLI_DENSE_BITS=4` 时量化为 int4。每层一个 MLP,没有路由器,运行在 Qwen3.6 引擎上。支持文本与图像 | `make -C c qwen36` | [qwen36.md](docs/qwen36.md#the-dense-27b) |
-| **Qwen3-Coder-30B-A3B**(Alibaba) | 30B / 3B | [`Justvugg/Qwen3-Coder-30B-A3B-colibri-int4`](https://huggingface.co/Justvugg/Qwen3-Coder-30B-A3B-colibri-int4)(19 GB,int4-gs64),由 [`Qwen/Qwen3-Coder-30B-A3B-Instruct`](https://huggingface.co/Qwen/Qwen3-Coder-30B-A3B-Instruct) 转换而来。运行在 Qwen3.6 引擎上的全注意力 Qwen3 MoE,128 个专家 top-8,有自己的 XML 工具调用格式,不带思考;在 teacher forcing 下,int4 容器在 96.9% 的位置上选出与 bf16 发布版相同的 top-1 token | `make -C c qwen36` | [qwen36.md](docs/qwen36.md#qwen3-coder-30b-a3b) |
-| **OLMoE**(AI2) | 7B / 1B | 用 `c/tools/convert_olmoe_merged.py` 转换,**int8** 容器,约 7 GB | `make -C c olmoe` | 无 |
-| **Qwen-Image-2.1**(Alibaba) | 图像模型 | [`Qwen/Qwen-Image-2.1`](https://huggingface.co/Qwen/Qwen-Image-2.1)(约 33 GB),官方 diffusers checkpoint,**无需转换**:文本编码器与扩散 transformer 在加载时量化为 int8。`coli chat` 中直接显示图片,`coli serve` 提供 `POST /v1/images/generations`。Qwen Research License:仅限非商业用途 | `make -C c qwenimage` | [qwen-image.md](docs/qwen-image.md) |
-| **Laya**(Convai Innovations) | 决策模型,421M | [`convaiinnovations/laya`](https://huggingface.co/convaiinnovations/laya)(842 MB),官方 checkpoint,**无需转换**:ModernBERT 编码器加决策头,对类型化问题(choice、score、noul)给出校准后的概率,而不是生成文本。由 `coli serve` 在 `POST /v1/systemone` 上提供。Apache-2.0 | `make -C c laya` | [laya.md](docs/laya.md) |
-| **GLiNER2.5-Decide**(fastino) | 决策模型,340M | [`fastino/GLiNER2.5-Decide`](https://huggingface.co/fastino/GLiNER2.5-Decide)(1.9 GB),官方 checkpoint,**无需转换**:DeBERTa-v3 编码器加 GLiNER2 的分类头,一次读完请求中的所有问题和状态,为每个选项给出概率。由 `coli serve` 在 `POST /v1/systemone` 上提供。Apache-2.0 | `make -C c gliner_decide` | [gliner_decide.md](docs/gliner_decide.md) |
-| **Clef**(Cloudflare) | 决策模型 + 聊天,27B | [`Cloudflare/clef`](https://huggingface.co/Cloudflare/clef)(55 GB),用 `c/tools/convert_qwen36.py` 转换(52 GB,含决策头):在 Qwen3.8-27B 上继续训练并加上联合模式头,一次前向为每个问题的每个选项打分。`POST /v1/systemone` 原生作答,聊天与 Qwen3.8-27B 相同。Apache-2.0 | `make -C c qwen36` | [clef.md](docs/clef.md) |
-
-Qwen3.6 提供三个预转换容器:**int4-gs64**(推荐:与 per-row 相比,对 int8 基准的余弦相似度
-实测从 0.98777 提升到 0.99313,KL 从 0.109 降到 0.080,即量化误差减少约 44%)、作为 A/B 基线的
-[int4 per-row](https://huggingface.co/Kreuzzelg/qwen36-35b-a3b-colibri-i4),以及
-[KAT-Coder v2.5](https://huggingface.co/Kreuzzelg/kat-coder-v2.5-dev-colibri-i4-gs64),同一引擎可以
-直接运行它:任何架构相同的 checkpoint 都无需专门的代码路径。使用 `CUDA=1` 时,VRAM 专家层级
-**在两张 8 GB 显卡上实测 1.44 → 10.05 tok/s(7.0×)**,输出与 CPU 路径逐位一致。
-
-Qwen3.8-Flash-Next 按发布格式以 block-FP8 读取路由专家。可选的 **int4-g64 sidecar**
-(`c/tools/convert_qwen38_experts_int4.py`,在 FP8 shard 旁写入 68.0 GB)让每次未命中只读取
-56% 的字节。在 Ryzen 7 PRO 8700GE(16 线程,61 GiB,NVMe)上实测,相同缓存大小下解码快
-1.4-1.5 倍,相同 RAM 下快 1.56 倍,困惑度平均每个 token 增加 +0.017 nats
-([qwen38.md](docs/qwen38.md#routed-experts-as-int4-g64))。使用 checkpoint 自带 MTP head 的
-推测解码为可选功能(`Q38_MTP=1`),输出与普通解码完全相同。在同一台机器上使用 int4 专家时,
-94-96% 的草稿被接受,每次前向传播 1.94 个 token,tok/s 提升 +12-14%(cap 96 时从 3.57 到 4.01,
-cap 170 时从 4.15 到 4.74)。在那台机器上收益不大,因为从磁盘读取专家的量并没有减少
-([qwen38.md](docs/qwen38.md))。
-
-Kimi K3 无需转换:其 QAT 训练的 MXFP4 专家直接从原始 Hugging Face shard 流式读取,bf16 稠密部分
-在加载时量化。长时间的 agent 会话可以选用循环状态检查点(RAM 中 `COLI_K3_CKPT=N` 个 slot,或用
-`COLI_K3_CKPT_DIR` 存到磁盘):编辑过的或后续的 prompt 会恢复仍然保留的最深检查点,只对尾部重新
-prefill,而不是让整个对话重新经过 SSM 层回放。在 Vulkan 主机上(`COLI_VULKAN=1`),路由专家进入
-共享的专家层级:按专家历史预先填充,并随路由变化逐出。引擎的 KDA 与 MLA 路径在 CI 中与厂商实现逐
-token 对照验证。
-
-Inkling 提供 int4 专家,但稠密权重为 **bf16**(常驻 49.4 GB);对于放不下这些权重的主机,
-[inkling.md](docs/inkling.md) 提供一个单次处理工具,把稠密部分降到 15.3 GB,让 975B 能在
-25 GB 的机器上运行,并如实写明了其中的取舍。
-
-### 3. 运行
+每个 token 的每一层都走相同的五个步骤:路由、并集、放置、重叠、学习。设计目标是**放置只决定速度**:无论专家是从显存、内存还是磁盘作答,路由器的决策和权重的精度都完全相同。
-```bash
-COLI_MODEL=/nvme/glm52_i4 ./coli chat # 自动检测 RAM 预算、缓存与 MTP
-COLI_MODEL=/nvme/glm52_i4 ./coli plan # 查看规划的 VRAM/RAM/磁盘配置
-COLI_MODEL=/nvme/glm52_i4 ./coli doctor # 只读就绪检查
-COLI_MODEL=/nvme/glm52_i4 ./coli doctor --deep # 严格的张量/shard/索引/镜像预检
-COLI_MODEL=/nvme/glm52_i4 ./coli tune # 测量并保存本机最快且安全的执行配置
-./coli web --model /nvme/glm52_i4 # API + 仪表盘,并打开浏览器
-./coli serve --model /nvme/glm52_i4 # API + 仪表盘,不打开浏览器(headless)
-```
+<p align="center">
+ <img src="docs/media/tiers.png" width="880" alt="显存、内存与 NVMe:专家驻留的三个层级">
+</p>
-#### System One 模式:问一个封闭式问题
+- **权重的 JIT。** 编译器的 JIT 从不编译整个程序:它观察实际运行的部分,只编译热点路径。colibri 对权重下了同样的赌注。实测的路由热度决定哪些专家配得上显存、内存或磁盘:一个逐层的 LRU 缓存,加上一个从你自己的对话中学到的固定热门集合(`.coli_usage`,每轮更新)。colibri 越用越快。之所以可行,是因为路由具有可测量的结构(见[专家图谱](https://github.com/JustVugg/colibri/issues/175))。
+- **绝不为磁盘等待两次。** 一个专家的三个矩阵用一次 `pread` 读出;一组加载线程在常驻专家计算的同时读取缺失的专家;一批位置对每个专家只读取一次;路由前瞻线程可以预取下一层(GLM-5.2 的路由提前一层时有 71.6% 可预测)。`DIRECT=1`(O_DIRECT)在快速 NVMe 硬盘上往往收益很大,在其他硬盘上则持平甚至更差:请在你自己的硬盘上实测([tuning.md](docs/tuning.md))。
+- **不止一块 SSD。** `COLI_MODEL_MIRROR=/second/glm52_i4 ./coli chat --model /fast/glm52_i4` 会同时从第二块硬盘上的副本读取。两块接在独立控制器上的 NVMe 硬盘实测解码速度 +37.5%;放在较小硬盘上的部分镜像也可以([multidisk.md](docs/multidisk.md))。
+- **从笔记本到机架。** 在 25 GB 的笔记本上,所有专家都从磁盘流式读取,慢,但结果正确;在大型主机上,所有专家都常驻(`CUDA_EXPERT_GB=auto PIN_GB=all`),磁盘完全退出解码过程。`COLI_NUMA=1` 把常驻权重分布到多路主机的各个内存控制器上,本地集群模式则可以在其他机器上运行路由专家([cluster.md](docs/cluster.md))。
+- **忠实的模型。** 每个引擎都在 CI 中用一个微型 fixture 与其模型的参考实现进行对照检查。GLM-5.2 的 MLA 注意力保存压缩后的 KV 状态(每个 token 576 个浮点数,而不是 32,768 个,缩小 57 倍),并且在重启后依然保留,因此重新打开对话时无需再次读取提示词。
+- **物有所值的推测解码。** GLM-5.2 的 int8 MTP head 在划算时每次前向传播起草 2.2-2.8 个 token;Qwen3.8-Flash-Next 的 MTP head 需手动开启,在输出不变的情况下提速 12-14%。在起草成本高于节省的地方(DeepSeek V4),它保持关闭([tuning.md](docs/tuning.md#speculation-and-reproducibility))。
-人们向模型提出的大多数请求是一次选择,而不是一段文字:哪个队列、哪个结论、某个字段应取四个值中的哪一个。
-System One 模式把允许的选项交给引擎,读出每个选项的概率,而不是生成文本:不生成任何内容,
-答案不可能落在你的列表之外,并且每个答案都附带一个置信度(confidence),"模型没有把握"因此成为一个可以设阈值的数字。
-它在全部十个模型家族上可用,运行在同一个服务器上,且按请求可选:不请求它的聊天,输出逐字节保持不变。
+引擎是每个模型家族一个 C 文件(GLM-5.2 是 `c/colibri.c`),建立在共享的头文件之上,运行时不需要 BLAS,也不需要 Python:Python 只用于安装程序、启动器、转换工具和 API gateway。
-```bash
-# 在 TUI 中:同一个模型,只是不再让它写
-./coli chat --model /nvme/qwen36_i4_gs64
-> /decide merge | request changes | close
-> 340 lines, 8 files, no tests. CI is green but nothing covers that path.
+<a id="what-it-achieves"></a>
-# 从任何程序:向运行中的服务器发送一个 JSON 请求
-curl -s http://127.0.0.1:8000/v1/systemone -H 'Content-Type: application/json' -d '{
- "state": "340 lines, 8 files, no tests. CI is green but nothing covers that path.",
- "questions": {"review": {"type": "choice", "instructions": "What should the reviewer do?",
- "criteria": {"merge": null, "request changes": null, "close": null}}}}'
-```
+## 基准测试
+
+<p align="center">
+ <img src="docs/media/ladder.png" width="880" alt="按硬件级别划分的 GLM-5.2 实测解码速度">
+</p>
-`POST /v1/systemone` 使用与 TypeSafe 的 Jev API 相同的请求和回复:Jev 客户端只需更改 base URL 即可切换到 colibri。
-对同一文档的多个问题只读取文档一次:在 Qwen3.6 上与在同一台 CPU 机器上生成同样答案相比的实测,
-对同一文档的四个问题快 5.7 倍。完整说明、请求与回复格式、以及它不适用的情形见 [docs/systemone.md](docs/systemone.md)。
-仪表盘中也有 System One 页面。
+同一个引擎,同一个 int4 容器:硬件只改变专家存放的位置。GLM-5.2 的解码速度,摘自[完整表格](docs/benchmarks.md):
+- **6x RTX 5090,全部专家常驻:** 5.8-6.8 tok/s,使用选择性 NUMA 交错时为 9.0-9.2([实验记录](docs/experiments/glm52-6x5090-2026-07-12.md));
+- **128 GB,仅用 CPU**(Ryzen AI Max+ 395):热缓存时 1.83 tok/s([#200](https://github.com/JustVugg/colibri/issues/200));
+- **一台配单张 RTX 5070 Ti 的笔记本级主机:** 1.07 tok/s([#273](https://github.com/JustVugg/colibri/issues/273));
+- **项目起步时的那台 25 GB 笔记本:** 冷启动 0.05-0.1 tok/s,这是诚实的下限。
-在 Windows 上,发布包附带 `coli.cmd`:双击即可快速开始,或在 cmd 或 PowerShell 中运行
-`coli.cmd chat --model D:\glm52_i4`。在源码 checkout 中,同样的命令写作 `python coli chat --model
-D:\glm52_i4`。`.exe` 文件是引擎,不是启动器:单独启动时没有可加载的模型,会立即退出。
-引擎运行时是纯 C,python 只供一次性转换工具与可选的 API gateway 使用。
+质量靠测量,而不是靠假设:int4 容器的代价和量化消融实验见 [benchmarks.md](docs/benchmarks.md#quality-benchmark)。想加入你的机器,请按照[基准测试协议](docs/benchmarking.md)操作,并提交一个附有数据的 issue。
-#### 同样的命令可运行任意模型
+<a id="install-by-hand"></a>
-`coli` 会读取模型的 `config.json`,选出对应的引擎二进制文件,并渲染该家族的聊天模板,因此
-**换模型时命令行无需任何改变**。只需构建一次想用的引擎,然后把 `COLI_MODEL` 指向正确的目录:
+## 手动安装
-```bash
-make -C c glm # GLM-5.2
-make -C c inkling # Inkling
-make -C c kimi_k3 # Kimi K3
+<a id="1-get-colibri"></a>
-COLI_MODEL=/nvme/glm52_i4 ./coli chat # TUI
-COLI_MODEL=/nvme/inkling_i4 ./coli chat
-COLI_MODEL=/nvme/kimi_k3 ./coli chat
+**1. 程序。** 从 [Releases](https://github.com/JustVugg/colibri/releases) 下载对应平台的压缩包(Linux x86_64、macOS、Windows;不需要编译器,只需要供启动器和 API 使用的 [Python 3](https://www.python.org/downloads/))并解压,然后运行 `python3 coli info`。或者用 `gcc`(或 clang)和 OpenMP 从源码编译:
-./coli web --model /nvme/inkling_i4 # API + dashboard, opens a browser
-./coli web --model /nvme/kimi_k3
-./coli serve --model /nvme/inkling_i4 # API + dashboard, no browser
+```bash
+git clone https://github.com/JustVugg/colibri && cd colibri/c
+./setup.sh # checks gcc/OpenMP, builds, self-tests
+make qwen36 VK=1 # one engine, here with Vulkan (CUDA=1 for CUDA)
```
-对于非 GLM 引擎,`coli chat` 会在本地启动 gateway 并把 TUI 连接上去,因此 TUI、API 与仪表盘
-都经过同一个感知架构的聊天模板,你无需自己传入模板。
-
-有两点因模型而异,都记录在各模型的页面中:
+<a id="2-get-the-model"></a>
-- **RAM 紧张主机上的 Inkling** 需要 int4 稠密容器和较小的专家缓存:
- `./coli chat --model /nvme/inkling_i4 --cap 2`(见 [inkling.md](docs/inkling.md):默认的
- `--cap 8` 在常驻集之外还需要约 14 GB 缓存)。
-- **Kimi K3** 直接从原始 checkpoint 流式读取其 MXFP4 专家,因此无需转换,但快照约为 1.6 TB
- (见 [kimi_k3.md](docs/kimi_k3.md))。
+**2. 模型。** [上面表格](#which-model-for-my-machine)中的任何一个下载都可以:安装程序的 id 对应 Hugging Face 仓库,每个模型的页面都写有下载和转换命令。GLM-5.2 请使用带 int8 MTP head 的 group-scaled(gs64)容器 [`mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp`](https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp)(429 GB),GLM-5.3 则使用 [`Justvugg/GLM-5.3-colibri-int4-g64`](https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64)(419 GB,没有 MTP head)。不要使用较旧的 per-row int4 镜像:它们的质量实测低约 9 个百分点,并导致了 [#455](https://github.com/JustVugg/colibri/issues/455) 中的循环回答。`./coli convert --model /nvme/glm52_i4` 会从 FP8 发布版逐个 shard 构建同样的容器,任何时候都不需要在磁盘上同时存放全部 756 GB。如何检查 MTP head 以及其他事项:[quickstart.md](docs/quickstart.md#3-get-the-model)。
-### 4. 深入了解
+<a id="3-run-it"></a>
-| 主题 | 文档 |
-|---|---|
-| Benchmark、社区实测数据、质量测量 | [docs/benchmarks.md](docs/benchmarks.md) |
-| 可复现的 benchmark 协议与最低报告要求 | [docs/benchmarking.md](docs/benchmarking.md) |
-| 调优选项、策略、学习型缓存、预取 | [docs/tuning.md](docs/tuning.md) |
-| Windows 11 原生构建(含 CUDA DLL) | [docs/windows.md](docs/windows.md) |
-| CUDA 后端、VRAM 专家层级、全部常驻 | [docs/cuda.md](docs/cuda.md) |
-| Vulkan 后端(任意 GPU:通过 RADV 支持 AMD,包括 ROCm 已放弃的显卡) | [docs/vulkan.md](docs/vulkan.md) |
-| Apple Silicon Metal 后端 | [docs/metal.md](docs/metal.md) |
-| OpenAI 兼容 API、KV slots、网页仪表盘 | [docs/api.md](docs/api.md) |
-| System One 模式:对封闭的选项集打分而不是生成 | [docs/systemone.md](docs/systemone.md) |
-| 实验性的层分段嵌入 ABI | [docs/segment-runtime.md](docs/segment-runtime.md) |
-| 实验性的 tokenizer/嵌入/head Edge ABI | [docs/edge-runtime.md](docs/edge-runtime.md) |
-| 语法强制草稿(结构化输出) | [docs/grammar-draft.md](docs/grammar-draft.md) |
-| 环境变量完整清单 | [docs/ENVIRONMENT.md](docs/ENVIRONMENT.md) |
-
-## DeepSeek V4
-
-**DeepSeek V4 Flash** 直接流式读取官方 checkpoint,无需转换:路由专家保持**原生 fp4**,
-稠密部分保持带 UE8M0 块缩放的 **fp8-e4m3**。MLA + DSA 稀疏注意力,43 层,256 个路由专家
-加 1 个共享专家,top-6。支持 x86-64/aarch64 Linux 与 Windows/MSYS2(CPU),并提供可选的
-CUDA 层级(Windows 运行时 DLL;Linux 通过 `CUDA=1` 直接链接,已在 WSL2 下验证),每个阶段都以
-CPU 结果为准,并可逐阶段回退。
+**3. 运行。** 在源码 checkout 的 `c/` 目录中,或在解压后的发布包中运行。启动器会读取模型的 `config.json`,选出对应的引擎及其聊天模板,因此所有模型的命令都相同:
```bash
-cd c
-make deepseek-v4
-python ./coli chat --model /path/to/DeepSeek-V4-Flash --ram 32
-# 同一模型也支持:coli run / coli serve / coli web
-# Windows CUDA 层级:make cuda-dsv4-dll CUDA_ARCH=portable (RTX 50 上再加 make cuda-dsv4-dg-dll)
+./coli chat --model /nvme/qwen36 # chat in the terminal
+./coli web --model /nvme/qwen36 # API + dashboard, opens a browser
+./coli serve --model /nvme/qwen36 # API + dashboard, no browser
+./coli plan --model /nvme/qwen36 # where the model will live: VRAM, RAM, disk
+./coli doctor --model /nvme/qwen36 # read-only check: is everything ready?
+./coli tune --model /nvme/qwen36 # measure and save this machine's fastest safe settings
```
-两个可选的 GPU 调节项是新增的,正在征集社区实测数据,二者默认关闭,未设置时输出逐字节不变:
-`DSV4_HYBRID=1` 根据运行时测得的带宽,把 VRAM 层级的未命中分配给 GPU 填充分支和 CPU 分支;
-`COLI_CUDA_MOE_DOUBLE=1`(在 `COLI_CUDA_MOE_BATCH=1` 之上)在当前层计算时,把下一层的完整专家集
-预取到第二个 VRAM 存储区,VRAM 不足时回退到单个存储区。CUDA 层级现在也能在 Pascal 与 Turing
-显卡(GTX 10/RTX 20 系列)上运行:使用 `CUDA_ARCH=portable-pre-ampere NO_TC=1` 构建。
-
-贪心解码,一个 KV slot。工具调用通过 HTTP gateway 接入,使用 V4 原生的 prompt 与 DSML 调用块;
-不支持语法约束。见[各引擎 API 矩阵](docs/api.md#tool-calling-support)。前缀检查点(内存中与
-磁盘上)让 agent 会话和后续轮次在系统 prompt 首次 prefill 之后几秒内即可开始。在 RTX 5080 +
-2 块 NVMe 上实测:3324 个 token 的 prefill 90 秒,8.3k token 的首轮约 4 分钟(仅一次),之后的
-会话/轮次 6-9 秒,3k 上下文时解码约 1.6 tok/s,见 [docs/deepseek-v4.md](docs/deepseek-v4.md)。
-
-**给它 RAM。** 43 × 256 个路由专家在磁盘上约 137 GiB,一个 token 会触及其中 301 个,因此专家缓存
-命中率决定了 tok/s:`--ram` 是最有价值的单个调节项,而且它只改变速度,从不改变输出。
-
-**推测草稿已实现,但默认关闭。** DSpark 的 markov 草稿器与完整 MTP 都已实现并验证:草稿可以节省
-前向传播,但绝不会改变 token,因为每个被接受的 token 仍是目标模型自己的 argmax。在真实的多轮
-对话中实测,它们分别只接受了 15 个中的 1 个和 24 个中的 10 个,而本引擎为被拒绝的后缀回放循环
-注意力状态所花的代价,超过了草稿节省的时间:一个 14 个 token 的回答用了 495 秒。因此 `V4_DRAFT`
-与 `V4_MTP` 默认为 `0`,代码连同这些数据一起保留,留给在更快的存储上重试的人。
-
-CUDA 层级(构建、DLL 选择、GPU 覆盖范围)、环境变量参考、性能数据、checkpoint 验证以及动态生成的
-tiny 独立 oracle,见 [docs/deepseek-v4.md](docs/deepseek-v4.md);中文说明见
-[中文版 DeepSeek V4 文档](docs/deepseek-v4.zh-CN.md)。
-
-## 下一步
-
-- **推理系统研究就是产品**。当前层级采用 LRU 与学习型固定集;正在研究模型格式、压缩、
- 放置、调度、I/O、CPU/GPU 内核、异构重叠、KV 状态与路由感知推测。目标是降低硬件要求
- 和每个有效 token 的成本,所有成果都以端到端测量为准、经审查并公开开发。
-- **支持更多开放模型**。层级算法与模型无关,任何带路由专家的 MoE 都能用相同方式分层。
- 目前已有十个语言模型家族可用(GLM-5.2/5.3、GLM-5.3-Flash、Inkling、Kimi K3、DeepSeek V4 Flash、
- DeepSeek V4.1 Flash、MiMo-V2.6、Qwen3.8-Flash-Next、Qwen3.6、OLMoE),另有用于图像的
- Qwen-Image-2.1;更多开放权重家族(候选包括 **MiniMax**)将沿用同样的规则获得引擎支持:
- 有人完成端到端实测之后。
+在 Windows 上,发布包附带 `coli.cmd`(`coli.cmd chat --model D:\qwen36`);在源码 checkout 中请使用 `py -3 c\coli`。`.exe` 文件是引擎,而不是启动器。所有选项和变量:[SETTINGS.md](docs/SETTINGS.md)、[ENVIRONMENT.md](docs/ENVIRONMENT.md)。
-## 支持项目
+## 研究,以及如何参与
+
+colibri 希望前沿模型更少依赖稀缺硬件,运行成本更低。这意味着改变权重的存储和移动方式,决定哪些内容放在显存、内存或存储中,让 CPU 和 GPU 的工作相互重叠,并测试新的解码方法。没有什么会因为是惯例就被保留,也没有什么会因为微基准测试看起来快就被采用:起决定作用的是真实机器上的端到端推理,并且质量与速度一起测量。当前的开放问题:
+
+| 假设 | 目前的证据 | 仍需完成的实验 |
+|---|---|---|
+| 路由历史能比普通 LRU 更好地放置专家 | 学习到的固定集合能改善重复负载,但可能对某个提示词过拟合 | 在编程、聊天、多语言和长上下文负载上做留出集、跨会话的 A/B |
+| 多块 SSD 能把独立的带宽转化为解码速度 | 两块独立的 NVMe 硬盘实测解码 +37.5%;经加权条带化后,较慢的第三块硬盘影响持平([测量数据](docs/multidisk.md#what-has-been-measured)) | 在不同的硬盘速度、控制器布局和缓存状态下复现 |
+| 硬件感知的规划器能自动接近每台机器的最佳配置 | 目前已能检测内存/显存预算和多个后端,安装程序也会选择构建版本 | 在笔记本、工作站、NUMA 主机和多 GPU 系统上,把生成的方案与受控的参数扫描进行对比 |
+| 无损或质量受控的表示能把权重搬运量减少到有意义的程度 | 已有格式和量化消融实验,并设有正确性/质量门槛 | 同时复现质量、搬运的字节数、延迟和每个有效 token 的成本,而不只看压缩率 |
+| 感知路由的推测解码能在接近全驻留之前就带来收益 | MTP 和语法草稿可用,但 MTP 在专家命中率约 85% 时也实测过 32% 的损失 | 绘制接受率、专家命中率、批次并集和草稿深度之间的盈亏平衡面 |
+| CPU/GPU 重叠能隐藏传输和同步开销,而不只是转移瓶颈 | CUDA、Metal 和 Vulkan 都有收益数据,但快速 CPU、集成显卡和低驻留率可能把收益抹平 | 在 PCIe、统一内存和全驻留机器上做逐阶段 profile 和单变量 A/B,并取得 Vulkan 层级和稠密链在独立显卡上的首批数据 |
-colibrì 最初由一人使用 12 核心、25 GB RAM 的笔记本开发;
-如今它的数据来自社区中各种真实机器。如果这个项目对你有用:
+想参与?任选一行,负面结果也请公开。记录硬件、commit、模型、完整命令、提示词、缓存状态、吞吐量、首 token 延迟、专家命中率、读取的字节数,以及一项质量检查;每次只改变一个变量,重复运行,并附上原始日志。先从 [CONTRIBUTING.md](CONTRIBUTING.md) 和[基准测试协议](docs/benchmarking.md)开始,然后[提交一个 issue](https://github.com/JustVugg/colibri/issues/new)。在这里,一个控制良好的失败比一个无法解释的高速数字更有价值。
-- ⭐ 为仓库加星并分享;
-- 🐛 以 issue 提交你的硬件 benchmark 数据——实测数据比任何其他事都更能推动项目;
-- 💬 加入 [Discord 社区](https://discord.gg/RXV83nSZdk),讨论实验、硬件数据与研究方向;
-- 💬 若想赞助开发或捐赠硬件,请通过 GitHub issues 联系。
+## 文档
+
+| 主题 | 文档 |
+|---|---|
+| 一步安装与手动安装,所有平台 | [quickstart.md](docs/quickstart.md) |
+| 通过 AI 助手安装,以及 MCP 服务器 | [AI_SETUP.md](docs/AI_SETUP.md)、[MCP_SERVER.md](docs/MCP_SERVER.md) |
+| API:OpenAI、Anthropic、工具调用、KV slot、仪表盘 | [api.md](docs/api.md) |
+| System One 与决策模型 | [systemone.md](docs/systemone.md)、[laya.md](docs/laya.md)、[gliner_decide.md](docs/gliner_decide.md)、[clef.md](docs/clef.md) |
+| Vulkan:专家层级、稠密链、没有 Resizable BAR 的显卡 | [vulkan.md](docs/vulkan.md) |
+| CUDA,以及 Qwen3.6 的 CUDA 层级 | [cuda.md](docs/cuda.md)、[qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md) |
+| Apple Silicon、Windows | [metal.md](docs/metal.md)、[windows.md](docs/windows.md) |
+| 调优、学习型缓存、预取、推测解码 | [tuning.md](docs/tuning.md) |
+| 多块 SSD、多台机器 | [multidisk.md](docs/multidisk.md)、[cluster.md](docs/cluster.md) |
+| 基准测试以及如何测量 | [benchmarks.md](docs/benchmarks.md)、[benchmarking.md](docs/benchmarking.md) |
+| 所有选项和环境变量 | [SETTINGS.md](docs/SETTINGS.md)、[ENVIRONMENT.md](docs/ENVIRONMENT.md) |
+| 语法强制草稿,以及实验性的嵌入 ABI | [grammar-draft.md](docs/grammar-draft.md)、[segment-runtime.md](docs/segment-runtime.md)、[edge-runtime.md](docs/edge-runtime.md) |
## 仓库结构
```
-Makefile 根目录构建/检查入口
+start-here.sh, START-HERE.bat the one-step setup (Linux and macOS, Windows)
+Makefile root build/check entry point
c/
-├── colibri.c GLM-5.2 引擎 (make glm)
-├── inkling.c Inkling 引擎 (make inkling)
-├── kimi_k3.c Kimi K3 引擎 (make kimi_k3)
-├── glm53.c GLM-5.3-Flash 引擎 (make glm53)
-├── deepseek_v4.c DeepSeek V4 Flash 引擎 (make deepseek-v4)
-├── deepseek_v41.c DeepSeek V4.1 Flash 引擎 (make deepseek_v41)
-├── mimo.c MiMo-V2.6 Flash 与 Pro 引擎 (make mimo)
-├── qwen38.c Qwen3.8-Flash-Next 引擎 (make qwen38)
-├── qwen36.c Qwen3.6、Qwen3-Coder、Qwen3.8-27B 引擎 (make qwen36)
-├── olmoe.c OLMoE 引擎 (make olmoe)
-├── qwenimage.c Qwen-Image-2.1 引擎 (make qwenimage)
+├── colibri.c GLM-5.2/5.3 engine (make glm)
+├── glm53.c GLM-5.3-Flash (make glm53)
+├── inkling.c Inkling (make inkling)
+├── kimi_k3.c Kimi K3 (make kimi_k3)
+├── deepseek_v4.c DeepSeek V4 Flash (make deepseek-v4)
+├── deepseek_v41.c DeepSeek V4.1 Flash (make deepseek_v41)
+├── mimo.c MiMo-V2.6 Flash and Pro (make mimo)
+├── qwen38.c Qwen3.8-Flash-Next (make qwen38)
+├── qwen36.c Qwen3.6, Qwen3-Coder, Qwen3.8-27B, Clef (make qwen36)
+├── olmoe.c OLMoE (make olmoe)
+├── qwenimage.c Qwen-Image-2.1 (make qwenimage)
+├── laya.c Laya (make laya)
+├── gliner_decide.c GLiNER2.5-Decide (make gliner_decide)
│
-├── st.h safetensors 索引与范围读取
-├── quant.h 规范的容器解码器
-├── expert_ffn.h 各 MoE 引擎共用的路由专家 FFN 内核(planar int4、层运行器)
-├── tok.h, json.h tokenizer 与 JSON 解析器
-├── compat.h Windows/macOS 兼容层(POSIX 名称集中在一处)
-├── expert_store.h 流式专家缓存
-├── route_trace.h 路由遥测与 .coli_usage,与引擎无关
-├── kv_prefix.h 跨轮次的 KV 前缀复用
+├── st.h, quant.h, idot.h safetensors reads, container decoders, integer kernels
+├── expert_ffn.h, expert_store.h routed-expert kernel and streaming expert cache
+├── tok.h, json.h, compat.h tokenizer, JSON, Windows/macOS shims
+├── route_trace.h, kv_prefix.h routing telemetry (.coli_usage), KV prefix reuse
+├── decide_serve.h the decision engines' side of System One
│
-├── backend_cuda.* 可选的 CUDA 层级 (CUDA=1)
-├── backend_metal.* 可选的 Metal 层级 (METAL=1)
-├── backend_vulkan.* 可选的 Vulkan 层级 (VK=1)
+├── backend_cuda.* optional CUDA tier (CUDA=1)
+├── backend_metal.* optional Metal tier (METAL=1)
+├── backend_vulkan.*, vk_tier.c, vk_chain.c optional Vulkan tier and dense chain (VK=1)
│
-├── Makefile 构建与本地检查
-├── coli 用户界面 CLI
-├── openai_server.py OpenAI 兼容 HTTP gateway
-├── resource_plan.py `coli plan` 与 `coli doctor` 背后的 RAM/VRAM 规划器
-├── tools/ 离线转换、fixtures 与 benchmarks
-├── scripts/ 长时间转换辅助工具
-└── tests/ 零依赖的 C 与 Python 测试
-web/ 浏览器 UI(纯 OpenAI API client)
-desktop/ 封装网页 UI 的 Tauri v2 桌面 shell
-docker/ 容器镜像
-docs/ 参考文档、实验与媒体文件
+├── coli user-facing CLI
+├── setup_*.py the one-step setup: hardware, catalog, downloads, flow
+├── mcp_server.py the MCP server (coli mcp)
+├── openai_server.py OpenAI- and Anthropic-compatible HTTP gateway
+├── resource_plan.py RAM/VRAM planner behind coli plan and coli doctor
+├── tools/ conversion, fixtures and benchmarks
+└── tests/ dependency-free C and Python tests
+web/ the dashboard (a pure API client)
+desktop/ Tauri desktop shell around the dashboard
+docker/ container images
+docs/ reference docs, experiments, media
+site/ the website
```
-**每个模型家族一个 `.c`,建立在共享的单头文件之上。** 一个引擎只负责自己的架构;两个引擎都需要
-的东西(safetensors 读取器、容器解码器、tokenizer、专家缓存)都放在它们共同包含的头文件里,
-这样一个修复能同时覆盖所有引擎。这条规则不是装饰:这里反复出现的缺陷,正是某个机制只落在一个
-引擎里、从未传到同级引擎的那些。
+**每个模型家族一个 `.c`,建立在共享的单头文件之上。** 一个引擎只负责自己的架构,其他一概不管;两个引擎都需要的东西放在它们共同包含的头文件里,这样一个修复能同时覆盖所有引擎。在仓库根目录下,`make`、`make check` 和 `make clean` 都会转交给引擎的 Makefile。
+
+## 支持项目
+
+colibri 最初是一个人在一台 12 核心、25 GB 内存的笔记本上开发的项目;如今它的数据来自社区中的各种真实机器。如果它对你有用:
-在仓库根目录执行 `make`、`make check` 与 `make clean`,
-都会转发给引擎的 Makefile。
+- 为仓库加星并分享它;
+- 提交附有你的硬件基准测试数据的 issue:数据点比任何其他东西都更能推动这个项目;
+- 加入 [Discord 社区](https://discord.gg/RXV83nSZdk),讨论实验、硬件结果和研究方向;
+- 如果想赞助开发或捐赠硬件,请通过 GitHub issues 联系。
-## 为什么叫"colibrì"
+## 为什么叫“colibrì”
-蜂鸟只有几克重,能在原地悬停,并在一天内造访上千朵花。
-这套引擎只用蜂鸟般的配给,就能让 744B 参数的巨人运转:
-25 GB RAM、十二个 CPU 核心,以及对磁盘的大量耐心。
+蜂鸟只有几克重,能在原地悬停,一天要造访上千朵花。这个引擎靠蜂鸟般的口粮让一个 744B 参数的巨人运转起来:25 GB 内存、十二个 CPU 核心,以及对磁盘的大量耐心。
## 致谢
-colibrì 是一个引擎;它运行的智慧是一份馈赠。感谢以开放方式发布前沿级权重的团队:**Z.ai**
-(GLM)、**Moonshot AI**(Kimi)、**Alibaba Qwen**、**MiniMax** 与 **Allen AI**(OLMoE),也感谢
-每一位做过 benchmark、二分定位问题、复现图谱运行或提交补丁的贡献者。这个项目证明了开放权重
-能够带来什么。
-
-本项目在专家放置、压缩与路由方面的实验,也建立在以下开放研究与系统工作的思路和证据之上:
-
-- [REAP](https://github.com/CerebrasResearch/reap) 与
- [EASY-EP](https://github.com/RUCAIBox/EASYEP):输出感知的与特定领域的专家重要性。
-- [SERE](https://github.com/JL-Cheng/SERE):基于相似度的专家重路由;
- [ReMoE](https://github.com/BUAA-OSCAR/ReMoE):感知缓存局部性的路由器微调。
-- [MC-SMoE](https://github.com/UNITES-Lab/MC-SMoE):路由引导的专家合并与压缩。
-- [MoBE](https://github.com/inclusionAI/MoBE) 与
- [D²-MoE](https://github.com/lliai/D2MoE):共享专家基与低秩专家增量。
-- [HybriMoE](https://github.com/PKU-SEC-Lab/HybriMoE):CPU/GPU 混合专家调度;
- [ScMoE](https://arxiv.org/abs/2404.05019):专家通信与计算的重叠;
- [OD-MoE](https://arxiv.org/abs/2512.03927):分布式按需专家加载。
-- [vLLM](https://github.com/vllm-project/vllm)、
- [llama.cpp](https://github.com/ggml-org/llama.cpp) 与
- [kTransformers](https://github.com/kvcache-ai/ktransformers):开放的推理系统与专家卸载工作,
- 使对比得以复现。
-
-引擎也建立在具体的工程成果之上,而不只是思路。以下每一项如今都在代码树中被使用或重新实现:
-
-- [safetensors](https://github.com/huggingface/safetensors):每个引擎读取的容器格式
- (`c/st.h`),包括其 fp8 与 I64 数据类型。
-- [tiktoken](https://github.com/openai/tiktoken):`c/tok.h` 精确地重新实现了它的
- `byte_pair_encode`,合并拼接后词表 id 最小的相邻对,因此源自 tiktoken 的词表不需要 merges 列表。
-- [llama.cpp](https://github.com/ggml-org/llama.cpp):`c/grammar.h` 中的 GBNF 语法子集遵循它的
- 语法与 set-of-stacks PDA,Metal 路径也借用了它的 `newBufferWithBytesNoCopy` 常驻技巧。
-- [vLLM](https://github.com/vllm-project/vllm):引擎逐位置对齐的输出语义参考(例如最终 norm
- 相对于 LM head 的位置)。
-- [transformers](https://github.com/huggingface/transformers):oracle;CI 以它为基准逐 token
- 复现一个随机初始化的模型。
-- [DietGPU](https://github.com/facebookresearch/dietgpu):实验性压缩专家层级(`COLI_ANS`)背后的
- GPU ANS 编解码器。
-- [rocWMMA](https://github.com/ROCm/rocWMMA):HIP 后端把 CUDA 的 `nvcuda::wmma`
- fragment/mma_sync API 映射到它之上(`c/backend_gpu_compat.h`),这让同一份 .cu 源码可以为
- 两家厂商编译。
+colibri 只是一个引擎;它运行的智慧是一份馈赠。感谢以开放方式发布权重的团队:**Z.ai**(GLM)、**Moonshot AI**(Kimi)、**Alibaba Qwen**、**DeepSeek**、**Xiaomi**(MiMo)、**Thinking Machines**(Inkling)、**Allen AI**(OLMoE)、**Convai Innovations**(Laya)、**fastino**(GLiNER2.5-Decide)和 **Cloudflare**(Clef);感谢发布转换后容器的人;也感谢每一位做过基准测试、二分定位问题、复现图谱运行或提交补丁的贡献者。本仓库中的第三方代码及其许可证:[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
## 许可证
-Apache 2.0,Copyright 2026 Vincenzo Fornaro。详见 [LICENSE](LICENSE) 与 [NOTICE](NOTICE)。GLM-5.2 权重由 Z.ai 以 MIT 许可发布。
+Apache 2.0,Copyright 2026 Vincenzo Fornaro。详见 [LICENSE](LICENSE) 与 [NOTICE](NOTICE)。每个模型保留其作者给出的许可证(GLM-5.2 权重由 Z.ai 以 MIT 许可发布;Qwen-Image-2.1 仅限非商业用途)。
diff --git a/README.zh-TW.md b/README.zh-TW.md
index d7ff606f..35e13c71 100644
--- a/README.zh-TW.md
+++ b/README.zh-TW.md
@@ -1,10 +1,10 @@
<p align="center">
- <img src="assets/colibri-logo.svg" width="560" alt="colibrì——小巧引擎,龐大模型">
+ <img src="assets/colibri-logo.svg" width="560" alt="colibrì:小巧引擎,龐大模型">
</p>
<p align="center">
- <a href="https://justvugg.github.io/colibri"><img src="https://img.shields.io/badge/website-justvugg.github.io%2Fcolibri-1f6feb" alt="Website"></a>
- <a href="https://github.com/JustVugg/colibri/releases"><img src="https://img.shields.io/github/v/release/JustVugg/colibri?color=2ea043" alt="Latest release"></a>
+ <a href="https://justvugg.github.io/colibri"><img src="https://img.shields.io/badge/website-justvugg.github.io%2Fcolibri-1f6feb" alt="網站"></a>
+ <a href="https://github.com/JustVugg/colibri/releases"><img src="https://img.shields.io/github/v/release/JustVugg/colibri?color=2ea043" alt="最新版本"></a>
</p>
<p align="center">
@@ -13,740 +13,669 @@
<a href="README.md">English</a> · <a href="README.zh-CN.md">简体中文</a> · 繁體中文 · <a href="README.it.md">Italiano</a> · <a href="README.ja.md">日本語</a>
</p>
-**小巧引擎,龐大模型。**在消費級與異質硬體上執行**前沿 MoE 模型——從 744B 到
-2.8T 參數**——以引擎零相依套件的純 C 實作,將儲存、RAM 與 VRAM 視為統一的推論階層。
-
-目前可執行十個語言模型家族。這裡按引擎計數,而不是按 checkpoint:各自一個 C 檔案,
-共用同一套 `coli chat` / `coli serve` / `coli web` 前端,部分引擎可執行不只一個模型。
-**GLM-5.2/5.3**(744B)、**GLM-5.3-Flash**(321B,含視覺)、**Inkling**(975B)、
-**Kimi K3**(2.8T)、**DeepSeek V4 Flash**(284B)、**DeepSeek V4.1 Flash**(552B,含視覺)、
-**MiMo-V2.6 Flash**(309B,含視覺;同一引擎也執行 **MiMo-V2.6 Pro**,1.02T)、
-**Qwen3.8-Flash-Next**(125B + 51B n-gram)、**Qwen3.6**(35B-A3B;同一引擎也執行
-**Qwen3-Coder-30B-A3B** 與稠密的 **Qwen3.8-27B**,含視覺)以及 **OLMoE**(7B)。
-也能生成圖像:第十一個引擎執行 **Qwen-Image-2.1**,依據文字生成圖片,`coli chat` 直接在終端機中顯示,
-`coli serve` 透過 `POST /v1/images/generations` 提供([qwen-image.md](docs/qwen-image.md))。
-[完整清單 ↓](#other-supported-models)
-
-> **Colibrì 既是今天就能執行的推論引擎,也是一個開放的研究平台。**它的首要目標是在
-> 完整的軟硬體邊界上追求推論側效能——模型格式、記憶體階層、儲存 I/O、配置、排程、核心、
-> 推測解碼以及 CPU/GPU 重疊執行——讓大型模型減少對稀缺硬體的依賴,並降低執行成本。
-
-Colibrì 將 VRAM、RAM 與儲存視為統一的多層階層,並刻意用於驗證激進的系統構想,因此
-**對速度不作 SLA 承諾,對語意則給出硬性保證**:實驗必須透過可重現的端到端測量證明價值;
-預設策略**絕不會在未告知的情況下改變模型精度或路由語意**。高速記憶體不足可以降低速度,
-但不能悄悄重新定義模型。
+**小巧引擎,龐大模型**。colibri 能在你現有的電腦上執行非常大的開放模型。
+一個擁有數千億參數的專家混合(mixture-of-experts)模型,每個 token 只會用到自身的一小部分,
+因此 colibri 把這一部分留在 RAM 中,其餘的部分,也就是專家,則在模型需要時才從硬碟讀取。
+純 C 實作,每個模型家族一個檔案,不需要 GPU。
+
+目前有十三個引擎可以執行。其中十個用於語言模型:**GLM-5.2/5.3**、
+**GLM-5.3-Flash**、**Inkling**、**Kimi K3**、**DeepSeek V4 Flash**、
+**DeepSeek V4.1 Flash**、**MiMo-V2.6 Flash**(以及 Pro)、**Qwen3.8-Flash-Next**、
+**Qwen3.6**(同一引擎也執行 Qwen3-Coder 與稠密的 Qwen3.8-27B)以及
+**OLMoE**。一個用來生成圖片:**Qwen-Image-2.1**。兩個用來回答決策問題:
+**Laya** 與 **GLiNER2.5-Decide**;第三個決策模型 **Clef** 則執行在
+Qwen3.6 引擎上。[我的機器適合哪一個](#which-model-for-my-machine)
```
$ ./coli chat
- 🐦 colibri v1.12.1 — GLM-5.2 · 744B MoE · int4 · streaming CPU
+ colibri v1.12.1 · GLM-5.2 · 744B MoE · int4 · streaming CPU
✓ ready in 32s · resident 9.9 GB
› ciao!
- ◆ Ciao! 😊 Come posso aiutarti oggi?
+ ◆ Ciao! Come posso aiutarti oggi?
```
-## 實際運行畫面
-
-<p align="center">
- <img src="docs/media/colibri-dashboard.png" width="900" alt="colibrì 網頁儀表板——即時指標、硬體面板與專家儲存層級">
-</p>
-<p align="center"><em>網頁儀表板(<code>./coli web</code>),1.12.0 重新設計:一個工作區,底部停靠列切換聊天、System One 模式、
-Brain 頁面和效能分析,支援淺色與深色主題。圖中是 Qwen3.6 在純 CPU 機器上作答,專家從硬碟串流讀取。</em></p>
-
-<p align="center">
- <img src="docs/media/colibri-brio.png" width="900" alt="System One 頁面:文件只讀一次,每個允許的答案各有一個機率,並給出熵">
-</p>
-<p align="center"><em><strong>System One 模式</strong>:同一個模型,只是不再讓它寫。給它一段文件和唯一允許的幾個答案,
-它讀出每個答案的機率,不生成任何 token,並給出一個熵,說明它何時沒有把握。圖中:<strong>request changes,99.9%</strong>,
-熵 0.005,讀取 4 個 token,生成 0 個。</em></p>
-
-<p align="center">
- <img src="docs/media/colibri-brain.png" width="900" alt="大腦頁面:GLM-5.2 的實測專家圖譜繪成一塊皮質,十個可進入的區域">
-</p>
-<p align="center"><em><strong>大腦(Brain)</strong>頁面的 <strong>Explore</strong> 檢視:將 GLM-5.2 的<a href="https://github.com/JustVugg/colibri/issues/175">實測專家圖譜</a>繪成一塊皮質。
-13,260 個已分析專家分為十個區域(Python、SQL、數學、詩歌、法律、中文……);位置取自實測路由親和度,而非學習出的嵌入向量。
-選擇一個區域即可進入。<strong>Live routing</strong> 檢視切換到正在執行的模型:每個專家一格,顏色代表儲存層級,每輪被路由到的專家都會閃白。</em></p>
-
-<p align="center">
- <img src="docs/media/colibri-brain-region.png" width="900" alt="Python 區域內部:1,142 個專家,其中一個被選取並顯示其實測親和度">
-</p>
-<p align="center"><em><strong>Python</strong> 區域內部:1,142 個專家組成的星座,每個都標註了層號和序號。面板顯示其中一個:第 17 層第 178 號專家,
-一個熵為 3.13 的通才,其實測親和度為 Python 20.2%、JSON 14.6%、對話 14.2%、SQL 13.3%。</em></p>
-
-<p align="center">
- <img src="docs/media/colibri-profiling.png" width="900" alt="效能剖析頁面:引擎在每一輪中的時間去向">
-</p>
-<p align="center"><em><strong>效能剖析(Profiling)</strong>頁面:引擎在每一輪中的時間去向,按階段劃分,並以最近 30 輪作為趨勢。
-此處為 CPU 機器上的 Qwen3.6:36 個提示詞元與 55 個生成詞元共用時 19.0 秒,2.9 tok/s,其中 11.4 秒的磁碟服務與計算重疊。</em></p>
-
-## 研究使命
-
-有了 Colibrì,私有部署的前沿模型不再受限於能否取得超大規模雲端業者等級的硬體。
-
-憑藉多層階層(multitiering)特性,Colibrì **透過積極最佳化推論引擎的各條功能管線,消除對專有硬體的依賴**。
-
-我們的具體使命包括:改變權重的表示與移動方式,決定哪些內容常駐 VRAM、RAM 或儲存,重疊異質運算,
-降低啟動與同步開銷,利用稀疏性與重用,並驗證新的解碼演算法。傳統做法不是免責理由,
-微基準快也不是採用理由;最終依據是在真實機器上的端到端推論,同時測量正確性、品質、
-吞吐、延遲、記憶體與成本。
-
-它帶來的實際結果是**可及性**:在既有硬體上執行 744B 模型,即時觀察每個專家,並直接修改實作。
-不是從 API 租用智慧,而是*持有*它:探測、測量和改進它。引擎刻意維持足夠小,讓任何願意測量
-的人都可能貢獻下一項有效最佳化。
-
-## 核心技術與實測結論
-
-- **統一階層,不受單一層級容量限制。**VRAM、RAM 與 NVMe 是同一份權重的不同配置階層;
- 高速記憶體不足只影響速度,不改變模型語意。
-- **權重的 JIT。**實測路由熱度驅動逐層 LRU、學習型熱門專家固定區和提前一層的預先載入,
- 無需載入所有專家。它在可重複負載上有收益,但歷史可能過度擬合,預先載入在部分主機上
- 也可能負最佳化,因此它們是需要測量的策略,不是效能承諾。
-- **I/O 本身就是引擎的一部分。**專家批次聯集、讀算重疊、`O_DIRECT` 與加權雙 SSD
- 分流直接最佳化串流路徑,而不是假裝儲存延遲不存在。`O_DIRECT` 取決於磁碟,雙 SSD
- 仍需要更多社群端到端 A/B。
-- **異質執行。**CPU、CUDA、Metal、NUMA 記憶體以及專家的部分或全部常駐共用一個執行環境,
- 可依機器條件組合;最佳組合取決於算力、頻寬、常駐率與負載。
-- **壓縮狀態,不竄改模型。**逐 token 精確的前向驗證、縮小 57 倍的 MLA KV 狀態、
- 持久化熱會話與忠實 DSA,讓最佳化始終受正確性約束。這些是記憶體、延遲和正確性屬性,
- 不是籠統的吞吐承諾。
-- **必須證明收益的推測解碼。**原生 MTP 與文法強制草稿均接受端到端測量;
- 接受率無法覆蓋驗證成本時可以關閉。
-
-## 開放猜想、實驗與參與方式
-
-在受控的端到端 A/B 證明之前,Colibrì 將每項最佳化都視為猜想。目前主要問題如下:
-
-| 猜想 | 目前證據 | 仍需完成的實驗 |
-|---|---|---|
-| 路由歷史能比普通 LRU 更好地配置專家 | 學習型固定區能改善重複負載,但也會對 prompt 過度擬合 | 在程式碼、對話、多語言和長上下文負載上做留出集、跨會話 A/B |
-| 多顆 SSD 能將獨立頻寬轉化為解碼速度 | 兩顆獨立 NVMe 實測解碼 +37.5%;經加權分流後,較慢的第三顆硬碟影響持平([測量數據](docs/multidisk.md#what-has-been-measured)) | 在不同硬碟速度、控制器配置與快取狀態下重現 |
-| 硬體感知規劃器能自動接近每台機器的最佳配置 | 目前已偵測 RAM/VRAM 預算與多個後端 | 將自動方案與參數掃描對比,涵蓋筆電、工作站、NUMA 和多 GPU 主機 |
-| 無損或品質受控的表示能充分減少權重搬運 | 已有格式與量化消融,並設置正確性/品質門檻 | 同時重現品質、搬運位元組、延遲和每個有效 token 成本,而非只看壓縮率 |
-| 路由感知推測能在接近全常駐前獲利 | MTP 與文法草稿可用,但 MTP 在約 85% expert hit 時也實測過 -32% | 繪製接受率、命中率、批次聯集與草稿深度的盈虧邊界 |
-| CPU/GPU 重疊能隱藏傳輸與同步,而非僅轉移瓶頸 | CUDA 與 Metal 有成功數據,但強 CPU 和低常駐率會抹平收益 | 在 PCIe、統一記憶體與全常駐機器上做逐階段 profile 和單變數 A/B |
-
-想參與就任選一行,負結果也請公開。請記錄硬體、commit、模型容器、完整指令、prompt、
-快取狀態、吞吐、TTFT、expert hit、讀取位元組數與品質檢查;每次只改一個變數,重複執行並附上
-原始日誌。先閱讀 [CONTRIBUTING.md](CONTRIBUTING.md),對照
-[benchmark 協議](docs/benchmarking.md),然後
-[建立實驗 issue](https://github.com/JustVugg/colibri/issues/new)。
-在這裡,一個受控的失敗比一個無法解釋的高數字更有價值。
-
-## 核心概念
-
-744B 的專家混合(Mixture-of-Experts)模型,每個 token 只會啟用約 40B 參數——
-其中每個 token 之間會變動的只有約 11 GB(被路由到的專家):
-
-<p align="center">
- <img src="docs/media/sparse.png" width="880" alt="每個 token 只會啟用約 5.4% 的參數">
-</p>
+<a id="get-started"></a>
+<a id="the-one-step-way"></a>
-所以模型不必完整**放進**高速記憶體,而是需要正確**配置位置**:
+## 一步開始使用
-- **稠密部分**(注意力、共享專家、嵌入——約 17B 參數)以 int4
- **常駐 RAM**(約 9.9 GB);
-- **19,456 個路由專家**(75 個 MoE 層 × 256,加上 MTP head;每個在 int4 下約 19 MB)
- **存放在硬碟**(約 370 GB),並**隨需串流載入**,搭配逐層 LRU 快取、
- 會學習的熱門專家固定儲存區,以及選用的 VRAM 層級。
+你需要一台記憶體至少 **8 GB RAM** 的電腦(16 GB 以上更好),
+最小的模型需要**硬碟上有 22 GB 可用空間**,另外還需要網路連線。顯示卡不是必要的。
-可以把核心演算法理解為**權重的 JIT**。編譯器的 JIT 從不編譯整個程式:它觀察實際執行的部分,
-及時編譯熱點路徑。colibrì 對 744B 的參數空間下了同樣的賭注:參數不是需要一直持有的常駐狀態,
-而是**需要分級調度的資料**,在路由器證明需要它們的那一刻,於異質儲存階層(VRAM / RAM / NVMe)
-之間就位。實測路由熱度決定哪些專家進入哪一層級,路由器提前一層執行,讓預先載入隱藏調度延遲;
-而且像 JIT 一樣,引擎會學習你的工作負載:執行得越多,正確的專家就越熱。之所以可行,是因為
-路由具有可測量的結構(見[專家圖譜](https://github.com/JustVugg/colibri/issues/175)),
-而結構是可以快取的。
+**Windows**
-引擎由主 C 檔(`c/colibri.c`)與多個標頭檔模組組成。不需要 BLAS,
-執行階段不需要 Python,也不需要 GPU。
+1. 在這個頁面上按 **Code**,再按 **Download ZIP**,然後解壓縮。
+2. 在解壓縮後的資料夾中按兩下 **`START-HERE.bat`**。如果缺少 Python,
+ 它會提議幫你安裝。
-### 本機叢集模式
-
-協調節點(coordinator)在本機保留 token 生成、路由與 KV 狀態,而以硬碟為後端的專家 worker
-在其他 Mac 上執行被路由的 FFN。一層的路由批次聯集以一個持久 TCP 請求傳送,因此一個 token
-不會為每個專家各付出一次往返。
-
-啟動選用的註冊服務:
+**Linux**(Ubuntu 與 Debian;其他發行版也有相同的套件,
+只是名稱不同)
```bash
-./coli cluster coordinator --host 0.0.0.0 --port 8765
+sudo apt install git python3 build-essential
+git clone https://github.com/JustVugg/colibri
+cd colibri
+./start-here.sh
```
-在每個 worker 上,本機需有同一個已轉換的模型:
+**macOS**(需要 [Homebrew](https://brew.sh))
```bash
-./coli cluster worker --model /nvme/glm52_i4 --port 9100 \
- --coordinator http://COORDINATOR:8765 --advertise-host WORKER_IP
+xcode-select --install
+brew install libomp git python
+git clone https://github.com/JustVugg/colibri
+cd colibri
+./start-here.sh
```
-以探索模式執行協調節點,或為靜態部署提供 `--cluster-workers
-HOST:PORT,...`:
+你只需要回答一個問題:要用哪個模型;直接按 Enter 就會採用推薦。
+接著安裝程式會:
+
+1. **檢查你的機器**:RAM、硬碟可用空間、CPU 與 GPU;
+2. **推薦一個放得下的模型**:模型中永遠留在 RAM 的部分,加上最少量的專家快取,
+ 必須放得進你的 RAM,下載的檔案也必須放得進你的硬碟;
+3. **取得引擎**:有編譯器時,它會針對你的機器建置引擎;沒有的話,
+ 就下載預先建置好的版本,在 CPU 上執行。在值得的情況下,它會為你的 GPU 建置:
+ 在 Linux 上,若是 NVIDIA 顯示卡且已安裝 CUDA toolkit,就用 CUDA,
+ 否則用 Vulkan。遇到獨立顯示卡時一律如此;遇到與 CPU 共用 RAM 的內建顯示晶片時,
+ 則只針對實測在那裡比較快的模型
+ (Qwen3.6、Qwen3-Coder 與 Qwen3.8-Flash-Next)。如果缺少某個套件,
+ 它會印出安裝該套件的確切指令,並先繼續使用 CPU;之後再執行一次安裝程式,
+ 它就會為 GPU 重新建置;
+4. **下載模型**,顯示進度並支援續傳:你隨時可以中斷,
+ 再執行一次就會從中斷的地方繼續;
+5. **啟動 colibri,並在你的瀏覽器中開啟儀表板**,
+ 同時印出其他應用程式可以使用的位址:
-```bash
-./coli serve --model /nvme/glm52_i4 \
- --cluster-coordinator http://127.0.0.1:8765
+```
+Starting colibri
+ Browser: http://127.0.0.1:8000/
+ OpenAI base URL: http://127.0.0.1:8000/v1
+ Anthropic base URL: http://127.0.0.1:8000
+ stop: press Ctrl+C here (or close this window)
```
-除非設定了 worker,否則傳輸層保持關閉,現有的單機路徑不受影響。稠密層分片與
-瀏覽器/WebGPU worker 是另行跟進的擴充點。
-
-## 運作方式
-
-### 每個 token 的處理路徑
+**下一次**,再執行一次 `START-HERE.bat` 或 `./start-here.sh` 即可:colibri 會直接啟動,
+不需要下載,也不需要建置。`c/coli status` 會顯示已安裝的內容以及是否正在執行,
+`c/coli stop` 則會停止它(在 Windows 上是 `c\coli.cmd status` 與
+`c\coli.cmd stop`)。
-<p align="center">
- <img src="docs/media/token-path.png" width="880" alt="路由 → 聯集 → 配置 → 重疊執行 → 學習">
-</p>
+選項放在 `./start-here.sh` 或 `START-HERE.bat` 後面:
-每個 token 的每一層都會走過相同的五個步驟。設計目標是讓
-**配置只決定速度**——無論專家是從 VRAM 或硬碟回應,路由器的決策與權重精度都完全相同。
+| 選項 | 作用 |
+|---|---|
+| `--list` | 列出每個模型與這台機器的對照,以及某個模型為什麼放不下 |
+| `--model ID` | 安裝指定的模型(id 列在[下面的表格](#which-model-for-my-machine)中) |
+| `--yes` | 不詢問任何問題:直接採用推薦 |
+| `--dir DIR` | 把模型放在另一顆硬碟上(預設為 `~/colibri-models`) |
+| `--backend vulkan`、`cuda` 或 `cpu` | 自行選擇引擎的建置方式;`--no-gpu` 等同於 `--backend cpu` |
+| `--model-dir DIR` | 使用你已經下載好的模型 |
+| `--reconfigure` | 改選另一個模型 |
-### 統一記憶體階層,取代單一記憶體門檻
+每個步驟的詳細說明:[docs/quickstart.md](docs/quickstart.md#the-one-step-way)。
-<p align="center">
- <img src="docs/media/tiers.png" width="880" alt="VRAM/RAM/NVMe 三層專家常駐架構">
-</p>
+### 如果出了問題
-<a id="dual-ssd-two-copies-of-the-model-twice-the-read-bandwidth"></a>
-
-### 多顆 SSD:從不只一顆硬碟串流讀取模型副本
+| 你看到的情況 | 該怎麼做 |
+|---|---|
+| 下載到一半停止了 | 再執行一次相同的指令:它會從硬碟上已有的位元組接著下載 |
+| `to use the GPU through ..., first run: <command>` | 執行那條指令,然後再執行一次安裝程式:它會為 GPU 重新建置,不會重新下載 |
+| 用 CUDA 建置時出現 `the ... build failed`,例如已安裝的 CUDA toolkit 不再支援這張顯示卡時出現的 `Unsupported gpu architecture` | `./start-here.sh --backend vulkan` 會透過 Vulkan 使用這張顯示卡;`--no-gpu` 則留在 CPU 上 |
+| `needs N GB free for the download` | 用 `--dir` 指定一個位於較大硬碟上的資料夾 |
+| 在 WSL 上,模型資料夾位於 `/mnt/c` 底下 | 把它放在 Linux 磁碟上(預設的 `~/colibri-models`):`/mnt/c` 慢上好幾倍 |
+| 其他任何問題 | `c/coli logs -n 50` 會顯示伺服器日誌,`c/coli logs --install` 則顯示安裝程式的日誌;請附上安裝程式最後印出的幾行,開一個 [issue](https://github.com/JustVugg/colibri/issues) |
-當解碼受硬碟限制時,**第二顆 SSD** 會有幫助:在上面放一份模型副本,讓引擎同時從兩顆硬碟讀取。
-以 GLM-5.2 為例,在原始碼 checkout 的 `c/` 目錄下(或在解壓後的發布套件中):
+### 讓你的 AI 助手幫你安裝
-```bash
-COLI_MODEL_MIRROR=/second/glm52_i4 python3 ./coli chat --model /fast/glm52_i4
-```
+如果你使用 AI 程式設計助手,它可以替你完成上述所有步驟。這樣問它:
-引擎會在啟動時測量各顆硬碟,以決定讀取分配的權重。緩衝讀取採用確定性的專家路由;符合條件的
-直接讀取可以把一個專家條帶化分布到多個副本上。獨立的硬碟提供的是頻寬餘裕,而不是有保證的
-token 速率倍數:共用控制器、快取命中與運算都可能限制收益。Bash 與 PowerShell 範例、實測收益
-與限制,以及與單碟的對比,請見[多磁碟指南](docs/multidisk.md)。值得了解的細節:
+> 請依照 https://github.com/JustVugg/colibri 上的 docs/AI_SETUP.md,在這台機器上安裝並設定 colibri
-- 鏡像會在**啟動時驗證**(每個檔案的大小與 safetensors 標頭必須與主副本逐位元組一致);不一致或缺少的檔案仍由主副本提供,因此**部分鏡像也可以**:較小的第二顆 SSD 可以提供它所持有的 shard;
-- 鏡像**從不寫入**:`.coli_usage`、`.coli_kv` 與所有 sidecar 都保留在主副本上;
-- 鏡像讀取出錯時會退回主副本(一條警告,不會當機),因此執行中拔掉第二顆硬碟只會降級,不會讓伺服器結束;
-- 路由從不改變 token:兩份副本逐位元組相同;啟用 `PROF=1` 可看到 `MIRROR:` 效能計數器,顯示每顆硬碟提供了多少 GB。
+[docs/AI_SETUP.md](docs/AI_SETUP.md) 把每個步驟都寫成一條指令交給助手,
+每條指令都會產生機器可讀的結果,並要求助手在下載模型或安裝系統套件之前先詢問你。
+支援 Model Context Protocol 的助手則可以改用 colibri 的 MCP 伺服器:
+`coli mcp` 提供偵測硬體、推薦模型、安裝、啟動、停止與檢查 colibri 的工具
+([docs/MCP_SERVER.md](docs/MCP_SERVER.md))。
-同一套引擎涵蓋完整硬體範圍:在 25 GB 筆電上,一切都從硬碟串流載入
-(慢,但結果正確);在大型主機上,則可讓整組專家常駐
-(`CUDA_EXPERT_GB=auto PIN_GB=all`),讓硬碟完全退出解碼路徑。
-兩端之間有一層**學習型快取**:引擎會記錄*你的*工作負載路由到哪些專家
-(`.coli_usage`,每輪更新),並自動固定最熱門的專家——colibrì 確實會越用越快。
-在多插槽主機上,`COLI_NUMA=1` 會將常駐權重交錯分配到各記憶體控制器
-([#82](https://github.com/JustVugg/colibri/issues/82))。
+### 或者手動安裝
-對於放不下整個模型的第二顆硬碟,Colibri 可以根據它已經學到的專家歷史,為部分鏡像排序。
-先執行幾個有代表性的 prompt,讓 `.coli_usage` 反映實際負載,然後規劃、暫存並驗證鏡像:
+若想自己決定每一個步驟(預先建置的發布版本或從原始碼建置、下方表格中的任何模型,
+然後是 `coli chat`、`coli web` 或 `coli serve`),
+請見[手動安裝](#install-by-hand),
+或參考逐一說明各平台步驟的 [Quick Start 指南](docs/quickstart.md)。
-```bash
-./c/coli mirror plan --model /fast/glm52_i4 --mirror /second/glm52_i4 \
- --budget-gib 200 --reserve-gib 20
-./c/coli mirror stage --model /fast/glm52_i4 --mirror /second/glm52_i4 \
- --budget-gib 200 --reserve-gib 20
-./c/coli mirror verify --model /fast/glm52_i4 --mirror /second/glm52_i4
-```
+## colibri 是什麼,以及為什麼
-規劃器直接讀取 safetensors 標頭,依循 `COLI_MODEL_DIRS` 中的分割模型目錄,並優先選擇能服務
-最熱路由專家的 shard。暫存從不改動主模型:它透過暫存檔複製,保留所要求的剩餘空間,
-以 SHA-256 驗證每個 shard,從不刪除既有的鏡像 shard,並且只在所選鏡像就緒後才以不可分割
-(atomic)的方式發布回執。
-
-### 絕不為同一次硬碟讀取等待兩遍
-
-快取未命中的成本很高,因此引擎大部分的巧思都用來避免或重疊處理這些讀取:
-每個專家的三個矩陣相鄰儲存,並以一次 `pread` 讀取;有界非同步 I/O pool
-(`PIPE=1`,預設啟用)會在常駐專家運算時載入缺少的專家;批次位置只讀取每個
-不重複專家一次(**批次聯集**);路由前瞻執行緒(`PILOT=1`)則預先載入下一層專家——
-實測顯示,路由結果提前一層時有 **71.6% 的可預測性**。
-在 GPU 上,常駐管線(`COLI_CUDA_PIPE=2`)讓殘差流跨層保留在裝置端,
-使 CPU 專家迴圈不中斷;在 Apple Silicon 上,實驗性的
-[Metal 後端](docs/metal.md)會用統一記憶體 GPU 執行批次專家運算;
-[Vulkan 後端](docs/vulkan.md)則把專家層級、稠密投影與 MLA 注意力核心帶到任何具有
-Vulkan 1.2 驅動程式的 GPU 上,包括透過 Mesa/RADV 的 AMD 顯示卡(對於廠商軟體堆疊已不再支援的
-顯示卡,例如 RX 580,它是唯一的後端;在 RDNA4 上與 ROCm 不相上下,請見[基準測試說明](docs/vulkan.md))。
-其餘所有引擎現在也會在 `VK=1` 建置中透過 `COLI_VULKAN=1` 使用同一後端放置常駐矩陣;
-CI 會將其與 CPU 的 token 對照檢查,但在它們首次實測的真實 GPU(內建顯示晶片 Radeon 780M)上,
-目前比 CPU 慢([其他引擎](docs/vulkan.md#the-other-engines))。
-
-> **在真實 NVMe 上,請實測 `DIRECT=1`。** O_DIRECT 繞過頁面快取,在帶 DRAM 快取且頻寬有餘裕
-> 的硬碟上往往有顯著收益(在一台 Blackwell/Windows 機器上搭配 `PIPE=1` 實測解碼 +34%;
-> 在 GB10 上 iobench 為 4.25→9.69 GB/s),但它取決於硬碟:QLC/無 DRAM 或虛擬化的磁碟
-> 可能沒有收益甚至變慢。先試一試,保留你的硬體真正受益的設定。
-
-### 忠實模型,壓縮狀態
-
-前向傳遞已透過 `transformers` oracle 驗證(teacher-forcing 通常為
-30-32/32;tiny oracle 中有兩個位置是浮點數近似平手,結果會受工具鏈影響)。
-MLA 注意力儲存壓縮後的 KV 狀態——每個 token 為 576 個浮點數,而非 32,768 個
-(**縮小 57×**)——並跨重新啟動持久保存
-(`.coli_kv`):對話可暖啟恢復,不需重新 prefill,結果與不中斷的工作階段
-逐位元組相同。DSA 稀疏注意力(GLM-5.2 的 lightning indexer)已忠實實作,
-並透過強制選取所有 key,驗證可精確重現稠密注意力。
-
-### 如實呈現推測式解碼
-
-GLM-5.2 原生 MTP head 會起草 token,再由主模型以一次批次前向傳遞驗證——
-條件合適時每次 forward 可產生 2.2–2.8 個 token。兩條得來不易的規則已成為預設值:
-MTP head 必須是 **int8**(int4 head 的接受率會崩落到 0–4%,見
-[#8](https://github.com/JustVugg/colibri/issues/8)),且草稿與驗證必須計算
-**相同函數**——`SPEC_PIN=1` 會把兩者固定在同一 kernel family
-(完整鑑識過程見 [#163](https://github.com/JustVugg/colibri/issues/163))。
-文法強制草稿([`GRAMMAR=file.gbnf`](docs/grammar-draft.md))可在受限 JSON 輸出中,
-以近乎免費的成本提高接受率。推測式解碼是否帶來淨收益取決於快取熱度——請實測,
-若不划算就使用 `DRAFT=0`。
-
-驗證批次還可以透過 `COLI_EXACT_VERIFY=1` 選用**精確注意力核心**
-([#689](https://github.com/JustVugg/colibri/issues/689)):CPU 上 MLA-absorb 的 score 與
-context 內積改為累加整數乘積並只捨入一次,因此驗證列中的近似平手在每台主機上都會得到相同的
-結果;在 tiny oracle 上速度約為 0.6x tok/s(內積本身約為浮點迴圈的 5–7x)。需要了解兩點
-限制:使用量化 KV 快取(`tq1`、TQ 或 int8 KV)時,context 內積仍走浮點路徑,因此那裡不提供
-精確性;而真正的近似平手翻轉目前只是推論,尚未在 GLM-5.2 的 n=64 上實際捕捉到。
-
-## 實際成果
+專家混合模型在硬碟上非常龐大,但每個 token 用到的部分很小。GLM-5.2 有
+744B 參數,每個 token 大約使用 40B,而其中只有約 11 GB 會隨著 token 改變:
+也就是路由專家。
<p align="center">
- <img src="docs/media/ladder.png" width="880" alt="各硬體等級的實測解碼速度">
+ <img src="docs/media/sparse.png" width="880" alt="每個 token 只有約 5.4% 的參數處於啟用狀態">
</p>
-同一套引擎、同一個 int4 容器——硬體只會改變專家的存放位置。
-[完整 benchmark 表格](docs/benchmarks.md)中的重點如下:
+因此,模型不需要完整放進高速記憶體,而是需要被**妥善配置**。
+稠密部分(注意力、共享專家、嵌入)留在 RAM 中。路由專家留在硬碟上,
+在路由器需要時才讀取,中間經過一個會學習你的工作用到哪些專家的快取。
+如果有 GPU,它會存放最熱門的專家與稠密層。權重放在哪裡,只會改變答案出現的速度,
+不會改變產生答案的是哪些權重,也不會改變路由器的決策。
+
+為什麼:為了在人們已經擁有的硬體上執行這種規模的模型,為了觀察它們如何運作
+(儀表板會在每個專家被觸發時把它顯示出來),也為了讓引擎維持得夠小,
+讓任何人都能測量它、讓它變得更快。colibri 同時也是一個開放的研究平台:
+一項最佳化必須以可重現的端到端測量來證明自己的價值,
+而預設策略絕不會在不告知的情況下改變模型精度或路由語意。
+高速記憶體較少可能會犧牲速度,但絕不能悄悄地重新定義模型。
+詳細內容請見[運作原理](#how-it-works)。
+
+<a id="which-model-for-my-machine"></a>
+
+## 我的機器適合哪個模型
+
+安裝程式會推薦能在你的機器上從 RAM 執行、能力最強的模型,
+並在它正下方列出從硬碟串流讀取的更大模型。
+`./start-here.sh --list` 會把所有模型與你的機器逐一對照列出。下面的表格依據安裝程式本身的目錄
+([`c/setup_catalog.py`](c/setup_catalog.py));
+下載大小是 Hugging Face 為每個儲存庫列出的大小。
+
+- **RAM** 是兩個數字:低於第一個數字時模型無法啟動,
+ 達到第二個數字時就能以實測的速度執行。
+- **GPU** 是安裝程式能為該引擎建置的後端([GPU](#gpus))。
+ *含內建顯示晶片* 表示它也會使用內建顯示晶片,因為這些引擎在那裡實測比較快;
+ 其他引擎只使用獨立顯示卡。
+- **實測** 是在所列機器上計時的結果,聊天模型指的是解碼速度。
+ 字母代表表格下方列出的機器。空白表示還沒有人測量過。
+
+**小型模型,從 RAM 執行**
+
+| 模型 | `--model` | 下載 | RAM | GPU | 實測 |
+|---|---|---|---|---|---|
+| **Qwen3.6-35B-A3B**:支援思考與工具的聊天 | `qwen36-35b` | 23 GB | 10 / 20 GB | CUDA、Vulkan(含內建顯示晶片) | CPU 上 6.0 tok/s,在內建顯示晶片上用 Vulkan 為 9.9(A);用 CUDA 為 30.0(C) |
+| Qwen3-Coder-30B-A3B:程式碼與工具呼叫,不含思考 | `qwen3-coder-30b` | 19 GB | 8 / 18 GB | CUDA、Vulkan(含內建顯示晶片) | 所有專家都在 RAM 中時 8.5-9.6 tok/s,每層 32 個時 5.1(A,CPU) |
+| **Qwen-Image-2.1**:文字生成圖片,非商業授權 | `qwen-image-2.1` | 33 GB | 12 / 18 GB | Vulkan | 一張 768x512 的圖片 2 分 40 秒(8 個 Zen 4 核心,CPU) |
+
+**大型模型,專家從硬碟串流讀取**(速度由硬碟決定:
+快速的 NVMe 硬碟幫助最大)
+
+| 模型 | `--model` | 下載 | RAM | GPU | 實測 |
+|---|---|---|---|---|---|
+| DeepSeek V4 Flash REAP 150B:256 個專家中的 132 個 | `deepseek-v4-flash-reap` | 85 GB | 16 / 32 GB | CUDA、Vulkan | |
+| **DeepSeek V4 Flash**(284B):支援工具 | `deepseek-v4-flash` | 167 GB | 16 / 32 GB | CUDA、Vulkan | 32 GB 時 0.93 tok/s(Ryzen 7 5800X),63 GB 時 1.24(Ryzen 9 5950X),僅用 CPU;用 CUDA 為 1.5-1.6(RTX 5080,32 GB,兩顆 NVMe) |
+| **MiMo-V2.6 Flash**(309B):視覺與工具 | `mimo-v2.6-flash` | 172 GB | 32 / 52 GB | Vulkan | 2.34-3.37 tok/s(A,CPU) |
+| **Qwen3.8-Flash-Next**(125B + 51B n-gram):視覺與工具 | `qwen38-flash-next` | 186 GB | 24 / 32 GB | CUDA、Vulkan(含內建顯示晶片) | 每層 32-96 個專家時 1.91-2.56 tok/s;使用選用的 int4 專家時 3.99(A,CPU) |
+| **GLM-5.2**(744B):參考模型,含 MTP head | `glm-5.2` | 429 GB | 16 / 24 GB | CUDA、Vulkan | 25 GB 筆電上冷啟動 0.05-0.1 tok/s;128 GB 的 Ryzen AI Max+ 395 上 1.83;6x RTX 5090 上 9.0-9.2 |
+| GLM-5.3(744B):同一引擎,不含 MTP head | `glm-5.3` | 419 GB | 16 / 24 GB | CUDA、Vulkan | |
+| **Inkling**(975B):int4 專家,bf16 稠密權重 | `inkling` | 514 GB | 按下載格式為 120 / 128 GB;經過[稠密部分轉換](docs/inkling.md)後為 25 GB | CUDA、Vulkan | 0.25 tok/s(Ryzen 9 7900,187 GB,RTX A6000) |
+| MiMo-V2.6 Pro(1.02T):視覺與工具 | `mimo-v2.6-pro` | 564 GB | 54 / 64 GB | Vulkan | 0.66-0.79 tok/s(A,CPU) |
+| **Kimi K3**(2.8T):最大的模型 | `kimi-k3` | 1.56 TB | 32 / 64 GB | CUDA、Vulkan | 每個 token 約 9.4 秒,專家讀取速度 6.3 GB/s |
-- **6× RTX 5090,全部常駐:**解碼 5.8–6.8 tok/s,TTFT 約 13 秒
- ([實驗紀錄](docs/experiments/glm52-6x5090-2026-07-12.md));
-- **128 GB、僅使用 CPU 的桌上型電腦:**暖機後約 1.8 tok/s
- ([#200](https://github.com/JustVugg/colibri/issues/200));
-- **單張 RTX 5070 Ti 的筆電級電腦:**透過 GPU 常駐管線達到 1.07 tok/s
- ([#273](https://github.com/JustVugg/colibri/issues/273));
-- **25 GB 開發機:**冷啟動 0.05–0.1 tok/s——這是專案起步時已證實的下限,
- 也仍是如實呈現的基準。
-
-品質來自測量,而非假設:int4 容器的量化成本,以及 scale granularity/rotation
-消融實驗,收錄於 [docs/benchmarks.md](docs/benchmarks.md#quality-benchmark)、
-[#108](https://github.com/JustVugg/colibri/issues/108) 與
-[#81](https://github.com/JustVugg/colibri/issues/81)。
+<a id="other-supported-models"></a>
-## 開始使用
+**手動:下載後還需要一個轉換或準備步驟**
-你需要兩樣東西:**程式本體**(幾百 KB)與**模型**(429 GB)。各平台的逐步
-指引請見 [Quick Start 指南](docs/quickstart.md)。
+| 模型 | 下載大小,以及在硬碟上的大小 | RAM | GPU | 實測 |
+|---|---|---|---|---|
+| **OLMoE**(7B):小型模型,適合用來熟悉工具 | 14 GB,轉換為 int8 後 7 GB | 8 GB | Vulkan | 22-23 tok/s(A,CPU) |
+| Qwen3.8-27B(稠密):文字與圖片 | 56 GB,轉換後 51 GB | int4 時 20 GB,int8 時 30 GB | Vulkan | int4 時 3.45 tok/s,int8 時 2.1(16 執行緒的 CPU 伺服器) |
+| **GLM-5.3-Flash**(321B):視覺與工具 | 328 GB,逐 shard 轉換為 195 GB | 25 GB | CUDA、Vulkan | 暖機後每個 token 約 20 秒,冷啟動 44 秒(6 核心,25 GB,普通硬碟) |
+| **DeepSeek V4.1 Flash**(552B):視覺與工具,不需轉換,但需要一次性的準備步驟 | 510 GB | 約 18 GB 加上專家快取(每層 8 個時峰值 24.8 GB) | Vulkan | 0.21-0.24 tok/s(16 執行緒的 CPU 伺服器,容納 68% 的專家) |
-### 一步完成
+**決策模型**(它們回答 [System One](#system-one-a-decision-with-a-probability) 問題,不能聊天)
-**Windows:** 下載儲存庫(**Code** 中的 **Download ZIP**,或 `git clone`),解壓縮後
-雙擊 **`START-HERE.bat`**。
-**Linux 與 macOS:**
+| 模型 | 下載大小,以及在硬碟上的大小 | RAM | GPU | 實測 |
+|---|---|---|---|---|
+| **Laya**(Convai Innovations),英文 | 0.85 GB | 1.7 GB | CPU | 一個問題 219 ms,三個問題 882 ms(B) |
+| **GLiNER2.5-Decide**(fastino),英文 | 1.95 GB | 1.9 GB | CPU | 一個問題 294 ms,三個問題 897 ms(B,有負載時) |
+| **Clef**(Cloudflare):帶有決策頭的 Qwen3.8-27B,也能聊天 | 55 GB,轉換後 52 GB | int4 時 19 GB 到 f16 時 55 GB | CPU | int8 時每個請求 20.4 秒(A) |
+
+機器:
+**A** 是一台 Ryzen 7 PRO 8700GE 桌上型電腦(8 核心,61-64 GB DDR5,NVMe,
+內建顯示晶片 Radeon 780M);
+**B** 是一台 i7-1355U 筆電;
+**C** 是一張裝在 Threadripper 3945WX 主機中的 RTX 3070 8 GB,稠密層與
+DeltaNet 層都放在顯示卡上(per-row int4 容器)。
+每個數字都來自 [docs/](docs/) 中該模型的頁面,
+或來自[基準測試表格](docs/benchmarks.md),並附有確切的設定。
+
+每個家族都有自己的頁面:[qwen36.md](docs/qwen36.md)(Qwen3.6、Qwen3-Coder、
+Qwen3.8-27B)、[qwen38.md](docs/qwen38.md)、[deepseek-v4.md](docs/deepseek-v4.md)、
+[deepseek-v41.md](docs/deepseek-v41.md)、[mimo.md](docs/mimo.md)、
+[glm53-flash.md](docs/glm53-flash.md)、[inkling.md](docs/inkling.md)、
+[kimi_k3.md](docs/kimi_k3.md)、[qwen-image.md](docs/qwen-image.md)、
+[laya.md](docs/laya.md)、[gliner_decide.md](docs/gliner_decide.md)、
+[clef.md](docs/clef.md),GLM-5.2 則在 [Quick Start](docs/quickstart.md#3-get-the-model) 中。
+與已支援模型架構相同的 checkpoint,例如在 Qwen3.6 引擎上執行的
+KAT-Coder v2.5,不需修改即可執行。
+
+<a id="gpus"></a>
+
+## GPU
+
+### 不需要 GPU
+
+每個引擎都能在 CPU 上執行,不需要安裝任何其他東西。GPU 是一個存放權重、
+速度更快的地方,而不是必要條件:大型模型的速度由硬碟決定,
+小型模型則由 RAM 決定。
+
+### Vulkan:任何 GPU
+
+每個 MoE 引擎都能以兩種方式使用任何具備 Vulkan 1.2 驅動程式的 GPU
+(AMD、Intel、NVIDIA,內建或獨立皆可):
+
+- **專家層級**:GPU 記憶體中的路由專家快取,啟動時依據你過去的對話用到的專家填入,
+ 並在你聊天時持續調整。GPU 計算它持有的專家,同時 CPU 計算其餘的專家;
+- **稠密鏈**:把整個層錄製成一次 GPU 提交,
+ 模型的執行狀態從一層到下一層都保留在 GPU 上。
+
+在機器 A 的內建顯示晶片 Radeon 780M 上實測,每次執行前都把模型檔案從頁面快取中清除,
+解碼 100 個 token
+([vulkan.md](docs/vulkan.md#the-chain-on-a-radeon-780m)):
+
+| | CPU | Vulkan,專家層級 | Vulkan,專家層級與稠密鏈 |
+|---|---|---|---|
+| Qwen3.6-35B-A3B,解碼 | 6.0 tok/s | 8.0 tok/s | **9.9 tok/s** |
+| Qwen3.6-35B-A3B,512 個 token 的提示 | 35.7 秒 | 12.2 秒 | **9.5 秒** |
+| Qwen3.8-Flash-Next(int4 專家),解碼 | 3.5 tok/s | **3.8 tok/s** | 3.2 tok/s |
+| Qwen3.8-Flash-Next,512 個 token 的提示 | 43.6 秒 | 38.7 秒 | **30.1 秒** |
+| OLMoE,解碼(暖機) | **23.1 tok/s** | 12.8 tok/s | 17.3 tok/s |
+
+內建顯示晶片與 CPU 共用 RAM。它節省的是它所持有的那些專家的運算量與硬碟讀取,
+因此在 Qwen3.6 這類模型上划算,而像 OLMoE 這種專家本來就已經在 RAM 中的小模型,
+反而可能變慢。這就是為什麼安裝程式只針對 Qwen3.6、Qwen3-Coder 與
+Qwen3.8-Flash-Next 在內建顯示晶片上開啟 Vulkan,
+也是為什麼每個引擎會自行決定是否在那裡執行稠密鏈(Qwen3.6 會,Qwen3.8 不會)。
+`--backend vulkan` 則無論如何都會要求使用 Vulkan。
+
+在獨立顯示卡上,安裝程式會為每個引擎建置 Vulkan(若引擎有 CUDA 路徑且已安裝 toolkit,
+則優先使用 CUDA),並把稠密層放在顯示卡上。這正是此設計所針對的情況,
+但它**尚未實測:還沒有任何獨立顯示卡跑過專家層級或稠密鏈。**
+(在它們出現之前,GLM-5.2 較早的 Vulkan 路徑在獨立的 RX 9070 上解碼速度為 1.7-1.8 tok/s。)
+歡迎提供你的顯示卡的數據。
+
+**沒有 Resizable BAR 的顯示卡**現在也能使用。這類顯示卡(所有 Turing 顯示卡、
+使用出廠韌體的 Ampere 顯示卡、關閉此選項的較舊 AMD 顯示卡)
+只讓 CPU 直接寫入其記憶體中約 256 MB 的範圍;colibri 現在會自動透過一個暫存緩衝區
+(staging buffer)把權重複製進去。這條路徑已經透過強制啟用,
+以及在三台裝置上模擬小視窗的方式測試過,在 780M 上沒有可測量的成本;
+但尚未在沒有 Resizable BAR 的顯示卡上實測
+([vulkan.md](docs/vulkan.md#memory-placement-without-resizable-bar))。
+
+CI 會在軟體驅動程式上,把每個引擎的 Vulkan 路徑與 CPU 產生的 token 對照檢查。
+GPU 加總數字的順序不同,而且會把某些中間結果(activation)保留為 f32,
+而 CPU 在這些地方會進行捨入,因此較長的回答可能會與 CPU 的結果相差一個字
+([vulkan.md](docs/vulkan.md#the-other-engines))。
+
+### CUDA:NVIDIA 顯示卡
+
+在 Linux 上,若已安裝 CUDA toolkit,安裝程式會為具有 CUDA 路徑的引擎建置 CUDA:
+GLM-5.2/5.3、GLM-5.3-Flash、Inkling、Kimi K3、
+DeepSeek V4 Flash、Qwen3.8-Flash-Next,以及 Qwen3.6 與 Qwen3-Coder。
+在 Windows 上,CUDA 引擎是一個獨立的 DLL([windows.md](docs/windows.md))。
+
+- **VRAM 專家層級**把最熱門的專家放在顯示卡上,依據實測的路由挑選;
+ 未命中的專家則同時在 CPU 上計算。Qwen3.6 在兩張
+ 8 GB 顯示卡(RTX 3070 與 Quadro RTX 4000)上,使用已預熱的路由歷史時解碼 11.3 tok/s
+ ([qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md));GLM-5.2 在六張
+ RTX 5090 上、所有專家常駐時為 9.0-9.2 tok/s
+ ([benchmarks.md](docs/benchmarks.md));DeepSeek V4 Flash 在一張 RTX 5080 上為
+ 1.5-1.6 tok/s,3,324 個 token 的提示在 90 秒內處理完
+ ([deepseek-v4.md](docs/deepseek-v4.md))。
+- **Qwen3.6 新功能:DeltaNet 層放在顯示卡上**(`Q36_DN_GPU=1`,
+ 需手動開啟)。過去 Qwen3.6 的 30 個 DeltaNet 層,每一層在每個 token 都要在顯示卡和
+ CPU 之間複製四次資料;現在解碼時,一個 token 會在顯示卡上執行整個層,
+ 其循環狀態保留在 VRAM 中。在稠密層位於 VRAM 的 RTX 3070 上:
+ 從 25.4 提升到 30.0 tok/s
+ ([qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md#the-deltanet-layer-on-the-card-q36_dn_gpu1))。
+- **較舊的顯示卡**。如果 CUDA toolkit 已不再支援為你的顯示卡編譯(例如
+ [#1852](https://github.com/JustVugg/colibri/issues/1852) 中的 CUDA 13 與 V100),
+ 建置會停止:此時 `--backend vulkan` 會改為透過 Vulkan 使用這張顯示卡。
+ DeepSeek V4 的 CUDA 層級也可以為 Pascal 與 Turing 建置
+ (`CUDA_ARCH=portable-pre-ampere NO_TC=1`)。
+
+完整說明:[docs/cuda.md](docs/cuda.md)。
+
+### Apple Silicon
+
+Metal 後端會為多個引擎在統一記憶體 GPU 上執行專家運算;
+使用 `METAL=1` 建置([docs/metal.md](docs/metal.md))。在 macOS 上,
+一步安裝會建置 CPU 版本。
+
+<a id="system-one-mode-ask-a-closed-question"></a>
+<a id="system-one-a-decision-with-a-probability"></a>
+
+## System One:附帶機率的決策
+
+人們要求模型做的事,大多是一次選擇,而不是一段文字:哪個佇列、哪個結論、是或否。
+`POST /v1/systemone` 接收一個狀態(文字或 JSON)與帶型別的問題,
+並為每個問題回答每個允許選項的機率以及一個信心值。整個過程不生成任何內容,
+所以答案不可能落在你的清單之外,而「模型沒有把握」就成了一個可以設定門檻的數字。
```bash
-git clone https://github.com/JustVugg/colibri && cd colibri
-./start-here.sh
+curl -s http://127.0.0.1:8000/v1/systemone -H 'Content-Type: application/json' -d '{
+ "state": "340 lines, 8 files, no tests. CI is green but nothing covers that path.",
+ "questions": {
+ "review": {"type": "choice", "instructions": "What should the reviewer do?",
+ "criteria": {"merge": null, "request changes": null, "close": null}},
+ "risky": {"type": "noul", "instructions": "Is this change risky?"}}}'
```
-它會偵測記憶體、磁碟與 GPU,推薦一個適合這台機器的模型(按 Enter 即採用推薦),在
-GPU 可用時以 Vulkan 或 CUDA 編譯引擎(或取得預先編譯的版本),以可續傳的方式下載模型
-(隨時可以中斷,再次執行即從中斷處繼續),並在瀏覽器中開啟儀表板。它也會印出供其他
-應用程式使用的 OpenAI 與 Anthropic 基礎 URL。之後再次執行,colibri 會直接啟動;
-`c/coli stop` 可以停止它。每一步做什麼:[quickstart.md](docs/quickstart.md#the-one-step-way)。
+`choice` 會傳回所選的標籤、每個標籤的機率,以及從 0(完全平均)到 1(完全確定)的
+`confidence`;`noul` 傳回「是」的機率;
+`score` 傳回期望等級。
-在用 AI 程式設計助手嗎?請它依照 [docs/AI_SETUP.md](docs/AI_SETUP.md) 安裝 colibri。
-支援 Model Context Protocol 的助手可以使用 `coli mcp`
-([MCP_SERVER.md](docs/MCP_SERVER.md))。
+由誰回答:
-以下是手動安裝的步驟。
+- **colibri 能執行的任何聊天模型**,透過評分:它讀出每個選項的機率,
+ 而不是寫出一個答案。針對同一份文件的多個問題只會讀取文件一次:在 Qwen3.6 上,
+ 針對同一份文件的四個問題,比在同一台 CPU 機器上生成相同答案快 5.7 倍。
+- **三個決策模型**,原生支援,一次前向傳遞即可完成,並使用其作者擬合的校準:
+ [Laya](docs/laya.md)(Convai Innovations)、
+ [GLiNER2.5-Decide](docs/gliner_decide.md)(fastino)與 [Clef](docs/clef.md)
+ (Cloudflare;它也能聊天)。它們的大小與速度,
+ 列在[決策模型表格](#which-model-for-my-machine)中。
-### 1. 取得 colibri
+**從 Jev 切換過來**。請求與回覆格式與 TypeSafe 的 Jev API 相同,
+所以 Jev 用戶端只需要更改 base URL,其他什麼都不用改,就能切換到 colibri:
+`TYPESAFE_BASE_URL=http://127.0.0.1:8000`(未設定 `COLI_API_KEY` 而啟動的伺服器,
+會接受它原本就會傳送的金鑰)。兩個官方 SDK 在未經修改的情況下,
+都已針對 `coli serve` 測試過。
-**下載預先建置的版本**——Linux、macOS 與 Windows 均已提供,不需要編譯器。從
-[Releases](https://github.com/JustVugg/colibri/releases) 下載對應平台的壓縮檔並解壓:
+同樣的模式也可以在終端機中使用(`coli chat` 中的 `/decide merge | request changes | close`),
+以及儀表板的 System One 頁面。完整的請求與回覆格式、評分規則,以及它幫不上忙的情況:
+[docs/systemone.md](docs/systemone.md)。
-```bash
-mkdir colibri && tar xzf colibri-v1.8.0-linux-x86_64.tar.gz -C colibri && cd colibri
-python3 coli info # engine ready ✓
-```
+## 儀表板
-裡面包含引擎(`colibri`,Windows 上為 `colibri.exe`)、`coli` 啟動器及其 Python
-輔助腳本。不需重新命名或設定:`coli` 會自動找到同目錄下的引擎。你只需安裝
-[Python 3](https://www.python.org/downloads/)——啟動器與 API gateway 是 Python
-腳本,而引擎本身是零相依的純 C 程式。
+`coli web` 會開啟它,一步安裝也會:包含聊天、System One 頁面、
+大腦(Brain)與效能剖析(Profiling)頁面,提供淺色與深色主題。
-**或者從原始碼建置**——需要具備 OpenMP 的 `gcc`(或 clang):
+<p align="center">
+ <img src="docs/media/colibri-dashboard.png" width="900" alt="colibri 網頁儀表板:聊天、即時指標、硬體面板、專家層級">
+</p>
+<p align="center"><em>Qwen3.6 在 CPU 機器上作答,專家從硬碟串流讀取。</em></p>
-```bash
-git clone https://github.com/JustVugg/colibri && cd colibri/c
-./setup.sh # 檢查 gcc/OpenMP、建置並執行自我測試
-```
+<p align="center">
+ <img src="docs/media/colibri-brio.png" width="900" alt="System One 頁面:文件只讀取一次,每個允許的答案各有一個機率,並附上一個熵值">
+</p>
+<p align="center"><em><strong>System One</strong>:給模型一份文件,以及它唯一可以選擇的幾個答案。圖中:
+<strong>request changes 為 99.9%</strong>,熵 0.005,讀取 4 個 token,生成 0 個。</em></p>
-想把 `coli` 加入 PATH?在 checkout 中執行 `pip install -e .` 即可註冊(引擎仍位於
-`c/` 目錄——這是從複製目錄做的可編輯安裝,而非獨立 wheel)。
+<p align="center">
+ <img src="docs/media/colibri-brain.png" width="900" alt="大腦頁面:GLM-5.2 的實測專家圖譜繪成一塊皮質,有十個可進入的區域">
+</p>
+<p align="center"><em><strong>大腦(Brain)</strong>:GLM-5.2 的<a href="https://github.com/JustVugg/colibri/issues/175">實測專家圖譜</a>,
+13,260 個已分析的專家分布在十個區域(Python、SQL、數學、詩歌、法律、中文……),位置依實測的路由親和度決定。
+<strong>Live routing</strong> 顯示正在執行的模型:每個專家一格,顏色代表儲存層級,
+每一輪中被路由到的專家都會閃爍。</em></p>
-### 2. 取得模型
+**效能剖析**(Profiling)頁面顯示每一輪的時間花在哪裡,逐階段劃分,
+並以最近 30 輪呈現趨勢。
-Hugging Face 上已有預先轉換的 **GLM-5.2 int4** 容器——請務必使用
-**含 int8 MTP head 的 group-scaled(gs64)版本**。它約為 **429 GB**,請放在空間足夠的硬碟上,最好是快碟:
+## 從其他應用程式使用
-**https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp**
+`coli serve`(安裝程式會替你啟動它)是一個同時提供多種 API 的伺服器:
-**GLM-5.3** 屬於同一家族,使用同一引擎載入。它有自己的 group-scaled(gs64)容器,
-約 **419 GB**,且**不含** MTP head,因此推測解碼保持關閉:
+- **相容 OpenAI**:`/v1/chat/completions`、`/v1/completions` 與
+ `/v1/models`,支援串流、JSON 回覆、停止序列與 logprobs;
+- **相容 Anthropic**:`/v1/messages`,因此 Claude Code 與 Anthropic
+ SDK 都能直接連上它;
+- **工具呼叫**:除了 Inkling 與 OLMoE 之外的所有聊天引擎都支援,各自使用其模型的原生格式
+ ([各引擎對照表](docs/api.md#tool-calling-support));
+- **圖片輸入**:支援 GLM-5.3-Flash、DeepSeek V4.1 Flash、MiMo-V2.6、
+ Qwen3.8-Flash-Next 與 Qwen3.8-27B,可以是 `coli chat` 訊息中的路徑、
+ `coli web` 中的附件,或是一個 `image_url` 部分;
+- **圖片輸出**:使用 Qwen-Image-2.1,透過 `POST /v1/images/generations` 提供,
+ `coli chat` 也會直接在終端機中繪出圖片
+ ([qwen-image.md](docs/qwen-image.md));
+- **決策**:透過 `POST /v1/systemone` 提供([見上文](#system-one-a-decision-with-a-probability))。
-**https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64**
+程式設計 CLI 與編輯器的連線方式,就和連接任何相容 OpenAI 的服務供應商一樣:base URL 設為
+`http://127.0.0.1:8000/v1`,模型 id 使用 `coli status` 印出的值,金鑰可填任何非空字串
+([docs/api.md](docs/api.md#connect-a-coding-cli-or-editor))。
-> ⚠️ 請使用上面的 **gs64** 容器,不要使用較舊的 per-row int4 鏡像
->(`mateogrgic/…`、`jlnsrk/…`):後者品質實測低約 9 個百分點,也是
-> [#455](https://github.com/JustVugg/colibri/issues/455) 最初 think-mode 迴圈與生成不終止的根因。
-> gs64 修復了受控的 per-row A/B 問題,但不是通用的重複或 EOS starvation 防護。
-> MTP head 也必須是 **int8,而非 int4**(int4 的草稿接受率為 0%,
-> [#8](https://github.com/JustVugg/colibri/issues/8)):
-> `ls -l <model>/out-mtp-*`:正確的 int8 是三個檔案,大小為 `3527131672 / 5366238584 / 1065950496`,
-> 或單一 `out-mtp-00000.safetensors`,大小為 `9959321520` 位元組(推薦容器目前的上傳版本就是單一檔案:
-> 同樣的 int8 張量,共 777 個,每個元素一個位元組)。
+<a id="how-it-works"></a>
-你也可以自行從 FP8 來源轉換——只需一條可續傳的指令,且任何時候都不需要
-在硬碟上同時存放完整的 756 GB:
+## 運作原理
-```bash
-./coli convert --model /nvme/glm52_i4 # 逐 shard 下載並轉換(僅此一次需要 python)
-```
+<p align="center">
+ <img src="docs/media/token-path.png" width="880" alt="路由、聯集、配置、重疊、學習">
+</p>
-<a id="other-supported-models"></a>
-#### 其他支援的模型
-
-GLM-5.2 是參考模型,但同樣的串流方法還能執行另外九個語言模型家族,另有一個引擎用於生成圖像。
-每個都是一個**同級引擎**:一個 C 檔案、自己的架構、同一套 `coli chat` / `coli serve` /
-`coli web` 前端(啟動器根據模型的 `config.json` 選擇二進位檔,圖像模型則根據
-`model_index.json`):
-
-> **各自需要什麼。** 這些模型差別很大,有人把其中兩個放在一起讀,誤以為要求互相矛盾
-> ([#191](https://github.com/JustVugg/colibri/issues/191))。它們並不矛盾,只是不同的模型。
-> **它們都不需要 GPU。**
->
-> | 模型 | 權重所需硬碟空間 | RAM | GPU |
-> |---|---|---|---|
-> | **OLMoE** | 約 7 GB(int8 容器) | 8 GB | 不需要;可選用 Vulkan |
-> | **GLM-5.2/5.3** | 約 429 GB(5.2)/約 419 GB(5.3) | 最低 16 GB,舒適 24 GB | 不需要;可選用 Vulkan |
-> | **GLM-5.3-Flash** | 轉換後約 195 GB | 25 GB(int4 權重 12 GB + 專家快取) | 不需要;可選用 Vulkan |
-> | **Inkling** | 約 469 GB | 使用 int4 稠密容器時 25 GB,不使用時約 120 GB | 不需要;可選用 Vulkan |
-> | **Kimi K3** | 約 1.6 TB | 32 GB 以上 | 不需要;可選用 Vulkan |
-> | **DeepSeek V4 Flash** | 約 167 GB(REAP 150B:約 85 GB) | 最低 16 GB,舒適 32 GB | 選用;GTX 10 系列以上的任何 NVIDIA 顯示卡(Pascal/Turing 透過 `CUDA_ARCH=portable-pre-ampere NO_TC=1`,RTX 50 上效果最佳)可使 prefill 快 5-10 倍、解碼快約 2.5 倍;可選用 Vulkan |
-> | **DeepSeek V4.1 Flash** | 約 510 GB(官方 checkpoint;其中 203 GB 是每次只讀取幾百位元組的 n-gram 記憶) | 約 18 GB 常駐(稠密部分、嵌入、視覺),加上由 `--ram` 決定大小的專家快取;cap 8 時實測峰值 RSS 24.8 GB | 不需要;可選用 Vulkan |
-> | **MiMo-V2.6 Flash** | 約 178 GB(官方 checkpoint) | 每層快取 32 個專家時實測常駐 30.1 GB,64 個時 49.8 GB;快取大小由 `--ram` 決定 | 不需要;可選用 Vulkan |
-> | **MiMo-V2.6 Pro** | 約 574 GB(不含引擎從不載入的三個檔案時約 564 GB) | 稠密部分按發布格式為 30.2 GiB,int8 下為 21.7 GiB;每層快取 12 個專家時實測常駐 48.0 GB(稠密部分按發布格式),20 個時 50.7 GB(稠密部分為 int8) | 不需要;可選用 Vulkan |
-> | **Qwen3.8-Flash-Next** | 約 185.5 GB(官方 FP8 checkpoint),選用的 int4-g64 專家 sidecar 另需 68.0 GB | 使用 FP8 專家、預設上下文時舒適為 24 GB(cap 32;16 GB 低於下限);使用 int4-g64 sidecar 時 cap 32 實測 RSS 11.6 GB | 選用;CUDA VRAM 專家層級(僅限 FP8 專家),稠密主幹在 VRAM 中量化為 int8;可選用 Vulkan |
-> | **Qwen3.8-27B**(稠密,文字與圖像) | 轉換後約 51 GB(f16) | 稠密權重為 int4 時 20 GB,int8 時 30 GB | 不需要;尚無 CUDA 層級;可選用 Vulkan |
-> | **Qwen3.6-35B-A3B** | 約 23 GB(int4-gs64 容器) | 24 GB(需要完全常駐 RAM) | 選用;CUDA VRAM 專家層級在兩張 8 GB 顯示卡上實測 **1.44 -> 10.05 tok/s(7.0x)**,輸出與 CPU 逐位元一致;可選用 Vulkan |
-> | **Qwen3-Coder-30B-A3B** | 約 19 GB(int4-gs64 容器;int8 為 30 GB) | 每層快取 32 個專家時實測常駐 6.5 GB,全部 128 個時 15.2 GB | 不需要;可選用 Vulkan |
-> | **Qwen-Image-2.1**(文字生成圖像) | 約 33 GB(官方 diffusers checkpoint) | 全部常駐 16.0 GB;每個 prompt 載入文字編碼器時峰值 8.5 GB,另加工作緩衝區(生成一張 768x512 圖像實測峰值 9.0 GB) | 不需要;可選用 Vulkan,尚未在 GPU 上計時 |
->
-> GPU 從不改變模型的回答,只改變運算在哪裡進行。速度由你的硬碟決定,因為專家是從硬碟
-> 串流讀取的:慢速硬碟上每秒不到一個 token,快速硬碟在快取預熱後每秒幾個 token。
->
-> **可選用 Vulkan** 指的是 `VK=1` 建置。以 `COLI_VULKAN=1` 執行時,引擎會把常駐矩陣放到任何
-> 具有 Vulkan 1.2 驅動程式的 GPU 上(GLM-5.2 在那裡有完整的解碼路徑),CI 在軟體驅動程式上將
-> 這些引擎與 CPU 的 token 對照檢查
-> ([vulkan.md](docs/vulkan.md#the-other-engines))。正確還不等於更快。在這些引擎首次實測的
-> 真實 GPU,即內建顯示晶片 Radeon 780M(Ryzen 7 PRO 8700GE,同樣的二進位檔,冷頁面快取)上,
-> 目前比 CPU 慢:Qwen3.6-35B-A3B 解碼 3.06 tok/s,CPU 為 5.97,輸出完全相同;使用 int4 專家的
-> Qwen3.8-Flash-Next 為 1.53,CPU 為 3.55。每次矩陣乘法都是一次同步提交,每個 token 約 726 次,
-> 而內建顯示晶片讀取的是與 CPU 相同的 RAM。
-
-| 家族 | 總參數 / 啟用參數 | 權重 | 建置 | 文件 |
-|---|---|---|---|---|
-| **GLM-5.2/5.3** | 744B / 40B | [`mastouri/…-int4-g64-with-int8-mtp`](https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp)(429 GB)或 [`Justvugg/GLM-5.3-colibri-int4-g64`](https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64)(419 GB) | `make -C c glm` | 本頁 |
-| **Inkling**(Thinking Machines) | 975B / 41B | [`nbeerbower/Inkling-colibri-int4`](https://huggingface.co/nbeerbower/Inkling-colibri-int4)(469 GB) | `make -C c inkling` | [inkling.md](docs/inkling.md) |
-| **GLM-5.3-Flash**(Z.ai) | 321B / 18B | [`zai-org/GLM-5.3-Flash`](https://huggingface.co/zai-org/GLM-5.3-Flash),路由專家轉換為 **int4-gs64**,稠密部分保持 BF16,精度在載入時選擇;含視覺 | `make -C c glm53` | [glm53-flash.md](docs/glm53-flash.md) |
-| **Kimi K3**(Moonshot) | 2.8T / 104B | [`moonshotai/Kimi-K3`](https://huggingface.co/moonshotai/Kimi-K3),原始 checkpoint,路由專家保持**原生 MXFP4** | `make -C c kimi_k3` | [kimi_k3.md](docs/kimi_k3.md) |
-| **DeepSeek V4 Flash** | 284B / 13B | 官方分片 checkpoint,路由專家保持**原生 fp4**,稠密部分保持 fp8-e4m3;**REAP 剪枝的 150B**([`puwaer/DeepSeek-V4-Flash-0731-reap-150b`](https://huggingface.co/puwaer/DeepSeek-V4-Flash-0731-reap-150b),85 GB,256 個專家中保留 132 個)用同一引擎載入,無需轉換 | `make -C c deepseek-v4` | [deepseek-v4.md](docs/deepseek-v4.md) |
-| **DeepSeek V4.1 Flash** | 552B / 16B | 官方 checkpoint,**無需轉換**:專家本身已是 fp4,稠密部分為 fp8-e4m3。其中 203 GB 是每次只從硬碟讀取幾百位元組的 n-gram 記憶,路由專家**每個 token 4.5 GB**,而 GLM-5.2 為 12.7 GB。視覺、工具呼叫與 DSpark 草稿 head 全部啟用 | `make -C c deepseek_v41` | [deepseek-v41.md](docs/deepseek-v41.md) |
-| **MiMo-V2.6 Flash**(Xiaomi) | 309B / 15B | [`XiaomiMiMo/MiMo-V2.6-Flash-MOPD`](https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Flash-MOPD)(178 GB),官方 checkpoint,**無需轉換**:路由專家保持**原生 MXFP4**,稠密部分保持 FP8/BF16。48 層中有 39 層只關注 128 個 token 的視窗,因此長上下文只需 9 層的 KV。支援視覺與工具呼叫 | `make -C c mimo` | [mimo.md](docs/mimo.md) |
-| **MiMo-V2.6 Pro**(Xiaomi) | 1.02T / 42B | [`XiaomiMiMo/MiMo-V2.6-Pro-MOPD`](https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Pro-MOPD)(573.5 GB),官方 checkpoint,**無需轉換**,執行在 MiMo 引擎上:同一架構,70 層、384 個專家。已在 70 層中的前 32 層上與 Xiaomi 自己的建模程式碼對照驗證。支援視覺與工具呼叫 | `make -C c mimo` | [mimo.md](docs/mimo.md#pro) |
-| **Qwen3.8-Flash-Next**(Alibaba) | 125B + 51B n-gram / 6B | [`Qwen/Qwen3.8-Flash-Next-FP8`](https://huggingface.co/Qwen/Qwen3.8-Flash-Next-FP8),原始 checkpoint;PLE 保持可分頁,專家保持**原生 block-FP8**,或從選用的 sidecar 以 **int4-g64** 讀取(見下文)。可選用 MTP 草稿(`Q38_MTP=1`) | `make -C c qwen38`(VRAM 專家層級需 `CUDA=1`) | [qwen38.md](docs/qwen38.md) |
-| **Qwen3.6**(Alibaba) | 35B / 3B | [`Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64`](https://huggingface.co/Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64)(約 23 GB,**推薦**),Gated Attention + Gated DeltaNet 混合架構 | `make -C c qwen36`(VRAM 專家層級需 `CUDA=1`) | [qwen36.md](docs/qwen36.md) |
-| **Qwen3.8-27B**(Alibaba) | 27B,稠密 | 以 `c/tools/convert_qwen36.py` 將 [`Qwen/Qwen3.8-27B`](https://huggingface.co/Qwen/Qwen3.8-27B) 轉換為 f16 容器(51 GB);引擎在載入時將其量化為 int8,設定 `COLI_DENSE_BITS=4` 時量化為 int4。每層一個 MLP,沒有路由器,執行在 Qwen3.6 引擎上。支援文字與圖像 | `make -C c qwen36` | [qwen36.md](docs/qwen36.md#the-dense-27b) |
-| **Qwen3-Coder-30B-A3B**(Alibaba) | 30B / 3B | [`Justvugg/Qwen3-Coder-30B-A3B-colibri-int4`](https://huggingface.co/Justvugg/Qwen3-Coder-30B-A3B-colibri-int4)(19 GB,int4-gs64),由 [`Qwen/Qwen3-Coder-30B-A3B-Instruct`](https://huggingface.co/Qwen/Qwen3-Coder-30B-A3B-Instruct) 轉換而來。執行在 Qwen3.6 引擎上的全注意力 Qwen3 MoE,128 個專家 top-8,有自己的 XML 工具呼叫格式,不帶思考;在 teacher forcing 下,int4 容器在 96.9% 的位置上選出與 bf16 發布版相同的 top-1 token | `make -C c qwen36` | [qwen36.md](docs/qwen36.md#qwen3-coder-30b-a3b) |
-| **OLMoE**(AI2) | 7B / 1B | 以 `c/tools/convert_olmoe_merged.py` 轉換,**int8** 容器,約 7 GB | `make -C c olmoe` | 無 |
-| **Qwen-Image-2.1**(Alibaba) | 圖像模型 | [`Qwen/Qwen-Image-2.1`](https://huggingface.co/Qwen/Qwen-Image-2.1)(約 33 GB),官方 diffusers checkpoint,**無需轉換**:文字編碼器與擴散 transformer 在載入時量化為 int8。`coli chat` 中直接顯示圖片,`coli serve` 提供 `POST /v1/images/generations`。Qwen Research License:僅限非商業用途 | `make -C c qwenimage` | [qwen-image.md](docs/qwen-image.md) |
-| **Laya**(Convai Innovations) | 決策模型,421M | [`convaiinnovations/laya`](https://huggingface.co/convaiinnovations/laya)(842 MB),官方 checkpoint,**無需轉換**:ModernBERT 編碼器加決策頭,對型別化問題(choice、score、noul)給出校準後的機率,而不是生成文字。由 `coli serve` 在 `POST /v1/systemone` 上提供。Apache-2.0 | `make -C c laya` | [laya.md](docs/laya.md) |
-| **GLiNER2.5-Decide**(fastino) | 決策模型,340M | [`fastino/GLiNER2.5-Decide`](https://huggingface.co/fastino/GLiNER2.5-Decide)(1.9 GB),官方 checkpoint,**無需轉換**:DeBERTa-v3 編碼器加 GLiNER2 的分類頭,一次讀完請求中的所有問題和狀態,為每個選項給出機率。由 `coli serve` 在 `POST /v1/systemone` 上提供。Apache-2.0 | `make -C c gliner_decide` | [gliner_decide.md](docs/gliner_decide.md) |
-| **Clef**(Cloudflare) | 決策模型 + 聊天,27B | [`Cloudflare/clef`](https://huggingface.co/Cloudflare/clef)(55 GB),用 `c/tools/convert_qwen36.py` 轉換(52 GB,含決策頭):在 Qwen3.8-27B 上繼續訓練並加上聯合模式頭,一次前向為每個問題的每個選項打分。`POST /v1/systemone` 原生作答,聊天與 Qwen3.8-27B 相同。Apache-2.0 | `make -C c qwen36` | [clef.md](docs/clef.md) |
-
-Qwen3.6 提供三個預先轉換的容器:**int4-gs64**(推薦:與 per-row 相比,對 int8 基準的餘弦相似度
-實測從 0.98777 提升到 0.99313,KL 從 0.109 降到 0.080,即量化誤差減少約 44%)、作為 A/B 基準的
-[int4 per-row](https://huggingface.co/Kreuzzelg/qwen36-35b-a3b-colibri-i4),以及
-[KAT-Coder v2.5](https://huggingface.co/Kreuzzelg/kat-coder-v2.5-dev-colibri-i4-gs64),同一引擎可以
-直接執行它:任何架構相同的 checkpoint 都無需專屬的程式碼路徑。使用 `CUDA=1` 時,VRAM 專家層級
-**在兩張 8 GB 顯示卡上實測 1.44 → 10.05 tok/s(7.0×)**,輸出與 CPU 路徑逐位元一致。
-
-Qwen3.8-Flash-Next 按發布格式以 block-FP8 讀取路由專家。選用的 **int4-g64 sidecar**
-(`c/tools/convert_qwen38_experts_int4.py`,在 FP8 shard 旁寫入 68.0 GB)讓每次未命中只讀取
-56% 的位元組。在 Ryzen 7 PRO 8700GE(16 執行緒,61 GiB,NVMe)上實測,相同快取大小下解碼快
-1.4-1.5 倍,相同 RAM 下快 1.56 倍,困惑度平均每個 token 增加 +0.017 nats
-([qwen38.md](docs/qwen38.md#routed-experts-as-int4-g64))。使用 checkpoint 內建 MTP head 的
-推測解碼為選用功能(`Q38_MTP=1`),輸出與一般解碼完全相同。在同一台機器上使用 int4 專家時,
-94-96% 的草稿被接受,每次前向傳遞 1.94 個 token,tok/s 提升 +12-14%(cap 96 時從 3.57 到 4.01,
-cap 170 時從 4.15 到 4.74)。在那台機器上收益不大,因為從硬碟讀取專家的量並沒有減少
-([qwen38.md](docs/qwen38.md))。
-
-Kimi K3 無需轉換:其 QAT 訓練的 MXFP4 專家直接從原始 Hugging Face shard 串流讀取,bf16 稠密部分
-在載入時量化。長時間的 agent 工作階段可以選用循環狀態檢查點(RAM 中 `COLI_K3_CKPT=N` 個 slot,或用
-`COLI_K3_CKPT_DIR` 存到硬碟):編輯過的或後續的 prompt 會恢復仍然保留的最深檢查點,只對尾端重新
-prefill,而不是讓整個對話重新經過 SSM 層回放。在 Vulkan 主機上(`COLI_VULKAN=1`),路由專家進入
-共享的專家層級:依專家歷史預先填入,並隨路由變化逐出。引擎的 KDA 與 MLA 路徑在 CI 中與廠商實作逐
-token 對照驗證。
-
-Inkling 提供 int4 專家,但稠密權重為 **bf16**(常駐 49.4 GB);對於放不下這些權重的主機,
-[inkling.md](docs/inkling.md) 提供一個單次處理工具,把稠密部分降到 15.3 GB,讓 975B 能在
-25 GB 的機器上執行,並如實寫明了其中的取捨。
-
-### 3. 執行
+每個 token 的每一層都走過相同的五個步驟:路由、聯集、配置、重疊、學習。
+設計目標是讓**配置只決定速度**:
+無論專家是從 VRAM、RAM 還是硬碟回應,路由器的決策與權重的精度都完全相同。
-```bash
-COLI_MODEL=/nvme/glm52_i4 ./coli chat # 自動偵測 RAM 預算、快取與 MTP
-COLI_MODEL=/nvme/glm52_i4 ./coli plan # 檢視規劃的 VRAM/RAM/硬碟配置
-COLI_MODEL=/nvme/glm52_i4 ./coli doctor # 唯讀就緒檢查
-COLI_MODEL=/nvme/glm52_i4 ./coli doctor --deep # 嚴格的張量/shard/索引/鏡像預檢
-COLI_MODEL=/nvme/glm52_i4 ./coli tune # 測量並儲存本機最快且安全的執行設定檔
-./coli web --model /nvme/glm52_i4 # API + 儀表板,並開啟瀏覽器
-./coli serve --model /nvme/glm52_i4 # API + 儀表板,不開啟瀏覽器(headless)
-```
+<p align="center">
+ <img src="docs/media/tiers.png" width="880" alt="VRAM、RAM 與 NVMe 作為專家常駐的三個層級">
+</p>
-#### System One 模式:問一個封閉式問題
+- **權重的 JIT**。編譯器的 JIT 從不編譯整個程式:
+ 它觀察實際執行的部分,只編譯熱點路徑。colibri 對權重下了同樣的賭注。
+ 實測的路由熱度決定哪些專家能放進 VRAM、RAM,或是留在硬碟:
+ 一個逐層的 LRU 快取,加上一組從你自己的對話中學到的固定熱門專家
+ (`.coli_usage`,每一輪都會更新)。colibri 越用越快。
+ 之所以可行,是因為路由具有可測量的結構
+ ([專家圖譜](https://github.com/JustVugg/colibri/issues/175))。
+- **絕不為硬碟等待兩次**。一個專家的三個矩陣以一次
+ `pread` 讀取;一組載入器在常駐專家運算的同時讀取缺少的專家;
+ 一批位置對每個專家只讀取一次;路由前瞻執行緒可以預先載入下一層
+ (GLM-5.2 的路由在提前一層時有 71.6% 可預測)。`DIRECT=1`(O_DIRECT)在快速的 NVMe 硬碟上往往有很大的收益,
+ 在其他硬碟上則沒有差別甚至更慢:請在你自己的硬碟上實測([tuning.md](docs/tuning.md))。
+- **不只一顆 SSD**。`COLI_MODEL_MIRROR=/second/glm52_i4 ./coli chat --model /fast/glm52_i4`
+ 會同時從第二顆硬碟上的副本讀取。兩顆位於獨立控制器上的
+ NVMe 硬碟實測解碼 +37.5%;放在較小硬碟上的部分鏡像也可以使用
+ ([multidisk.md](docs/multidisk.md))。
+- **從筆電到機架**。在 25 GB 的筆電上,每個專家都從硬碟串流讀取,
+ 慢但正確;在大型主機上,所有專家都常駐
+ (`CUDA_EXPERT_GB=auto PIN_GB=all`),硬碟完全退出解碼過程。
+ `COLI_NUMA=1` 會把常駐權重分散到多插槽主機的各個記憶體控制器上,
+ 而本機叢集模式則可以在其他機器上執行路由專家([cluster.md](docs/cluster.md))。
+- **忠實的模型**。每個引擎都會在 CI 中,以一個微型 fixture 與其模型的參考實作對照檢查。
+ GLM-5.2 的 MLA 注意力保存壓縮後的 KV 狀態
+ (每個 token 576 個浮點數,而非 32,768 個,小 57 倍),而且重新啟動後依然保留,
+ 因此重新開啟對話時,不需要再讀一次提示。
+- **值得才啟用的推測解碼**。GLM-5.2 的 int8 MTP head 在划算時,
+ 每次前向傳遞可起草 2.2-2.8 個 token;Qwen3.8-Flash-Next 的 MTP head 需手動開啟,
+ 在輸出完全相同的情況下提升 12-14%。在起草的成本高於節省的地方(DeepSeek V4),
+ 它保持關閉([tuning.md](docs/tuning.md#speculation-and-reproducibility))。
+
+引擎由每個模型家族各一個 C 檔案組成(GLM-5.2 為 `c/colibri.c`),
+建立在共用的標頭檔之上,執行階段不需要 BLAS,也不需要 Python:
+Python 只用於安裝程式、啟動器、轉換工具與 API gateway。
+
+<a id="what-it-achieves"></a>
+
+## 基準測試
-人們向模型提出的大多數請求是一次選擇,而不是一段文字:哪個佇列、哪個結論、某個欄位應取四個值中的哪一個。
-System One 模式把允許的選項交給引擎,讀出每個選項的機率,而不是生成文字:不生成任何內容,
-答案不可能落在你的清單之外,並且每個答案都附帶一個信心值(confidence),"模型沒有把握"因此成為一個可以設門檻的數字。
-它在全部十個模型家族上可用,執行在同一個伺服器上,且按請求可選:不請求它的聊天,輸出逐位元組保持不變。
+<p align="center">
+ <img src="docs/media/ladder.png" width="880" alt="各硬體等級上 GLM-5.2 的實測解碼速度">
+</p>
-```bash
-# 在 TUI 中:同一個模型,只是不再讓它寫
-./coli chat --model /nvme/qwen36_i4_gs64
-> /decide merge | request changes | close
-> 340 lines, 8 files, no tests. CI is green but nothing covers that path.
+同一套引擎、同一個 int4 容器:硬體只會改變專家存放的位置。
+GLM-5.2 的解碼速度,取自[完整表格](docs/benchmarks.md):
-# 從任何程式:向執行中的伺服器傳送一個 JSON 請求
-curl -s http://127.0.0.1:8000/v1/systemone -H 'Content-Type: application/json' -d '{
- "state": "340 lines, 8 files, no tests. CI is green but nothing covers that path.",
- "questions": {"review": {"type": "choice", "instructions": "What should the reviewer do?",
- "criteria": {"merge": null, "request changes": null, "close": null}}}}'
-```
+- **6x RTX 5090,所有專家常駐**:5.8-6.8 tok/s,使用選擇性
+ NUMA 交錯時為 9.0-9.2([實驗紀錄](docs/experiments/glm52-6x5090-2026-07-12.md));
+- **128 GB,僅用 CPU**(Ryzen AI Max+ 395):暖機後 1.83 tok/s
+ ([#200](https://github.com/JustVugg/colibri/issues/200));
+- **一台搭載單張 RTX 5070 Ti 的筆電級電腦**:1.07 tok/s
+ ([#273](https://github.com/JustVugg/colibri/issues/273));
+- **這個專案起步時的那台 25 GB 筆電**:冷啟動 0.05-0.1 tok/s,
+ 這是如實呈現的下限。
-`POST /v1/systemone` 使用與 TypeSafe 的 Jev API 相同的請求與回覆:Jev 用戶端只需更改 base URL 即可切換到 colibri。
-對同一文件的多個問題只讀取文件一次:在 Qwen3.6 上與在同一台 CPU 機器上生成同樣答案相比的實測,
-對同一文件的四個問題快 5.7 倍。完整說明、請求與回覆格式、以及它不適用的情形見 [docs/systemone.md](docs/systemone.md)。
-儀表板中也有 System One 頁面。
+品質是測量出來的,而不是假設的:int4 容器的代價與量化消融實驗收錄在
+[benchmarks.md](docs/benchmarks.md#quality-benchmark) 中。若要加入你的機器,
+請依照[基準測試規範](docs/benchmarking.md),並開一個附上數據的 issue。
+<a id="install-by-hand"></a>
-在 Windows 上,發布壓縮檔附帶 `coli.cmd`:按兩下即可快速開始,或在 cmd 或 PowerShell 中執行
-`coli.cmd chat --model D:\glm52_i4`。在原始碼 checkout 中,同樣的指令寫作 `python coli chat --model
-D:\glm52_i4`。`.exe` 檔是引擎,不是啟動器:單獨啟動時沒有可載入的模型,會立即結束。
-引擎執行階段是純 C,python 只供單次轉換工具與選用的 API gateway 使用。
+## 手動安裝
-#### 同樣的指令可執行任何模型
+<a id="1-get-colibri"></a>
-`coli` 會讀取模型的 `config.json`,選出對應的引擎二進位檔,並套用該家族的聊天範本,因此
-**換模型時命令列無需任何改變**。只需建置一次想用的引擎,然後把 `COLI_MODEL` 指向正確的目錄:
+**1. 程式**。從 [Releases](https://github.com/JustVugg/colibri/releases)
+下載適用你平台的壓縮檔(Linux x86_64、macOS、Windows;不需要編譯器,
+只需要供啟動器與 API 使用的 [Python 3](https://www.python.org/downloads/)),
+解壓縮後執行 `python3 coli info`。或者使用 `gcc`(或 clang)與 OpenMP 從原始碼建置:
```bash
-make -C c glm # GLM-5.2
-make -C c inkling # Inkling
-make -C c kimi_k3 # Kimi K3
-
-COLI_MODEL=/nvme/glm52_i4 ./coli chat # TUI
-COLI_MODEL=/nvme/inkling_i4 ./coli chat
-COLI_MODEL=/nvme/kimi_k3 ./coli chat
-
-./coli web --model /nvme/inkling_i4 # API + dashboard, opens a browser
-./coli web --model /nvme/kimi_k3
-./coli serve --model /nvme/inkling_i4 # API + dashboard, no browser
+git clone https://github.com/JustVugg/colibri && cd colibri/c
+./setup.sh # checks gcc/OpenMP, builds, self-tests
+make qwen36 VK=1 # one engine, here with Vulkan (CUDA=1 for CUDA)
```
-對於非 GLM 引擎,`coli chat` 會在本機啟動 gateway 並把 TUI 連接上去,因此 TUI、API 與儀表板
-都經過同一個感知架構的聊天範本,你無需自己傳入範本。
+<a id="2-get-the-model"></a>
-有兩點因模型而異,都記錄在各模型的頁面中:
+**2. 模型**。[上方表格](#which-model-for-my-machine)中的任何一個下載皆可:
+安裝程式的 id 對應到 Hugging Face 儲存庫,每個模型的頁面都有下載與轉換指令。
+GLM-5.2 請使用帶 int8 MTP head 的 group-scaled(gs64)容器
+[`mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp`](https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp)
+(429 GB),GLM-5.3 則使用 [`Justvugg/GLM-5.3-colibri-int4-g64`](https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64)
+(419 GB,不含 MTP head)。不要使用較舊的 per-row int4 鏡像:
+它們的品質實測差了約 9 個百分點,而且正是
+[#455](https://github.com/JustVugg/colibri/issues/455) 中回答不斷循環的原因。
+`./coli convert --model /nvme/glm52_i4` 會從 FP8 發布版本逐 shard 建置相同的容器,
+任何時候都不需要在硬碟上同時存放完整的 756 GB。如何檢查 MTP head 及其他項目:
+[quickstart.md](docs/quickstart.md#3-get-the-model)。
-- **RAM 吃緊主機上的 Inkling** 需要 int4 稠密容器和較小的專家快取:
- `./coli chat --model /nvme/inkling_i4 --cap 2`(見 [inkling.md](docs/inkling.md):預設的
- `--cap 8` 在常駐集之外還需要約 14 GB 快取)。
-- **Kimi K3** 直接從原始 checkpoint 串流讀取其 MXFP4 專家,因此無需轉換,但快照約為 1.6 TB
- (見 [kimi_k3.md](docs/kimi_k3.md))。
+<a id="3-run-it"></a>
-### 4. 深入了解
-
-| 主題 | 文件 |
-|---|---|
-| Benchmark、社群實測數據、品質測量 | [docs/benchmarks.md](docs/benchmarks.md) |
-| 可重現的 benchmark 協議與最低報告要求 | [docs/benchmarking.md](docs/benchmarking.md) |
-| 調校選項、策略、學習型快取、預先載入 | [docs/tuning.md](docs/tuning.md) |
-| Windows 11 原生建置(含 CUDA DLL) | [docs/windows.md](docs/windows.md) |
-| CUDA 後端、VRAM 專家層級、全部常駐 | [docs/cuda.md](docs/cuda.md) |
-| Vulkan 後端(任何 GPU:透過 RADV 支援 AMD,包括 ROCm 已放棄的顯示卡) | [docs/vulkan.md](docs/vulkan.md) |
-| Apple Silicon Metal 後端 | [docs/metal.md](docs/metal.md) |
-| OpenAI 相容 API、KV slots、網頁儀表板 | [docs/api.md](docs/api.md) |
-| System One 模式:對封閉的選項集評分而不是生成 | [docs/systemone.md](docs/systemone.md) |
-| 實驗性的層分段嵌入 ABI | [docs/segment-runtime.md](docs/segment-runtime.md) |
-| 實驗性的 tokenizer/嵌入/head Edge ABI | [docs/edge-runtime.md](docs/edge-runtime.md) |
-| 文法強制草稿(結構化輸出) | [docs/grammar-draft.md](docs/grammar-draft.md) |
-| 環境變數完整清單 | [docs/ENVIRONMENT.md](docs/ENVIRONMENT.md) |
-
-## DeepSeek V4
-
-**DeepSeek V4 Flash** 直接串流讀取官方 checkpoint,無需轉換:路由專家保持**原生 fp4**,
-稠密部分保持帶 UE8M0 區塊縮放的 **fp8-e4m3**。MLA + DSA 稀疏注意力,43 層,256 個路由專家
-加 1 個共享專家,top-6。支援 x86-64/aarch64 Linux 與 Windows/MSYS2(CPU),並提供選用的
-CUDA 層級(Windows 執行階段 DLL;Linux 透過 `CUDA=1` 直接連結,已在 WSL2 下驗證),每個階段都以
-CPU 結果為準,並可逐階段退回。
+**3. 執行**。在原始碼 checkout 的 `c/` 目錄中,或在解壓縮後的發布版本中執行。
+啟動器會讀取模型的 `config.json`,選出對應的引擎及其聊天範本,
+因此每個模型的指令都相同:
```bash
-cd c
-make deepseek-v4
-python ./coli chat --model /path/to/DeepSeek-V4-Flash --ram 32
-# also: coli run / coli serve / coli web
-# Windows CUDA tier: make cuda-dsv4-dll CUDA_ARCH=portable (+ make cuda-dsv4-dg-dll on RTX 50)
+./coli chat --model /nvme/qwen36 # chat in the terminal
+./coli web --model /nvme/qwen36 # API + dashboard, opens a browser
+./coli serve --model /nvme/qwen36 # API + dashboard, no browser
+./coli plan --model /nvme/qwen36 # where the model will live: VRAM, RAM, disk
+./coli doctor --model /nvme/qwen36 # read-only check: is everything ready?
+./coli tune --model /nvme/qwen36 # measure and save this machine's fastest safe settings
```
-兩個選用的 GPU 調整選項是新增的,正在徵集社群實測數據,兩者預設關閉,未設定時輸出逐位元組不變:
-`DSV4_HYBRID=1` 根據執行階段測得的頻寬,把 VRAM 層級的未命中分配給 GPU 填充分支和 CPU 分支;
-`COLI_CUDA_MOE_DOUBLE=1`(在 `COLI_CUDA_MOE_BATCH=1` 之上)在目前層運算時,把下一層的完整專家集
-預先載入到第二個 VRAM 儲存區,VRAM 不足時退回單一儲存區。CUDA 層級現在也能在 Pascal 與 Turing
-顯示卡(GTX 10/RTX 20 系列)上執行:使用 `CUDA_ARCH=portable-pre-ampere NO_TC=1` 建置。
-
-貪婪解碼,一個 KV slot。工具呼叫透過 HTTP gateway 接入,使用 V4 原生的 prompt 與 DSML 呼叫區塊;
-不支援文法約束。請見[各引擎 API 矩陣](docs/api.md#tool-calling-support)。前綴檢查點(記憶體中與
-硬碟上)讓 agent 工作階段和後續輪次在系統 prompt 首次 prefill 之後幾秒內即可開始。在 RTX 5080 +
-2 顆 NVMe 上實測:3324 個 token 的 prefill 90 秒,8.3k token 的首輪約 4 分鐘(僅一次),之後的
-工作階段/輪次 6-9 秒,3k 上下文時解碼約 1.6 tok/s,請見 [docs/deepseek-v4.md](docs/deepseek-v4.md)。
-
-**給它 RAM。** 43 × 256 個路由專家在硬碟上約 137 GiB,一個 token 會觸及其中 301 個,因此專家快取
-命中率決定了 tok/s:`--ram` 是最有價值的單一調整選項,而且它只改變速度,從不改變輸出。
-
-**推測草稿已實作,但預設關閉。** DSpark 的 markov 草稿器與完整 MTP 都已實作並驗證:草稿可以節省
-前向傳遞,但絕不會改變 token,因為每個被接受的 token 仍是目標模型自己的 argmax。在真實的多輪
-對話中實測,它們分別只接受了 15 個中的 1 個和 24 個中的 10 個,而本引擎為被拒絕的後綴回放循環
-注意力狀態所花的成本,超過了草稿節省的時間:一個 14 個 token 的回答用了 495 秒。因此 `V4_DRAFT`
-與 `V4_MTP` 預設為 `0`,程式碼連同這些數據一起保留,留給在更快的儲存裝置上重試的人。
-
-CUDA 層級(建置、DLL 選擇、GPU 涵蓋範圍)、環境變數參考、效能數據、checkpoint 驗證以及動態產生的
-tiny 獨立 oracle,請見 [docs/deepseek-v4.md](docs/deepseek-v4.md)。
-
-## 下一步
-
-- **推論系統研究就是產品。**目前階層採用 LRU 與學習型固定集;正在研究模型格式、壓縮、
- 配置、排程、I/O、CPU/GPU 核心、異質重疊、KV 狀態與路由感知推測。目標是降低硬體要求
- 和每個有效 token 的成本,所有成果都以端到端測量為準、經審查並公開開發。
-- **支援更多開放模型。**階層演算法與模型無關,任何帶路由專家的 MoE 都能用相同方式分層。
- 目前已有十個語言模型家族可用(GLM-5.2/5.3、GLM-5.3-Flash、Inkling、Kimi K3、DeepSeek V4 Flash、
- DeepSeek V4.1 Flash、MiMo-V2.6、Qwen3.8-Flash-Next、Qwen3.6、OLMoE),另有用於圖像的
- Qwen-Image-2.1;更多開放權重家族(候選包括 **MiniMax**)將沿用同樣的規則獲得引擎支援:
- 有人完成端到端實測之後。
+在 Windows 上,發布壓縮檔附有 `coli.cmd`(`coli.cmd chat --model D:\qwen36`);
+在原始碼 checkout 中請使用 `py -3 c\coli`。`.exe` 檔案是引擎,不是啟動器。
+所有選項與變數:
+[SETTINGS.md](docs/SETTINGS.md)、[ENVIRONMENT.md](docs/ENVIRONMENT.md)。
-## 支持專案
+## 研究,以及如何幫忙
-colibrì 最初是由一人使用 12 核心、25 GB RAM 的筆電開發;
-如今它的數據來自社群中的各種真實機器。如果這個專案對你有用:
+colibri 希望讓前沿模型減少對稀缺硬體的依賴,並降低執行成本。
+這代表要改變權重的儲存與搬移方式、決定哪些內容放在 VRAM、RAM 或儲存裝置、
+讓 CPU 與 GPU 的工作重疊,並測試新的解碼方法。沒有任何做法會因為是慣例就被保留,
+也沒有任何做法會因為微基準測試看起來很快就被採用:決定性的結果是真實機器上的端到端推論,
+並且同時測量品質與速度。目前的開放問題:
-- ⭐ 為儲存庫加星並分享;
-- 🐛 以 issue 提交你的硬體 benchmark 數據——實測資料比任何其他事都更能推動專案;
-- 💬 加入 [Discord 社群](https://discord.gg/RXV83nSZdk),討論實驗、硬體數據與研究方向;
-- 💬 若想贊助開發或捐贈硬體,請透過 GitHub issues 聯絡。
+| 假設 | 目前的證據 | 仍需要的實驗 |
+|---|---|---|
+| 路由歷史能比單純的 LRU 更好地配置專家 | 學習得來的固定專家能改善重複性的工作負載,但可能對某個提示過度擬合 | 在程式設計、聊天、多語言與長上下文工作負載上,進行留出資料、跨工作階段的 A/B |
+| 多顆 SSD 能把獨立的頻寬轉化為解碼速度 | 兩顆獨立的 NVMe 硬碟實測解碼 +37.5%;經過加權條帶化後,較慢的第三顆硬碟沒有帶來差異([測量數據](docs/multidisk.md#what-has-been-measured)) | 在不同的硬碟速度、控制器配置與快取狀態下重現 |
+| 感知硬體的規劃器能自動接近每台機器的最佳配置 | 目前已能偵測 RAM/VRAM 預算與多種後端,並由安裝程式選擇建置方式 | 在筆電、工作站、NUMA 主機與多 GPU 系統上,將產生的方案與受控的參數掃描進行比較 |
+| 無損或品質受控的表示法能減少權重搬移,而且減少得足以產生實際差異 | 已有格式與量化的消融實驗,並設有正確性/品質門檻 | 同時重現品質、搬移的位元組數、延遲與每個有效 token 的成本,而不只看壓縮率 |
+| 感知路由的推測解碼能在接近完全常駐之前就帶來收益 | MTP 與文法草稿可以運作,但 MTP 也曾在專家命中率約 85% 時實測出 32% 的損失 | 繪製接受率、專家命中率、批次聯集與草稿深度之間的損益平衡面 |
+| CPU/GPU 重疊能隱藏傳輸與同步的成本,而不只是轉移瓶頸 | CUDA、Metal 與 Vulkan 都有成功的數據,但快速的 CPU、內建顯示晶片與低常駐率可能抵消這些收益 | 在 PCIe、統一記憶體與完全常駐的機器上進行逐階段剖析與單一變數 A/B,以及取得 Vulkan 層級與稠密鏈在獨立顯示卡上的第一批數據 |
+
+想幫忙嗎?挑選其中一列,負面結果也請一併公開。請記錄硬體、commit、模型、
+確切的指令、提示、快取狀態、吞吐量、首個 token 的時間、專家命中率、
+讀取的位元組數與一項品質檢查;每次只改變一個變數,重複執行,並附上原始日誌。
+請先閱讀 [CONTRIBUTING.md](CONTRIBUTING.md) 與[基準測試規範](docs/benchmarking.md),
+然後[開一個 issue](https://github.com/JustVugg/colibri/issues/new)。
+在這裡,一個控制良好的失敗,比一個無法解釋的快速數字更有價值。
+
+## 文件
+
+| 主題 | 文件 |
+|---|---|
+| 一步安裝與手動安裝,涵蓋所有平台 | [quickstart.md](docs/quickstart.md) |
+| 透過 AI 助手安裝,以及 MCP 伺服器 | [AI_SETUP.md](docs/AI_SETUP.md)、[MCP_SERVER.md](docs/MCP_SERVER.md) |
+| API:OpenAI、Anthropic、工具、KV slots、儀表板 | [api.md](docs/api.md) |
+| System One 與決策模型 | [systemone.md](docs/systemone.md)、[laya.md](docs/laya.md)、[gliner_decide.md](docs/gliner_decide.md)、[clef.md](docs/clef.md) |
+| Vulkan:專家層級、稠密鏈、沒有 Resizable BAR 的顯示卡 | [vulkan.md](docs/vulkan.md) |
+| CUDA,以及 Qwen3.6 的 CUDA 層級 | [cuda.md](docs/cuda.md)、[qwen36-cuda-tier.md](docs/qwen36-cuda-tier.md) |
+| Apple Silicon、Windows | [metal.md](docs/metal.md)、[windows.md](docs/windows.md) |
+| 調校、學習型快取、預先載入、推測解碼 | [tuning.md](docs/tuning.md) |
+| 多顆 SSD、多台機器 | [multidisk.md](docs/multidisk.md)、[cluster.md](docs/cluster.md) |
+| 基準測試與測量方法 | [benchmarks.md](docs/benchmarks.md)、[benchmarking.md](docs/benchmarking.md) |
+| 所有選項與環境變數 | [SETTINGS.md](docs/SETTINGS.md)、[ENVIRONMENT.md](docs/ENVIRONMENT.md) |
+| 文法強制草稿,以及供其他程式嵌入引擎的實驗性 ABI | [grammar-draft.md](docs/grammar-draft.md)、[segment-runtime.md](docs/segment-runtime.md)、[edge-runtime.md](docs/edge-runtime.md) |
## 儲存庫結構
```
-Makefile 根目錄建置/檢查入口
+start-here.sh, START-HERE.bat the one-step setup (Linux and macOS, Windows)
+Makefile root build/check entry point
c/
-├── colibri.c GLM-5.2 引擎 (make glm)
-├── inkling.c Inkling 引擎 (make inkling)
-├── kimi_k3.c Kimi K3 引擎 (make kimi_k3)
-├── glm53.c GLM-5.3-Flash 引擎 (make glm53)
-├── deepseek_v4.c DeepSeek V4 Flash 引擎 (make deepseek-v4)
-├── deepseek_v41.c DeepSeek V4.1 Flash 引擎 (make deepseek_v41)
-├── mimo.c MiMo-V2.6 Flash 與 Pro 引擎 (make mimo)
-├── qwen38.c Qwen3.8-Flash-Next 引擎 (make qwen38)
-├── qwen36.c Qwen3.6、Qwen3-Coder、Qwen3.8-27B 引擎 (make qwen36)
-├── olmoe.c OLMoE 引擎 (make olmoe)
-├── qwenimage.c Qwen-Image-2.1 引擎 (make qwenimage)
+├── colibri.c GLM-5.2/5.3 engine (make glm)
+├── glm53.c GLM-5.3-Flash (make glm53)
+├── inkling.c Inkling (make inkling)
+├── kimi_k3.c Kimi K3 (make kimi_k3)
+├── deepseek_v4.c DeepSeek V4 Flash (make deepseek-v4)
+├── deepseek_v41.c DeepSeek V4.1 Flash (make deepseek_v41)
+├── mimo.c MiMo-V2.6 Flash and Pro (make mimo)
+├── qwen38.c Qwen3.8-Flash-Next (make qwen38)
+├── qwen36.c Qwen3.6, Qwen3-Coder, Qwen3.8-27B, Clef (make qwen36)
+├── olmoe.c OLMoE (make olmoe)
+├── qwenimage.c Qwen-Image-2.1 (make qwenimage)
+├── laya.c Laya (make laya)
+├── gliner_decide.c GLiNER2.5-Decide (make gliner_decide)
│
-├── st.h safetensors 索引與範圍讀取
-├── quant.h 標準的容器解碼器
-├── expert_ffn.h 各 MoE 引擎共用的路由專家 FFN kernel(planar int4、層執行器)
-├── tok.h, json.h tokenizer 與 JSON 剖析器
-├── compat.h Windows/macOS 相容層(POSIX 名稱集中在一處)
-├── expert_store.h 串流專家快取
-├── route_trace.h 路由遙測與 .coli_usage,與引擎無關
-├── kv_prefix.h 跨輪次的 KV 前綴重用
+├── st.h, quant.h, idot.h safetensors reads, container decoders, integer kernels
+├── expert_ffn.h, expert_store.h routed-expert kernel and streaming expert cache
+├── tok.h, json.h, compat.h tokenizer, JSON, Windows/macOS shims
+├── route_trace.h, kv_prefix.h routing telemetry (.coli_usage), KV prefix reuse
+├── decide_serve.h the decision engines' side of System One
│
-├── backend_cuda.* 選用的 CUDA 層級 (CUDA=1)
-├── backend_metal.* 選用的 Metal 層級 (METAL=1)
-├── backend_vulkan.* 選用的 Vulkan 層級 (VK=1)
+├── backend_cuda.* optional CUDA tier (CUDA=1)
+├── backend_metal.* optional Metal tier (METAL=1)
+├── backend_vulkan.*, vk_tier.c, vk_chain.c optional Vulkan tier and dense chain (VK=1)
│
-├── Makefile 建置與本機檢查
-├── coli 使用者介面 CLI
-├── openai_server.py OpenAI 相容 HTTP gateway
-├── resource_plan.py `coli plan` 與 `coli doctor` 背後的 RAM/VRAM 規劃器
-├── tools/ 離線轉換、fixtures 與 benchmarks
-├── scripts/ 長時間轉換輔助工具
-└── tests/ 零相依套件的 C 與 Python 測試
-web/ 瀏覽器 UI(純 OpenAI API client)
-desktop/ 包裝網頁 UI 的 Tauri v2 桌面 shell
-docker/ 容器映像檔
-docs/ 參考文件、實驗與媒體檔
+├── coli user-facing CLI
+├── setup_*.py the one-step setup: hardware, catalog, downloads, flow
+├── mcp_server.py the MCP server (coli mcp)
+├── openai_server.py OpenAI- and Anthropic-compatible HTTP gateway
+├── resource_plan.py RAM/VRAM planner behind coli plan and coli doctor
+├── tools/ conversion, fixtures and benchmarks
+└── tests/ dependency-free C and Python tests
+web/ the dashboard (a pure API client)
+desktop/ Tauri desktop shell around the dashboard
+docker/ container images
+docs/ reference docs, experiments, media
+site/ the website
```
-**每個模型家族一個 `.c`,建立在共用的單一標頭檔之上。** 一個引擎只負責自己的架構;兩個引擎都
-需要的東西(safetensors 讀取器、容器解碼器、tokenizer、專家快取)都放在它們共同引入的標頭檔裡,
-這樣一個修正能同時涵蓋所有引擎。這條規則不是裝飾:這裡反覆出現的缺陷,正是某個機制只落在一個
-引擎裡、從未傳到同級引擎的那些。
+**每個模型家族一個 `.c`,建立在共用的單一標頭檔之上**。一個引擎只負責自己的架構,
+其他一概不管;兩個引擎都需要的東西,都放在它們共同引入的標頭檔中,
+因此一個修正能同時涵蓋所有引擎。在儲存庫根目錄執行
+`make`、`make check` 與 `make clean`,都會轉交給引擎的 Makefile。
+
+## 支持專案
+
+colibri 最初是一個人在一台 12 核心、25 GB RAM 的筆電上開始的專案;
+如今它的數據來自社群中的各種真實機器。如果它對你有用:
-在儲存庫根目錄執行 `make`、`make check` 與 `make clean`,
-都會轉交給引擎的 Makefile。
+- 為儲存庫加星並分享出去;
+- 開 issue 提交你硬體上的基準測試數據:
+ 實測數據點比其他任何事都更能推動這個專案;
+- 加入 [Discord 社群](https://discord.gg/RXV83nSZdk),討論實驗、
+ 硬體結果與研究方向;
+- 若想贊助開發或捐贈硬體,請透過 GitHub issues 聯絡。
## 為什麼叫做「colibrì」
-蜂鳥只有幾公克重,能在原地懸停,並在一天內造訪上千朵花。
-這套引擎只用蜂鳥般的配給,就能讓 744B 參數的巨人運轉:
+蜂鳥只有幾公克重,能在原地懸停,一天造訪上千朵花。
+這套引擎只靠蜂鳥般的口糧,就讓一個 744B 參數的巨人持續運轉:
25 GB RAM、十二個 CPU 核心,以及對硬碟的大量耐心。
## 致謝
-colibrì 是一個引擎;它執行的智慧是一份饋贈。感謝以開放方式發布前沿級權重的團隊:**Z.ai**
-(GLM)、**Moonshot AI**(Kimi)、**Alibaba Qwen**、**MiniMax** 與 **Allen AI**(OLMoE),也感謝
-每一位做過 benchmark、二分定位問題、重現圖譜執行或提交修補的貢獻者。這個專案證明了開放權重
-能夠帶來什麼。
-
-本專案在專家配置、壓縮與路由方面的實驗,也建立在以下開放研究與系統工作的構想和證據之上:
-
-- [REAP](https://github.com/CerebrasResearch/reap) 與
- [EASY-EP](https://github.com/RUCAIBox/EASYEP):輸出感知的與特定領域的專家重要性。
-- [SERE](https://github.com/JL-Cheng/SERE):基於相似度的專家重新路由;
- [ReMoE](https://github.com/BUAA-OSCAR/ReMoE):感知快取區域性的路由器微調。
-- [MC-SMoE](https://github.com/UNITES-Lab/MC-SMoE):路由引導的專家合併與壓縮。
-- [MoBE](https://github.com/inclusionAI/MoBE) 與
- [D²-MoE](https://github.com/lliai/D2MoE):共享專家基底與低秩專家增量。
-- [HybriMoE](https://github.com/PKU-SEC-Lab/HybriMoE):CPU/GPU 混合專家排程;
- [ScMoE](https://arxiv.org/abs/2404.05019):專家通訊與運算的重疊;
- [OD-MoE](https://arxiv.org/abs/2512.03927):分散式隨需專家載入。
-- [vLLM](https://github.com/vllm-project/vllm)、
- [llama.cpp](https://github.com/ggml-org/llama.cpp) 與
- [kTransformers](https://github.com/kvcache-ai/ktransformers):開放的推論系統與專家卸載工作,
- 讓比較得以重現。
-
-引擎也建立在具體的工程成果之上,而不只是構想。以下每一項如今都在程式碼樹中被使用或重新實作:
-
-- [safetensors](https://github.com/huggingface/safetensors):每個引擎讀取的容器格式
- (`c/st.h`),包括其 fp8 與 I64 資料型別。
-- [tiktoken](https://github.com/openai/tiktoken):`c/tok.h` 精確地重新實作了它的
- `byte_pair_encode`,合併串接後詞彙 id 最小的相鄰對,因此源自 tiktoken 的詞彙表不需要 merges 清單。
-- [llama.cpp](https://github.com/ggml-org/llama.cpp):`c/grammar.h` 中的 GBNF 文法子集遵循它的
- 語法與 set-of-stacks PDA,Metal 路徑也借用了它的 `newBufferWithBytesNoCopy` 常駐技巧。
-- [vLLM](https://github.com/vllm-project/vllm):引擎逐位置對齊的輸出語意參考(例如最終 norm
- 相對於 LM head 的位置)。
-- [transformers](https://github.com/huggingface/transformers):oracle;CI 以它為基準逐 token
- 重現一個隨機初始化的模型。
-- [DietGPU](https://github.com/facebookresearch/dietgpu):實驗性壓縮專家層級(`COLI_ANS`)背後的
- GPU ANS 編解碼器。
-- [rocWMMA](https://github.com/ROCm/rocWMMA):HIP 後端把 CUDA 的 `nvcuda::wmma`
- fragment/mma_sync API 對應到它之上(`c/backend_gpu_compat.h`),這讓同一份 .cu 原始碼可以為
- 兩家廠商編譯。
+colibri 只是一個引擎;它所執行的智慧是一份饋贈。感謝以開放方式發布權重的團隊:
+**Z.ai**(GLM)、**Moonshot AI**(Kimi)、**Alibaba Qwen**、**DeepSeek**、
+**Xiaomi**(MiMo)、**Thinking Machines**(Inkling)、**Allen AI**(OLMoE)、
+**Convai Innovations**(Laya)、**fastino**(GLiNER2.5-Decide)與
+**Cloudflare**(Clef);感謝發布轉換後容器的人;
+也感謝每一位做過基準測試、二分定位問題、重現圖譜執行或提交修補的貢獻者。
+本儲存庫中的第三方程式碼及其授權條款:[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
## 授權條款
-Apache 2.0,Copyright 2026 Vincenzo Fornaro。詳見 [LICENSE](LICENSE) 與 [NOTICE](NOTICE)。GLM-5.2 權重由 Z.ai 以 MIT 授權發布。
+Apache 2.0,Copyright 2026 Vincenzo Fornaro。詳見 [LICENSE](LICENSE) 與 [NOTICE](NOTICE)。每個模型都保留其作者賦予的授權條款(GLM-5.2 權重由 Z.ai 以 MIT 授權發布;Qwen-Image-2.1 僅限非商業用途)。
diff --git a/c/setup_catalog.py b/c/setup_catalog.py
index a2e27a5b..34c44d3a 100644
--- a/c/setup_catalog.py
+++ b/c/setup_catalog.py
@@ -68,7 +68,7 @@ CATALOG = (
# docs/qwen36.md: peak RSS 17 GB with every expert cached (cap 256);
# the minimum follows the same engine's measured 6.5 GB at 32 experts/layer.
ram_min_gb=10, ram_good_gb=20, dense_gb=3.5, rank=3, size_class="small",
- summary="general chat with thinking, tools and images; int4-gs64 container",
+ summary="general chat with thinking and tools; int4-gs64 container",
doc="docs/qwen36.md"),
CatalogModel(
id="qwen3-coder-30b", family="qwen36", name="Qwen3-Coder-30B-A3B",
diff --git a/docs/cluster.md b/docs/cluster.md
new file mode 100644
index 00000000..3c156054
--- /dev/null
+++ b/docs/cluster.md
@@ -0,0 +1,31 @@
+# Local cluster mode
+
+The coordinator keeps token generation, routing, and KV state local while
+disk-backed expert workers execute routed FFNs on other Macs. A layer's routed
+batch-union is sent as one persistent TCP request, so a token does not incur one
+round trip per expert.
+
+Start the optional registration service:
+
+```bash
+./coli cluster coordinator --host 0.0.0.0 --port 8765
+```
+
+On each worker, with the same converted model available locally:
+
+```bash
+./coli cluster worker --model /nvme/glm52_i4 --port 9100 \
+ --coordinator http://COORDINATOR:8765 --advertise-host WORKER_IP
+```
+
+Run the coordinator with discovery, or provide `--cluster-workers
+HOST:PORT,...` for a static setup:
+
+```bash
+./coli serve --model /nvme/glm52_i4 \
+ --cluster-coordinator http://127.0.0.1:8765
+```
+
+The transport is disabled unless workers are configured, so the existing
+single-machine path remains unchanged. Dense-layer sharding and browser/WebGPU
+workers are separate follow-up seams.
diff --git a/docs/deepseek-v4.md b/docs/deepseek-v4.md
index eee656c2..03be1944 100644
--- a/docs/deepseek-v4.md
+++ b/docs/deepseek-v4.md
@@ -182,7 +182,7 @@ python ./coli serve --model C:\models\DeepSeek-V4-Flash --ram 32 --ctx 20000
target (answers end at EOS; an oversized ceiling is clamped to the context
with a stderr note). `CTX`/`--ctx` sets the context window.
-What the knobs do (full table in [Environment reference](#environment-reference)):
+What the knobs do (full table in [Environment reference](#environment-reference-v4-engine)):
`COLI_CUDA_ATTN_BATCH=1` puts the batched prefill attention block on the GPU
(compressor/indexer projections, sparse attention on a persistent device KV
ring, wo, mHC) and enables the GPU decode attention/indexer paths;
@@ -219,6 +219,17 @@ On non-Blackwell cards the generic DLL is selected automatically (fp32
kernels): same settings, prefill roughly 2–3× slower than the DeepGEMM
numbers, still far ahead of CPU.
+**Give it RAM.** 43 × 256 routed experts are ~137 GiB on disk and a token
+touches 301 of them, so the expert cache hit rate is what sets tok/s: `--ram`
+is the single most valuable knob, and it changes speed only, never output.
+
+Two opt-in GPU levers are looking for community numbers, both default off and
+byte-identical when unset: `DSV4_HYBRID=1` splits VRAM-tier misses between the
+GPU fill branch and the CPU branch using bandwidths measured at runtime, and
+`COLI_CUDA_MOE_DOUBLE=1` (on top of `COLI_CUDA_MOE_BATCH=1`) prefetches the next
+layer's full expert set into a second VRAM bank while the current layer
+computes, falling back to the single bank when VRAM is short.
+
## Prefill: segments, chunks, checkpoints
- **Chunks/segments.** Prefill runs layer-major over 128-token chunks
@@ -409,6 +420,15 @@ Defaults in parentheses; all read by `c/deepseek_v4.c` unless noted `.cu`.
`V4_NGRAM_PARTIAL_KEEP`, `COLI_V4_MARKOV_SPEC`, `COLI_V4_MARKOV_BLOCK`,
`COLI_V4_MARKOV_KEEP`.
+Why it is off: DSpark's markov drafter and full MTP are both implemented and
+verified. A draft can save forward passes but never change a token, because
+every accepted token is still the target's own argmax. Measured on real
+multi-turn chat, they accepted 1 in 15 and 10 in 24, and the rejected-suffix
+replay of this engine's recurrent attention state cost more than the drafts
+saved: one 14-token answer took 495 seconds. So `V4_DRAFT` and `V4_MTP` default
+to `0` and the code stays, with the numbers beside it, for whoever retries this
+on faster storage.
+
**Diagnostics**: `DSV4_ATTN_PROF`, `DSV4_DECODE_PROF`, `DSV4_IDX_VERIFY`,
`DSV4_CUDA_MOE_PROF`, `DSV4_CUDA_DG_PROFILE`/`_AB`/`_DUMP` (`.cu`),
`COLI_NO_OMP_TUNE`, `OMP_NUM_THREADS`.
diff --git a/docs/inkling.md b/docs/inkling.md
index 1c6e35c4..8d7bd0eb 100644
--- a/docs/inkling.md
+++ b/docs/inkling.md
@@ -9,7 +9,7 @@ head are not loaded.
## Quickstart
-Pre-converted weights (int4 experts + bf16 residents, ~469 GiB):
+Pre-converted weights (int4 experts + bf16 residents, 514 GB as Hugging Face lists the repository):
```sh
hf download nbeerbower/Inkling-colibri-int4 --local-dir ~/Models/inkling_i4
diff --git a/docs/kimi_k3.md b/docs/kimi_k3.md
index add3f2cb..dc646f7f 100644
--- a/docs/kimi_k3.md
+++ b/docs/kimi_k3.md
@@ -244,6 +244,11 @@ is returned as `reasoning_content`, response text as `content`, and
honoured between generated tokens. Long prefill also polls `CANCEL` between
layers and drops the unpublished partial state before serving another request.
+Long agent sessions can opt into recurrent-state checkpoints (`COLI_K3_CKPT=N`
+slots in RAM, or parked on disk with `COLI_K3_CKPT_DIR`): an edited or follow-up
+prompt restores the deepest surviving checkpoint and re-prefills only the tail,
+instead of replaying the whole conversation through the SSM layers.
+
## Vulkan (`make VK=1 kimi_k3`)
Run with `COLI_VULKAN=1`, a `VK=1` build puts the routed experts on the shared Vulkan
diff --git a/docs/multidisk.md b/docs/multidisk.md
index e3bff2c0..6aa9e0b6 100644
--- a/docs/multidisk.md
+++ b/docs/multidisk.md
@@ -37,11 +37,48 @@ probe failures before trusting the split. See the
[environment reference](ENVIRONMENT.md#dual-ssd-streaming) for the variables.
Missing or divergent mirror shards fall back to the primary. For a smaller
-drive, use the [partial-mirror planner](../README.md#multiple-ssds-stream-model-copies-from-more-than-one-drive)
+drive, use the [partial-mirror planner](#partial-mirrors-coli-mirror)
to stage a usage-ranked subset. `COLI_MODEL_DIRS` is a different layout: it
spreads distinct shards across drives to combine capacity, rather than adding
replicas of the same shards.
+Details worth knowing:
+
+- the mirror is **validated at startup** (per-file size + safetensors header must
+ be byte-identical to the primary); divergent or missing files stay on the
+ primary, so a **partial mirror is fine**: a smaller second SSD can serve the
+ shards it holds;
+- the mirror is **never written**: `.coli_usage`, `.coli_kv` and all sidecars stay
+ on the primary;
+- a read error on the mirror falls back to the primary (one warning, no crash), so
+ unplugging the second drive mid-run degrades instead of killing the server;
+- buffered reads use deterministic expert routing; eligible direct reads can
+ stripe one expert across replicas;
+- routing never changes tokens, because both copies are byte-identical; enable
+ `PROF=1` for the `MIRROR:` profile counters showing GB served per drive.
+
+## Partial mirrors: `coli mirror`
+
+For a second drive that cannot hold the whole model, Colibri can rank a partial
+mirror from the expert history it already learns. Run a few representative
+prompts first so `.coli_usage` reflects the workload, then plan, stage, and
+verify the mirror:
+
+```bash
+./c/coli mirror plan --model /fast/glm52_i4 --mirror /second/glm52_i4 \
+ --budget-gib 200 --reserve-gib 20
+./c/coli mirror stage --model /fast/glm52_i4 --mirror /second/glm52_i4 \
+ --budget-gib 200 --reserve-gib 20
+./c/coli mirror verify --model /fast/glm52_i4 --mirror /second/glm52_i4
+```
+
+The planner reads safetensors headers directly, follows split-model directories
+from `COLI_MODEL_DIRS`, and prioritizes shards that can serve the hottest routed
+experts. Staging never changes the primary model: it copies through temporary
+files, preserves the requested free-space reserve, verifies every shard with
+SHA-256, never deletes an existing mirror shard, and atomically publishes a
+receipt only after the selected mirror is ready.
+
## What has been measured
More storage bandwidth does not translate directly into more tokens per second.
diff --git a/docs/quickstart.md b/docs/quickstart.md
index 3b532047..a277717d 100644
--- a/docs/quickstart.md
+++ b/docs/quickstart.md
@@ -62,7 +62,7 @@ Your machine
Models that fit this machine
(fits = the dense part, which always stays in RAM, plus a minimum expert cache fit in RAM, and the download fits on the disk)
1) Qwen3.6-35B-A3B 23 GB runs from RAM [recommended]
- general chat with thinking, tools and images; int4-gs64 container; the whole model fits in RAM (20 GB)
+ general chat with thinking and tools; int4-gs64 container; the whole model fits in RAM (20 GB)
2) Qwen3-Coder-30B-A3B 19 GB runs from RAM
coding model with tool calls, no thinking; int4-gs64 container; the whole model fits in RAM (18 GB)
3) DeepSeek V4 Flash REAP 150B 85 GB streams from the SSD
@@ -109,7 +109,7 @@ The rest of this page is the same thing done by hand, step by step.
| | Minimum | Recommended |
|---|---|---|
| **RAM** | ~16 GB | 24 GB+ |
-| **Free disk** | ~380 GB for the int4 model | a fast NVMe SSD (streaming speed = your token speed) |
+| **Free disk** | ~430 GB for the GLM-5.2 int4 model (19 GB for the smallest model the one-step setup offers) | a fast NVMe SSD (streaming speed = your token speed) |
| **OS** | Linux, Windows 10/11, or macOS | any |
| **Tools** | a C compiler + `make` + `git` + `python3` | — |
@@ -255,7 +255,14 @@ also required: plain int4 heads disable speculative decoding, see
[#8](https://github.com/JustVugg/colibri/issues/8).)
Download it into a folder on a fast disk, e.g. `/nvme/glm52_i4` (Linux/macOS) or
-`D:\glm52_i4` (Windows). It is about **372 GB**, so make sure you have the space.
+`D:\glm52_i4` (Windows). It is about **429 GB**, so make sure you have the space.
+
+The MTP head must be **int8, not int4** (int4 gives 0% draft acceptance,
+[#8](https://github.com/JustVugg/colibri/issues/8)). Check it with
+`ls -l <model>/out-mtp-*`: int8 (correct) is `3527131672 / 5366238584 / 1065950496`
+as three files, or a single `out-mtp-00000.safetensors` of `9959321520` bytes
+(the current upload of the recommended container ships it as one file: same
+int8 tensors, 777 of them at one byte per element).
### Or convert it yourself from the FP8 source
diff --git a/docs/qwen36.md b/docs/qwen36.md
index d0b5a674..42fc06d4 100644
--- a/docs/qwen36.md
+++ b/docs/qwen36.md
@@ -102,7 +102,10 @@ On an integrated Radeon 780M, with the int4 gs64 container at cap 64 and the tru
on the CPU, the tier decoded at 8.03 tok/s against the CPU's 6.02 and reached the
first token of a 512-token prompt in 12.3 s against 35.7 s, the same text; the
measurements and what they leave out are in
-[vulkan.md](vulkan.md#measured-on-a-radeon-780m).
+[vulkan.md](vulkan.md#measured-on-a-radeon-780m). With the dense chain on as well
+(the default for this engine on an integrated GPU with the tier), decode reached
+9.94 tok/s against the CPU's 6.01 and the 512-token prompt 9.5 s
+([vulkan.md](vulkan.md#the-chain-on-a-radeon-780m)).
## The expert kernel
@@ -204,7 +207,9 @@ same prompt and seed, tok/s and hit rate against agreement and KL, and treat
## Which container?
The gs64 container carries one scale per 64-weight group instead of one per
-row. On GLM, per-row int4 was the root cause of think-mode loops and
+row. Against the per-row container it measured a cosine to the int8 anchor of
+0.99313 instead of 0.98777 and a KL of 0.080 instead of 0.109, about 44% less
+quantization error. On GLM, per-row int4 was the root cause of think-mode loops and
never-terminating generations (#455), and group scales fixed them in
controlled A/Bs — with `moe_intermediate_size=512`, Qwen's rows are short, so
per-row quantization error concentrates the same way. The gs64 container costs
diff --git a/docs/tuning.md b/docs/tuning.md
index f9ed37db..590030d7 100644
--- a/docs/tuning.md
+++ b/docs/tuning.md
@@ -203,6 +203,23 @@ COLI_CUDA=0` if you also want kernel-family/GPU independence. Acceptance
percentages are not comparable across engine versions under `--topp`
([#163](https://github.com/JustVugg/colibri/issues/163) has the full story).
+GLM-5.2's native MTP head drafts tokens that the main model verifies in one
+batched forward: 2.2–2.8 tokens/forward when it pays. The MTP head must be
+**int8**: int4 heads collapse to 0–4% acceptance
+([#8](https://github.com/JustVugg/colibri/issues/8)). Grammar-forced drafts
+([`GRAMMAR=file.gbnf`](grammar-draft.md)) add nearly free acceptance on
+constrained JSON output. Whether speculation is a net win depends on your cache
+temperature: measure, and use `DRAFT=0` when it does not pay.
+
+Verify batches can also opt into an **exact attention core** with
+`COLI_EXACT_VERIFY=1` ([#689](https://github.com/JustVugg/colibri/issues/689)):
+the CPU MLA-absorb score and context dots accumulate integer products and round
+once, so a near-tie in a verify row resolves the same way on every host, at
+roughly 0.6x tok/s on a tiny oracle (the dot itself is ~5–7x the float loop).
+Two limits to know: with a quantised KV cache (`tq1`, TQ or int8 KV) the
+context dot keeps the float path, so exactness there is not provided; and a
+real near-tie flip has only been argued, not yet caught on GLM-5.2 at n=64.
+
## Approximate mode: `DEGRADE_ZERO` (opt-in, OLMoE-calibrated)
`DEGRADE_ZERO=1` enables an opt-in degraded inference policy: when a prefetch
diff --git a/docs/vulkan.md b/docs/vulkan.md
index 69b522d6..72a8c67b 100644
--- a/docs/vulkan.md
+++ b/docs/vulkan.md
@@ -1218,6 +1218,7 @@ not measured; the tests prove the tokens on the tiny fixtures.
```
[VK] deepseek_v4: dense chain off (an integrated GPU with the expert tier: not measured; COLI_VK_CHAIN=0 off, 1 on, 2 prompts only)
+```
### Kimi K3 on the chain
@@ -1705,9 +1706,10 @@ hit-rate line is the tier-effectiveness number.
except with the dense chain (`COLI_VK_CHAIN=1`), which runs the whole layer, prefill
and the DSA selection included. Its routed experts are on the shared expert tier,
which serves prefill too.
-- The expert tier's uploads are host writes into host-visible device memory: a
- discrete card needs Resizable BAR for them (above). A staging copy on a transfer
- queue, for cards without it, is not written.
+- On a discrete card without Resizable BAR, resident data (the dense weights, the
+ expert tier, the KV mirror) goes through staged uploads
+ ([above](#memory-placement-without-resizable-bar)); that path is tested by forcing
+ it and by emulating the small window, and not yet measured on such a card.
- Without the dense chain, DSA top-k selection, ragged multi-slot serving, and
quantized-KV caches fall back to the CPU attention path; with it, the DSA selection
runs on the device.
diff --git a/site/index.html b/site/index.html
index 1f7c5ba2..08001013 100644
--- a/site/index.html
+++ b/site/index.html
@@ -6,7 +6,7 @@
<title>colibri</title>
<meta name="description" content="Run frontier open models on hardware you already own. A dependency-free C engine that streams mixture-of-experts weights from disk.">
<meta property="og:title" content="colibri">
-<meta property="og:description" content="Run frontier open models on hardware you already own. Ten language-model families and an image model, up to 2.8T parameters, pure C, zero dependencies.">
+<meta property="og:description" content="Run frontier open models on hardware you already own. Ten language-model families, an image model and decision models, up to 2.8T parameters, pure C, zero dependencies.">
<meta property="og:type" content="website">
<link rel="icon" type="image/svg+xml" href="colibri-icon.svg">
<link rel="preconnect" href="https://fonts.googleapis.com">
@@ -142,6 +142,7 @@ header{position:sticky;top:0;z-index:40;background:#fff}
.tg span.b{color:#2563eb;background:#eff6ff} .tg span.e{color:#059669;background:#ecfdf5}
.tg span.a{color:#b45309;background:#fffbeb} .tg span.r{color:#e11d48;background:#fff1f2}
.tg span.g{color:#525252;background:#f5f5f5}
+.tg span.s{color:#7c3aed;background:#f5f3ff}
.mm{display:flex;gap:1.1rem;flex-wrap:wrap;margin-top:.8rem;font-size:14px;color:var(--dim)}
.mm span,.mm a{display:inline-flex;align-items:center;gap:.35rem}
.mm svg{width:15px;height:15px;flex:none}
@@ -155,6 +156,12 @@ header{position:sticky;top:0;z-index:40;background:#fff}
.cp:hover{background:var(--softer);color:var(--fg)}
.mnone{color:var(--dim);padding:2rem 0}
+/* the one-step setup */
+.steps{margin:1.4rem 0 .4rem;padding-left:1.3rem;color:var(--body);font-size:1rem;line-height:1.6}
+.steps li{margin:.35rem 0}
+.steps b{color:var(--fg);font-weight:600}
+.mrow p code,.msec .sub code{font:400 14px var(--mono);background:var(--soft);border-radius:4px;padding:1px 5px}
+
/* closing + footer */
.closing{text-align:center;padding:6rem 0 7rem}
.closing svg{width:78px;height:70px;margin:0 auto 2rem;display:block}
@@ -192,6 +199,7 @@ footer{border-top:1px solid var(--line)}
[data-theme="dark"] .tg span.a{color:#fcd34d;background:#292008}
[data-theme="dark"] .tg span.r{color:#fda4af;background:#2d0d16}
[data-theme="dark"] .tg span.g{color:#a3a3a3;background:#1f1f1f}
+[data-theme="dark"] .tg span.s{color:#c4b5fd;background:#2e1065}
/* the 300ms cross-fade while the theme changes, and nothing else animated */
.theme-transition,.theme-transition *{transition:background-color .3s ease,color .3s ease,border-color .3s ease !important}
@@ -223,7 +231,7 @@ footer{border-top:1px solid var(--line)}
<rect height="14" width="14" x="84" y="84" fill="#00afaf"/><rect height="14" width="14" x="98" y="84" fill="#00afaf"/><rect height="14" width="14" x="112" y="84" fill="#5fd7d7"/><rect height="14" width="14" x="126" y="84" fill="#5fd7d7"/>
<rect height="14" width="14" x="98" y="98" fill="#00afaf"/><rect height="14" width="14" x="112" y="98" fill="#5fd7d7"/>
<rect height="14" width="14" x="112" y="112" fill="#5fd7d7"/></g></svg><b>colibri</b></a>
- <nav class="hnav"><a href="#models">Models</a><a href="#systemone">System One</a>
+ <nav class="hnav"><a href="#start">Get started</a><a href="#models">Models</a><a href="#systemone">System One</a>
<a href="https://github.com/JustVugg/colibri/blob/main/docs/quickstart.md">Docs</a></nav>
<label class="hsearch">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>
@@ -248,8 +256,8 @@ footer{border-top:1px solid var(--line)}
<p class="sub">colibri streams a model's experts off the disk instead of loading them, so a
2.8-trillion-parameter model answers on a machine that could never hold it.</p>
<div class="hcta">
- <a class="pill d big" href="#models">Browse models</a>
- <a class="pill g big" href="https://github.com/JustVugg/colibri/blob/main/docs/quickstart.md">Quickstart</a>
+ <a class="pill d big" href="#start">Get started</a>
+ <a class="pill g big" href="#models">Browse models</a>
</div>
</div>
<figure class="shot">
@@ -265,16 +273,62 @@ footer{border-top:1px solid var(--line)}
<div class="logos"><span>RTX 5090</span><span>Graviton4</span><span>Xeon Gold</span>
<span>DGX Spark</span><span>M5 Max</span><span>Ryzen 9</span><span>Mac Mini</span></div>
+<section class="msec" id="start"><div class="narrow">
+ <h2>Get started in one step</h2>
+ <p class="sub">One file looks at your machine, recommends a model that fits, gets the engine,
+ downloads the model with resume and opens the dashboard. You need 8 GB of RAM at the very
+ least (16 GB or more is better) and 22 GB free on the disk for the smallest model. A
+ graphics card is optional.</p>
+ <article class="mrow">
+ <h3>Windows</h3>
+ <p class="d">On GitHub click <b>Code</b>, then <b>Download ZIP</b>, unzip it and double-click
+ <code>START-HERE.bat</code>. If Python is missing, it offers to install it for you.</p>
+ </article>
+ <article class="mrow">
+ <h3>Linux</h3>
+ <p class="d">Ubuntu and Debian; other distributions have the same packages under their own names.</p>
+ <div class="mget"><code>sudo apt install git python3 build-essential
+git clone https://github.com/JustVugg/colibri
+cd colibri
+./start-here.sh</code><button class="cp" type="button">copy</button></div>
+ </article>
+ <article class="mrow">
+ <h3>macOS</h3>
+ <p class="d">With Homebrew.</p>
+ <div class="mget"><code>xcode-select --install
+brew install libomp git python
+git clone https://github.com/JustVugg/colibri
+cd colibri
+./start-here.sh</code><button class="cp" type="button">copy</button></div>
+ </article>
+ <ol class="steps">
+ <li><b>It looks at your machine:</b> RAM, free disk, CPU and GPUs.</li>
+ <li><b>It recommends a model that fits</b>, and Enter takes it. <code>--list</code> shows every model against your machine, <code>--model ID</code> picks another.</li>
+ <li><b>It gets the engine:</b> built for your machine when a compiler is there, or the prebuilt one. It uses your GPU when that pays: CUDA for an NVIDIA card on Linux with the CUDA toolkit, otherwise Vulkan; on an integrated GPU only for the models measured faster there. A missing package is printed as the exact command to run.</li>
+ <li><b>It downloads the model</b> with resume: stop it any time, run it again and it continues.</li>
+ <li><b>It starts colibri and opens the dashboard</b>, and prints the OpenAI and Anthropic addresses for other apps. Next time it starts straight away.</li>
+ </ol>
+ <article class="mrow">
+ <h3>Or let your AI assistant do it</h3>
+ <p class="d">Ask your coding assistant the line below; it follows every step as a command and
+ asks you before downloading anything. Assistants that speak the Model Context Protocol can
+ use <code>coli mcp</code> instead.</p>
+ <div class="mget"><code>Set up colibri on this machine following docs/AI_SETUP.md from https://github.com/JustVugg/colibri</code><button class="cp" type="button">copy</button></div>
+ </article>
+ <a class="more" href="https://github.com/JustVugg/colibri#if-something-goes-wrong">If something goes wrong &rarr;</a>
+</div></section>
+
<section class="msec" id="models"><div class="narrow">
<h2>Models</h2>
- <p class="sub">Pull a converted container where one is published, or point the engine at the
- original checkpoint.</p>
- <div class="fbar"><button class="fp" data-f="vision">vision</button><button class="fp" data-f="audio">audio</button><button class="fp" data-f="tools">tools</button><button class="fp" data-f="int4">int4</button><button class="fp" data-f="mtp">mtp</button></div>
+ <p class="sub">The ones tagged <b>setup</b> are offered by the one-step setup, which picks among
+ them by your RAM and disk. For the others, pull a converted container where one is published,
+ or point the engine at the original checkpoint.</p>
+ <div class="fbar"><button class="fp" data-f="setup">setup</button><button class="fp" data-f="decision">decision</button><button class="fp" data-f="vision">vision</button><button class="fp" data-f="audio">audio</button><button class="fp" data-f="tools">tools</button><button class="fp" data-f="int4">int4</button><button class="fp" data-f="mtp">mtp</button></div>
<div id="mlist">
- <article class="mrow" data-find="glm-5.2 glm-5.3 glm z.ai colibri.c moe int4 mla mtp" data-tags="moe int4 mla mtp">
+ <article class="mrow" data-find="glm-5.2 glm-5.3 glm z.ai colibri.c moe int4 mla mtp" data-tags="moe int4 mla mtp setup">
<h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/quickstart.md">glm-5.2 / glm-5.3</a></h3>
<p class="d">The model colibri was built around. 78 layers, 256 routed experts, streamed from disk on a machine that could never hold them. GLM-5.3 is the same base model on the same engine, from its own container, which has no MTP head.</p>
- <div class="tg"><span class="">MoE</span><span class="e">int4</span><span class="g">MLA</span><span class="a">MTP</span></div>
+ <div class="tg"><span class="s">setup</span><span class="">MoE</span><span class="e">int4</span><span class="g">MLA</span><span class="a">MTP</span></div>
<div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>744B total</span><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M13 2 4 14h7l-1 8 9-12h-7z"/></svg>40B active</span>
<a href="https://huggingface.co/mastouri/GLM-5.2-colibri-int4-g64-with-int8-mtp"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>container, 429 GB</a><a href="https://huggingface.co/Justvugg/GLM-5.3-colibri-int4-g64"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>GLM-5.3 container, 419 GB</a><a href="https://huggingface.co/zai-org/GLM-5.2-FP8">upstream</a>
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>colibri.c</span></div>
@@ -283,9 +337,9 @@ footer{border-top:1px solid var(--line)}
</article>
<article class="mrow" data-find="glm-5.3-flash glm-5.3-flash glm53 z.ai glm53.c moe int4-gs64 vision convert" data-tags="moe int4-gs64 vision">
<h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/glm53-flash.md">glm-5.3-flash</a></h3>
- <p class="d">Natively multimodal. Routed experts convert to int4-gs64, the dense set stays BF16 and its precision is a load-time choice. One resumable command downloads and converts it a shard at a time.</p>
+ <p class="d">Natively multimodal. Routed experts convert to int4-gs64, the dense set stays BF16 and its precision is a load-time choice. One resumable command downloads the 328 GB release and converts it a shard at a time.</p>
<div class="tg"><span class="">MoE</span><span class="e">int4-gs64</span><span class="b">vision</span></div>
- <div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>320B total</span><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M13 2 4 14h7l-1 8 9-12h-7z"/></svg>18B active</span>
+ <div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>321B total</span><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M13 2 4 14h7l-1 8 9-12h-7z"/></svg>18B active</span>
<a href="https://huggingface.co/zai-org/GLM-5.3-Flash"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>convert, 195 GB int4</a>
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>glm53.c</span></div>
<div class="mget"><code>python3 c/tools/convert_glm53.py --outdir ~/Models/glm53_flash_i4 --min-free-gb 30</code><button class="cp" type="button">copy</button></div>
@@ -299,66 +353,66 @@ footer{border-top:1px solid var(--line)}
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>deepseek_v41.c</span></div>
<div class="mget"><code>hf download deepseek-ai/DeepSeek-V4.1-Flash --local-dir ~/Models/DeepSeek-V4.1-Flash</code><button class="cp" type="button">copy</button></div>
</article>
- <article class="mrow" data-find="deepseek v4 flash deepseek-v4-flash deepseek_v4 deepseek deepseek_v4.c moe fp4 mtp reap" data-tags="moe fp4 mtp reap">
+ <article class="mrow" data-find="deepseek v4 flash deepseek-v4-flash deepseek_v4 deepseek deepseek_v4.c moe fp4 mtp reap" data-tags="moe fp4 mtp reap setup">
<h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/deepseek-v4.md">deepseek-v4-flash</a></h3>
<p class="d">Native fp4 experts, fp8-e4m3 dense. The REAP-pruned 150B cut, 132 of 256 experts and 85 GB, loads with the same engine and no conversion.</p>
- <div class="tg"><span class="">MoE</span><span class="e">fp4</span><span class="a">MTP</span><span class="a">REAP</span></div>
+ <div class="tg"><span class="s">setup</span><span class="">MoE</span><span class="e">fp4</span><span class="a">MTP</span><span class="a">REAP</span></div>
<div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>284B total</span><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M13 2 4 14h7l-1 8 9-12h-7z"/></svg>13B active</span>
<a href="https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>official, no conversion</a>
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>deepseek_v4.c</span></div>
<div class="mget"><code>hf download deepseek-ai/DeepSeek-V4-Flash-0731 --local-dir ~/Models/DeepSeek-V4-Flash</code><button class="cp" type="button">copy</button></div>
</article>
- <article class="mrow" data-find="mimo-v2.6-flash mimo-v2.6 mimo xiaomi mimo.c moe mxfp4 vision tools" data-tags="moe mxfp4 vision tools">
+ <article class="mrow" data-find="mimo-v2.6-flash mimo-v2.6 mimo xiaomi mimo.c moe mxfp4 vision tools" data-tags="moe mxfp4 vision tools setup">
<h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/mimo.md">mimo-v2.6-flash</a></h3>
<p class="d">Xiaomi's hybrid: 39 of its 48 layers attend a 128-token window, so a long context costs the KV of 9. Experts stream as released in MXFP4, with no conversion. 2.34 to 3.37 tok/s on an 8-core Ryzen with 64 GB.</p>
- <div class="tg"><span class="">MoE</span><span class="e">MXFP4</span><span class="b">vision</span><span class="b">tools</span></div>
+ <div class="tg"><span class="s">setup</span><span class="">MoE</span><span class="e">MXFP4</span><span class="b">vision</span><span class="b">tools</span></div>
<div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>309B total</span><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M13 2 4 14h7l-1 8 9-12h-7z"/></svg>15B active</span>
<a href="https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Flash-MOPD"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>official, no conversion</a>
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>mimo.c</span></div>
<div class="mget"><code>hf download XiaomiMiMo/MiMo-V2.6-Flash-MOPD --local-dir ~/Models/MiMo-V2.6-Flash</code><button class="cp" type="button">copy</button></div>
</article>
- <article class="mrow" data-find="mimo-v2.6-pro mimo-v2.6 mimo xiaomi mimo.c moe mxfp4 vision tools" data-tags="moe mxfp4 vision tools">
+ <article class="mrow" data-find="mimo-v2.6-pro mimo-v2.6 mimo xiaomi mimo.c moe mxfp4 vision tools" data-tags="moe mxfp4 vision tools setup">
<h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/mimo.md#pro">mimo-v2.6-pro</a></h3>
<p class="d">The same engine and architecture as Flash at 70 layers and 384 experts. Checked against Xiaomi's own modeling code on 32 of its 70 layers; 0.66 to 0.79 tok/s on the same 64 GB box.</p>
- <div class="tg"><span class="">MoE</span><span class="e">MXFP4</span><span class="b">vision</span><span class="b">tools</span></div>
+ <div class="tg"><span class="s">setup</span><span class="">MoE</span><span class="e">MXFP4</span><span class="b">vision</span><span class="b">tools</span></div>
<div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>1.02T total</span><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M13 2 4 14h7l-1 8 9-12h-7z"/></svg>42B active</span>
<a href="https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Pro-MOPD"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>official, no conversion</a>
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>mimo.c</span></div>
<div class="mget"><code>hf download XiaomiMiMo/MiMo-V2.6-Pro-MOPD --local-dir ~/Models/MiMo-V2.6-Pro --exclude "dflash/*" --exclude "audio_tokenizer/*" --exclude "model_mtp.safetensors"</code><button class="cp" type="button">copy</button></div>
</article>
- <article class="mrow" data-find="kimi k3 kimi-k3 kimi moonshot kimi_k3.c moe mxfp4 kda largest" data-tags="moe mxfp4 kda largest">
+ <article class="mrow" data-find="kimi k3 kimi-k3 kimi moonshot kimi_k3.c moe mxfp4 kda largest" data-tags="moe mxfp4 kda largest setup">
<h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/kimi_k3.md">kimi-k3</a></h3>
<p class="d">The largest model colibri runs. 93 layers, 69 Kimi Delta Attention plus 24 gated MLA, and 16 of 896 experts per token. QAT-trained MXFP4 streams straight from the original shards.</p>
- <div class="tg"><span class="">MoE</span><span class="e">MXFP4</span><span class="g">KDA</span><span class="r">largest</span></div>
+ <div class="tg"><span class="s">setup</span><span class="">MoE</span><span class="e">MXFP4</span><span class="g">KDA</span><span class="r">largest</span></div>
<div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>2.8T total</span><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M13 2 4 14h7l-1 8 9-12h-7z"/></svg>104B active</span>
<a href="https://huggingface.co/moonshotai/Kimi-K3"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>official, no conversion</a>
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>kimi_k3.c</span></div>
<div class="mget"><code>hf download moonshotai/Kimi-K3 --local-dir ~/Models/Kimi-K3</code><button class="cp" type="button">copy</button></div>
</article>
- <article class="mrow" data-find="inkling inkling inkling thinking machines inkling.c moe int4 audio apache 2.0" data-tags="moe int4 audio apache 2.0">
+ <article class="mrow" data-find="inkling inkling inkling thinking machines inkling.c moe int4 audio apache 2.0" data-tags="moe int4 audio apache 2.0 setup">
<h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/inkling.md">inkling</a></h3>
<p class="d">Sliding-window attention with short convolutions. Audio input is supported when the audio tensors are present; the dense set fits a 25 GB host at 15.3 GB.</p>
- <div class="tg"><span class="">MoE</span><span class="e">int4</span><span class="">audio</span><span class="g">Apache 2.0</span></div>
+ <div class="tg"><span class="s">setup</span><span class="">MoE</span><span class="e">int4</span><span class="">audio</span><span class="g">Apache 2.0</span></div>
<div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>975B total</span><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M13 2 4 14h7l-1 8 9-12h-7z"/></svg>41B active</span>
- <a href="https://huggingface.co/nbeerbower/Inkling-colibri-int4"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>container, 469 GB</a><a href="https://huggingface.co/thinkingmachines/Inkling">upstream</a>
+ <a href="https://huggingface.co/nbeerbower/Inkling-colibri-int4"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>container, 514 GB</a><a href="https://huggingface.co/thinkingmachines/Inkling">upstream</a>
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>inkling.c</span></div>
<div class="mget"><code>hf download nbeerbower/Inkling-colibri-int4 --local-dir ~/Models/inkling_i4</code><button class="cp" type="button">copy</button></div>
</article>
- <article class="mrow" data-find="qwen3.8-flash-next qwen3.8-flash-next qwen38 alibaba qwen38.c moe block-fp8 int4-g64 deltanet ple mtp" data-tags="moe block-fp8 int4-g64 deltanet ple mtp">
+ <article class="mrow" data-find="qwen3.8-flash-next qwen3.8-flash-next qwen38 alibaba qwen38.c moe block-fp8 int4-g64 deltanet ple mtp" data-tags="moe block-fp8 int4-g64 deltanet ple mtp setup">
<h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/qwen38.md">qwen3.8-flash-next</a></h3>
<p class="d">48 layers, 512 experts, 10 routed per token. 125B of backbone plus a 51B n-gram embedding that stays pageable and a 4B MTP head. The experts stay native block-FP8, or run as int4-g64 from an optional sidecar: 1.4-1.5x the decode speed at the same cache. Opt-in MTP drafting gives the same output, 12-14% faster.</p>
- <div class="tg"><span class="">MoE</span><span class="e">block-FP8</span><span class="e">int4-g64</span><span class="g">DeltaNet</span><span class="g">PLE</span><span class="a">MTP</span></div>
+ <div class="tg"><span class="s">setup</span><span class="">MoE</span><span class="e">block-FP8</span><span class="e">int4-g64</span><span class="g">DeltaNet</span><span class="g">PLE</span><span class="a">MTP</span></div>
<div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>180B total</span><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M13 2 4 14h7l-1 8 9-12h-7z"/></svg>6B active</span>
<a href="https://huggingface.co/Qwen/Qwen3.8-Flash-Next-FP8"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>official, no conversion</a>
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>qwen38.c</span></div>
<div class="mget"><code>hf download Qwen/Qwen3.8-Flash-Next-FP8 --local-dir ~/Models/Qwen3.8-Flash-Next-FP8</code><button class="cp" type="button">copy</button></div>
</article>
- <article class="mrow" data-find="qwen3.6-35b-a3b qwen3.6-35b-a3b qwen36 alibaba qwen36.c moe int4-gs64 deltanet cuda tier" data-tags="moe int4-gs64 deltanet cuda tier">
+ <article class="mrow" data-find="qwen3.6-35b-a3b qwen3.6-35b-a3b qwen36 alibaba qwen36.c moe int4-gs64 deltanet cuda tier" data-tags="moe int4-gs64 deltanet cuda tier setup">
<h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/qwen36.md">qwen3.6-35b-a3b</a></h3>
- <p class="d">The one to start with: 23 GB on disk, gated attention interleaved with gated DeltaNet. With CUDA=1 the VRAM expert tier measured 1.44 to 10.05 tok/s on two 8 GB cards, output bit-identical to the CPU path.</p>
- <div class="tg"><span class="">MoE</span><span class="e">int4-gs64</span><span class="g">DeltaNet</span><span class="a">CUDA tier</span></div>
+ <p class="d">The one to start with: 23 GB on disk, gated attention interleaved with gated DeltaNet. 6.0 tok/s on an 8-core desktop CPU, 9.9 with Vulkan on its integrated Radeon 780M, and 30.0 with CUDA on an RTX 3070 with the DeltaNet layers on the card.</p>
+ <div class="tg"><span class="s">setup</span><span class="">MoE</span><span class="e">int4-gs64</span><span class="g">DeltaNet</span><span class="a">CUDA tier</span><span class="a">Vulkan</span></div>
<div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>35B total</span><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M13 2 4 14h7l-1 8 9-12h-7z"/></svg>3B active</span>
- <a href="https://huggingface.co/Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>container, 20 GB</a><a href="https://huggingface.co/Qwen/Qwen3.6-35B-A3B">upstream</a>
+ <a href="https://huggingface.co/Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>container, 23 GB</a><a href="https://huggingface.co/Qwen/Qwen3.6-35B-A3B">upstream</a>
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>qwen36.c</span></div>
<div class="mget"><code>hf download Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64 --local-dir ~/Models/qwen36_i4_gs64</code><button class="cp" type="button">copy</button></div>
</article>
@@ -371,10 +425,10 @@ footer{border-top:1px solid var(--line)}
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>qwen36.c</span></div>
<div class="mget"><code>python3 c/tools/convert_qwen36.py --repo Qwen/Qwen3.8-27B --out ~/Models/qwen38_27b</code><button class="cp" type="button">copy</button></div>
</article>
- <article class="mrow" data-find="qwen3-coder-30b-a3b qwen3-coder coder code alibaba qwen36.c moe int4-gs64 tools" data-tags="moe int4-gs64 tools">
+ <article class="mrow" data-find="qwen3-coder-30b-a3b qwen3-coder coder code alibaba qwen36.c moe int4-gs64 tools" data-tags="moe int4-gs64 tools setup">
<h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/qwen36.md#qwen3-coder-30b-a3b">qwen3-coder-30b-a3b</a></h3>
<p class="d">Qwen3-Coder on the Qwen3.6 engine: 48 attention layers, 128 experts with 8 per token, tool calls in its own XML form and no thinking. With all 128 experts cached the int4 container decoded at 8.5 to 9.6 tok/s on an 8-core Ryzen, in 15.2 GB.</p>
- <div class="tg"><span class="">MoE</span><span class="e">int4-gs64</span><span class="b">tools</span></div>
+ <div class="tg"><span class="s">setup</span><span class="">MoE</span><span class="e">int4-gs64</span><span class="b">tools</span></div>
<div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>30B total</span><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M13 2 4 14h7l-1 8 9-12h-7z"/></svg>3B active</span>
<a href="https://huggingface.co/Justvugg/Qwen3-Coder-30B-A3B-colibri-int4"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>container, 19 GB</a><a href="https://huggingface.co/Qwen/Qwen3-Coder-30B-A3B-Instruct">upstream</a>
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>qwen36.c</span></div>
@@ -389,15 +443,42 @@ footer{border-top:1px solid var(--line)}
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>olmoe.c</span></div>
<div class="mget"><code>python3 c/tools/convert_olmoe_merged.py --repo allenai/OLMoE-1B-7B-0125-Instruct --out ~/Models/olmoe_i8</code><button class="cp" type="button">copy</button></div>
</article>
- <article class="mrow" data-find="qwen-image-2.1 qwen-image qwen image picture text to image alibaba qwenimage.c dit int8" data-tags="image int8 dit">
+ <article class="mrow" data-find="qwen-image-2.1 qwen-image qwen image picture text to image alibaba qwenimage.c dit int8" data-tags="image int8 dit setup">
<h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/qwen-image.md">qwen-image-2.1</a></h3>
<p class="d">Text to picture, read straight from the official diffusers checkpoint and quantized to int8 while loading. coli chat draws the image inside the terminal, coli serve answers the OpenAI images API. One 768x512 image peaks at 9.0 GB of RAM. Qwen Research License: non-commercial use only.</p>
- <div class="tg"><span class="b">image</span><span class="e">int8</span><span class="g">DiT</span><span class="g">non-commercial</span></div>
+ <div class="tg"><span class="s">setup</span><span class="b">image</span><span class="e">int8</span><span class="g">DiT</span><span class="g">non-commercial</span></div>
<div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>text to image</span>
<a href="https://huggingface.co/Qwen/Qwen-Image-2.1"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>official, 33 GB, no conversion</a>
<span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>qwenimage.c</span></div>
<div class="mget"><code>hf download Qwen/Qwen-Image-2.1 --local-dir ~/Models/Qwen-Image-2.1</code><button class="cp" type="button">copy</button></div>
</article>
+ <article class="mrow" data-find="laya convai innovations laya.c decision system one jev modernbert english" data-tags="decision">
+ <h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/laya.md">laya</a></h3>
+ <p class="d">A decision model: a state and typed questions in, a calibrated probability for every option out, in one forward pass. Served on POST /v1/systemone; 219 ms for one question on a laptop CPU, in 1.7 GB of RAM. English.</p>
+ <div class="tg"><span class="b">decision</span><span class="g">ModernBERT</span><span class="g">Apache 2.0</span></div>
+ <div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>421M</span>
+ <a href="https://huggingface.co/convaiinnovations/laya"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>official, 842 MB, no conversion</a>
+ <span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>laya.c</span></div>
+ <div class="mget"><code>hf download convaiinnovations/laya model.safetensors rl_agent_config.json "encoder/*" "tokenizer/*" --local-dir ~/Models/laya</code><button class="cp" type="button">copy</button></div>
+ </article>
+ <article class="mrow" data-find="gliner2.5-decide gliner decide fastino gliner_decide.c decision system one jev deberta english" data-tags="decision">
+ <h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/gliner_decide.md">gliner2.5-decide</a></h3>
+ <p class="d">A classifier for operational decisions: intent, routing, urgency, yes or no over a passage. All the questions of a request are read in one pass; 294 ms for one question on a busy laptop CPU, in 1.9 GB of RAM. English.</p>
+ <div class="tg"><span class="b">decision</span><span class="g">DeBERTa-v3</span><span class="g">Apache 2.0</span></div>
+ <div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>encoder + classifier</span>
+ <a href="https://huggingface.co/fastino/GLiNER2.5-Decide"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>official, 1.9 GB, no conversion</a>
+ <span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>gliner_decide.c</span></div>
+ <div class="mget"><code>hf download fastino/GLiNER2.5-Decide model.safetensors config.json "encoder_config/*" tokenizer.json tokenizer_config.json special_tokens_map.json --local-dir ~/Models/GLiNER2.5-Decide</code><button class="cp" type="button">copy</button></div>
+ </article>
+ <article class="mrow" data-find="clef cloudflare qwen36.c decision system one jev qwen3.8-27b chat" data-tags="decision tools">
+ <h3><a href="https://github.com/JustVugg/colibri/blob/main/docs/clef.md">clef</a></h3>
+ <p class="d">Qwen3.8-27B post-trained with a joint schema head that scores every option of every question in one pass. POST /v1/systemone answers natively and the same process still chats. 20.4 s per request in int8 on an 8-core desktop CPU.</p>
+ <div class="tg"><span class="b">decision</span><span class="g">dense</span><span class="g">Apache 2.0</span></div>
+ <div class="mm"><span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9 9h6v6H9z"/></svg>27B total</span>
+ <a href="https://huggingface.co/Cloudflare/clef"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></svg>convert, 55 GB</a>
+ <span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></svg>qwen36.c</span></div>
+ <div class="mget"><code>python3 c/tools/convert_qwen36.py --model ~/Models/clef --out ~/Models/clef_c</code><button class="cp" type="button">copy</button></div>
+ </article>
</div>
<p class="mnone" id="mnone" hidden>Nothing matches that.</p>
</div></section>
@@ -419,17 +500,19 @@ footer{border-top:1px solid var(--line)}
<div class="chart"><div class="crow"><span class="cl">6x RTX 5090<s>full residency</s></span><span class="ct"><i style="width:100.0%"></i></span><span class="cv">9.0-9.2<s> tok/s</s></span></div><div class="crow"><span class="cl">AWS Graviton4<s>aarch64, CPU only</s></span><span class="ct"><i style="width:87.0%"></i></span><span class="cv">8.0<s> tok/s</s></span></div><div class="crow"><span class="cl">2x Xeon Gold 6430<s>1 TB DDR5</s></span><span class="ct"><i style="width:58.9%"></i></span><span class="cv">5.42<s> tok/s</s></span></div><div class="crow"><span class="cl">NVIDIA DGX Spark<s>121 GB unified</s></span><span class="ct"><i style="width:36.2%"></i></span><span class="cv">3.33<s> tok/s</s></span></div><div class="crow"><span class="cl">MacBook Pro M5 Max<s>Metal</s></span><span class="ct"><i style="width:21.7%"></i></span><span class="cv">2.0<s> tok/s</s></span></div><div class="crow"><span class="cl">Ryzen 9 9950X3D<s>RTX 5090 + NVMe</s></span><span class="ct"><i style="width:13.4%"></i></span><span class="cv">1.23<s> tok/s</s></span></div><div class="crow"><span class="cl">25 GB dev box<s>cold</s></span><span class="ct"><i style="width:1.1%"></i></span><span class="cv">0.05-0.1<s> tok/s</s></span></div></div>
<p class="src">GLM-5.2 int4, decode speed reported by the people who ran it. The hardware
changes where the experts live, not what the model answers.</p>
- <p class="src">A GPU is optional on every engine. Any GPU with a Vulkan driver can hold an
- engine's resident weights, opt-in, and the result is checked against the CPU. Correct is
- not yet faster: on an integrated Radeon 780M it is slower than the CPU today.
+ <p class="src">A GPU is optional on every engine. With Vulkan, any GPU keeps the hottest
+ experts and runs whole layers: on the integrated Radeon 780M of an 8-core desktop,
+ Qwen3.6 went from 6.0 to 9.9 tok/s. A small model can lose on an integrated GPU, so the
+ setup turns it on only where it was measured faster; no discrete GPU has run the new
+ expert tier yet. With CUDA, NVIDIA cards keep the hottest experts in VRAM.
<a href="https://github.com/JustVugg/colibri/blob/main/docs/vulkan.md" style="text-decoration:underline;text-underline-offset:3px">Vulkan notes</a></p>
<a class="more" href="https://github.com/JustVugg/colibri/blob/main/docs/benchmarks.md">See the benchmarks &rarr;</a>
</div>
<div class="block" id="open">
<h2>Frontier open models</h2>
- <p class="sub">Ten language-model families and an image model run today, one hand-written
- C file each. Not a wrapper around someone else's runtime.</p>
+ <p class="sub">Thirteen engines run today: ten for language models, one for pictures and two
+ for decisions, one hand-written C file each. Not a wrapper around someone else's runtime.</p>
<div class="chart"><div class="crow"><span class="cl">kimi-k3<s>104B active</s></span><span class="ct"><i style="width:100.0%"></i></span><span class="cv">2.8T</span></div><div class="crow"><span class="cl">mimo-v2.6-pro<s>42B active</s></span><span class="ct"><i style="width:36.4%"></i></span><span class="cv">1.02T</span></div><div class="crow"><span class="cl">inkling<s>41B active</s></span><span class="ct"><i style="width:34.8%"></i></span><span class="cv">975B</span></div><div class="crow"><span class="cl">glm-5.2 / glm-5.3<s>40B active</s></span><span class="ct"><i style="width:26.6%"></i></span><span class="cv">744B</span></div><div class="crow"><span class="cl">deepseek-v4.1-flash<s>16B active</s></span><span class="ct"><i style="width:19.7%"></i></span><span class="cv">552B</span></div><div class="crow"><span class="cl">glm-5.3-flash<s>18B active</s></span><span class="ct"><i style="width:11.4%"></i></span><span class="cv">320B</span></div><div class="crow"><span class="cl">mimo-v2.6-flash<s>15B active</s></span><span class="ct"><i style="width:11.0%"></i></span><span class="cv">309B</span></div><div class="crow"><span class="cl">deepseek-v4-flash<s>13B active</s></span><span class="ct"><i style="width:10.1%"></i></span><span class="cv">284B</span></div><div class="crow"><span class="cl">qwen3.8-flash-next<s>6B active</s></span><span class="ct"><i style="width:6.4%"></i></span><span class="cv">180B</span></div><div class="crow"><span class="cl">qwen3.6-35b-a3b<s>3B active</s></span><span class="ct"><i style="width:1.2%"></i></span><span class="cv">35B</span></div><div class="crow"><span class="cl">qwen3-coder-30b-a3b<s>3B active</s></span><span class="ct"><i style="width:1.1%"></i></span><span class="cv">30B</span></div><div class="crow"><span class="cl">qwen3.8-27b<s>dense, all active</s></span><span class="ct"><i style="width:1.0%"></i></span><span class="cv">27B</span></div><div class="crow"><span class="cl">olmoe<s>1B active</s></span><span class="ct"><i style="width:0.8%"></i></span><span class="cv">7B</span></div></div>
<p class="src">Total parameters. Only the active ones are computed per token, and only the
routed experts move. The engines, by the names the docs use:
@@ -437,8 +520,8 @@ footer{border-top:1px solid var(--line)}
Qwen3-Coder-30B-A3B and the dense Qwen3.8-27B), Qwen3.8-Flash-Next, DeepSeek V4 Flash,
DeepSeek V4.1 Flash, MiMo-V2.6 Flash (and Pro, on the same engine).
And for images, Qwen-Image-2.1: text to picture, drawn inside the terminal.
- And for decisions, Laya and GLiNER2.5-Decide: typed questions in, a probability per
- option out.</p>
+ And for decisions, Laya and GLiNER2.5-Decide, with Clef on the Qwen3.6 engine: typed
+ questions in, a probability per option out.</p>
<a class="more" href="#models">Browse all models &rarr;</a>
</div>
@@ -447,7 +530,8 @@ footer{border-top:1px solid var(--line)}
<p class="sub">Most of what people ask a model for is a choice, not an essay. Hand it the
options it may pick and it reports the probability of each one. Nothing is generated,
so there is nothing to parse and no answer outside the list. Typed decisions with
- calibrated probabilities, API compatible with Jev (<code>POST /v1/systemone</code>).</p>
+ calibrated probabilities on <code>POST /v1/systemone</code>, with the request and the reply
+ of TypeSafe's Jev API: a Jev client switches by changing its base URL.</p>
<div class="chart"><div class="crow"><span class="cl">one question, 10 options<s>System One</s></span><span class="ct"><i style="width:38.8%"></i></span><span class="cv">101.2 s</span></div><div class="crow"><span class="cl"><s>chat</s></span><span class="ct"><i style="width:48.1%"></i></span><span class="cv">125.6 s<s> 1.2x</s></span></div><div class="crow"><span class="cl">4 items, shared instructions<s>System One</s></span><span class="ct"><i style="width:17.5%"></i></span><span class="cv">45.7 s</span></div><div class="crow"><span class="cl"><s>chat</s></span><span class="ct"><i style="width:100.0%"></i></span><span class="cv">261.1 s<s> 5.7x</s></span></div></div>
<p class="src">Measured on qwen36 (22 GB), same engine, separate processes. Time from the
prompt to the answer.</p>
@@ -458,9 +542,9 @@ footer{border-top:1px solid var(--line)}
a message to a policy.</p>
<div class="io"><b>question</b> what should the reviewer do?<br>
<b>options</b> merge &middot; request changes &middot; close</div></div>
- <div class="ex"><h3>A decision model</h3>
- <p>Laya answers the same request natively: one forward pass, probabilities its
- authors calibrated, no prompt and nothing generated.</p>
+ <div class="ex"><h3>Three decision models</h3>
+ <p>Laya, GLiNER2.5-Decide and Clef answer the same request natively: one forward pass,
+ no prompt and nothing generated. Any chat model answers it by scoring.</p>
<div class="io"><b>same API</b> POST /v1/systemone<br>
<b>Laya</b> 219 ms for one question on a laptop CPU</div></div>
<div class="ex"><h3>Many questions, one document</h3>
@@ -537,7 +621,7 @@ footer{border-top:1px solid var(--line)}
<rect height="14" width="14" x="98" y="98" fill="#00afaf"/><rect height="14" width="14" x="112" y="98" fill="#5fd7d7"/>
<rect height="14" width="14" x="112" y="112" fill="#5fd7d7"/></g></svg>
<h2>Get up and running on hardware you already own</h2>
- <a class="pill d big" href="https://github.com/JustVugg/colibri/blob/main/docs/quickstart.md">Get started</a>
+ <a class="pill d big" href="#start">Get started</a>
</div></section>
</main>