GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - andy12b/colibri-hybrid: Running a 744B GLM-5.2 MoE LLM from SSD on a laptop: EntMTP dynamic speculation depth + MoE-SpeQ expert prefetch (+19% lossless). Honest findings on top of JustVugg/colibri.

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
artifacts
artifacts
 
 
c
c
 
 
.gitignore
.gitignore
 
 
AI_HANDOFF.md
AI_HANDOFF.md
 
 
Colibri_Hybrid_Architecture.md
Colibri_Hybrid_Architecture.md
 
 
GEMINI_REPORT.md
GEMINI_REPORT.md
 
 
README.md
README.md
 
 
RESEARCH_FINDINGS_FOR_GEMINI.md
RESEARCH_FINDINGS_FOR_GEMINI.md
 
 
TASKS_FOR_GEMINI.md
TASKS_FOR_GEMINI.md
 
 
_HALT_NOTICE.md
_HALT_NOTICE.md
 
 
aggregate_moe.py
aggregate_moe.py
 
 
aggregate_moe_log.py
aggregate_moe_log.py
 
 
append_report.py
append_report.py
 
 
auto_orchestrator.py
auto_orchestrator.py
 
 
auto_results.json
auto_results.json
 
 
bench_t23.py
bench_t23.py
 
 
bench_t23_out.txt
bench_t23_out.txt
 
 
bench_t24.py
bench_t24.py
 
 
check_mtp.py
check_mtp.py
 
 
commit_escrow.ps1
commit_escrow.ps1
 
 
discussion207_reply_draft.md
discussion207_reply_draft.md
 
 
draft_gpu_shm.py
draft_gpu_shm.py
 
 
draft_out.txt
draft_out.txt
 
 
draft_server.py
draft_server.py
 
 
draft_shm_log.txt
draft_shm_log.txt
 
 
engine_log.txt
engine_log.txt
 
 
escrow_ready.txt
escrow_ready.txt
 
 
get_baseline_outputs.py
get_baseline_outputs.py
 
 
grow_pagefile.ps1
grow_pagefile.ps1
 
 
health_probe.json
health_probe.json
 
 
hwinfo.c
hwinfo.c
 
 
ipc_test_response1.json
ipc_test_response1.json
 
 
middleware.py
middleware.py
 
 
middleware_log.txt
middleware_log.txt
 
 
mtp_test_response.json
mtp_test_response.json
 
 
mtp_test_response10.json
mtp_test_response10.json
 
 
mtp_test_response2.json
mtp_test_response2.json
 
 
mtp_test_response4.json
mtp_test_response4.json
 
 
mtp_test_response5.json
mtp_test_response5.json
 
 
mtp_test_response6.json
mtp_test_response6.json
 
 
mtp_test_response7.json
mtp_test_response7.json
 
 
mtp_test_response8.json
mtp_test_response8.json
 
 
mtp_test_response8b.json
mtp_test_response8b.json
 
 
mtp_test_response9.json
mtp_test_response9.json
 
 
ntfc_log.csv
ntfc_log.csv
 
 
outputs_14.txt
outputs_14.txt
 
 
outputs_baseline.txt
outputs_baseline.txt
 
 
outputs_step6.txt
outputs_step6.txt
 
 
outputs_t12_pipe_4.txt
outputs_t12_pipe_4.txt
 
 
outputs_t13_draft_4.txt
outputs_t13_draft_4.txt
 
 
patch_glm.py
patch_glm.py
 
 
patch_glm2.py
patch_glm2.py
 
 
patch_glm3.py
patch_glm3.py
 
 
patch_glm_final.py
patch_glm_final.py
 
 
patch_glm_fixed.py
patch_glm_fixed.py
 
 
patch_speq2.py
patch_speq2.py
 
 
pool_log.csv
pool_log.csv
 
 
pool_tags.ps1
pool_tags.ps1
 
 
pool_tags_baseline.txt
pool_tags_baseline.txt
 
 
pool_watchdog.ps1
pool_watchdog.ps1
 
 
quality_eval.jsonl
quality_eval.jsonl
 
 
quality_eval.py
quality_eval.py
 
 
research_final_2026-07-17.json
research_final_2026-07-17.json
 
 
research_salvage_2026-07-16.jsonl
research_salvage_2026-07-16.jsonl
 
 
results_14.txt
results_14.txt
 
 
run.bat
run.bat
 
 
run_final_candidate_benchmark.py
run_final_candidate_benchmark.py
 
 
run_ladder_test.py
run_ladder_test.py
 
 
run_ladder_test_v2.py
run_ladder_test_v2.py
 
 
run_step_14.ps1
run_step_14.ps1
 
 
run_task15.py
run_task15.py
 
 
run_task15_server.py
run_task15_server.py
 
 
run_task17_benchmark.py
run_task17_benchmark.py
 
 
run_task17_benchmark_v2.py
run_task17_benchmark_v2.py
 
 
sanity_test.py
sanity_test.py
 
 
shm_probe.py
shm_probe.py
 
 
start_colibri_full.ps1
start_colibri_full.ps1
 
 
start_engine_baseline.cmd
start_engine_baseline.cmd
 
 
start_engine_baseline_temp.cmd
start_engine_baseline_temp.cmd
 
 
start_engine_best.cmd
start_engine_best.cmd
 
 
start_engine_best_no_overcommit.cmd
start_engine_best_no_overcommit.cmd
 
 
start_engine_eco.cmd
start_engine_eco.cmd
 
 
start_engine_ladder_11_14.cmd
start_engine_ladder_11_14.cmd
 
 
start_engine_ladder_11_16.cmd
start_engine_ladder_11_16.cmd
 
 
start_engine_mtp.cmd
start_engine_mtp.cmd
 
 
start_engine_step2.cmd
start_engine_step2.cmd
 
 
start_engine_step3.cmd
start_engine_step3.cmd
 
 
start_engine_step5.cmd
start_engine_step5.cmd
 
 
start_engine_step6.cmd
start_engine_step6.cmd
 
 
start_engine_temp.cmd
start_engine_temp.cmd
 
 
start_middleware.cmd
start_middleware.cmd
 
 
start_pipe_4.cmd
start_pipe_4.cmd
 
 
task15_outputs.txt
task15_outputs.txt
 
 
task16_report.md
task16_report.md
 
 
test_draft_model.py
test_draft_model.py
 
 
test_glm_model.py
test_glm_model.py
 
 
test_hybrid_speed.py
test_hybrid_speed.py
 
 
test_kvs.cmd
test_kvs.cmd
 
 
trim_ws.ps1
trim_ws.ps1
 
 
upgrade_ladder_results.md
upgrade_ladder_results.md
 
 

Repository files navigation

Colibri Hybrid β€” running a 744B MoE LLM from SSD on a laptop

Experiments, optimizations, and honest findings built on top of the excellent JustVugg/colibri engine β€” which streams a 744B-parameter GLM-5.2 Mixture-of-Experts model from NVMe, one expert at a time, so it runs on machines with far less RAM than the model's size.

This repo is the pipeline + research half of the project. The matching engine changes live on a fork branch: πŸ‘‰ andy12b/colibri @ branch entmtp-speq

Status: paused / archived. The author has stepped back to let the underlying tech mature. Everything here is public so it can help someone else and so it can be re-created later. Contributions and questions welcome.


TL;DR β€” what actually worked (and what didn't)

The bottleneck for a disk-streamed MoE is not drafting speculative tokens β€” it is verification: every token the model rejects still costs a full 744B forward pass (hundreds of random expert reads from SSD). So the winning moves reduce wasted verification, not raw draft speed.

βœ… What won (measured, lossless, promoted into the engine)

Technique What it does Result
EntMTP β€” entropy-gated speculation depth Picks how many draft tokens to verify per round from the MTP head's confidence (top-1 prob). Low confidence β†’ speculate less; high β†’ deeper. Lossless by construction (you choose how much to speculate, not what to accept). +15–19% throughput vs static depth, quality gate identical
MoE-SpeQ — expert prefetch from drafts Maps each speculative MTP draft token → its likely experts (via a token→experts table built from instrumentation) and prefetches them before verification. 62.7% miss-coverage (top-8 table); combined engine = 0.151 tok/s, +19%

Quality was gated on every change with a 20-prompt eval (quality_eval.py) β€” the promoted engine passed 19/20 (the one "fail" is an accepted docstring-format artifact, not a correctness regression).

❌ What was tried and rejected (negative results β€” the useful part)

Idea Why it seemed good What the measurement showed
GPU draft model over IPC shared memory A small GLM-family draft model on the RTX 5060, feeding proposals into the engine via Local\ColibriDraftShm (zero HTTP). Loses to the engine's native MTP head. First-draft acceptance 45.5% (GPU draft) vs 60% (MTP conditioned on the full 744B hidden state). Every rejected GPU draft is pure verification tax.
Chinese-compression pipeline GLM "reasons" densely in Chinese, a GPU model expands to English β†’ fewer tokens. On the int4 colibri conversion, the same content cost more tokens in Chinese (~1.5 chars/token vs ~6.3 for English). Net loss.
EXPERT_BUDGET, naΓ―ve int2, mmap on Windows Various "free speedups" from old docs. All quarantined upstream / measured worse β€” they wreck quality or RSS.

⚠️ If you find this repo: the earlier version of this README advertised "~6 tok/s, 60–120Γ— speedup" from the GPU-draft/IPC path. That was a hypothesis, not a measured result β€” and it turned out to be false. The honest number on this hardware is ~0.15 tok/s for the 744B model, with EntMTP+SpeQ giving a +19% lossless improvement over the engine's own strong MTP baseline. Kept here so nobody repeats the dead ends.


The hardware this ran on

A single consumer gaming laptop β€” the whole point is that 744B runs at all:

  • GPU: NVIDIA RTX 5060 Laptop, 8 GB VRAM
  • RAM: 32 GB DDR5 (engine auto-sizes to ~12.6 GB working set)
  • Storage: NVMe Gen4 SSD β€” the model lives here (~364 GB, GLM-5.2 int4) and is streamed expert-by-expert during inference
  • OS: Windows 11

I/O is everything: the engine does hundreds of random 4–64 KB reads per token. Faster random-read NVMe β‰ˆ faster inference.


Architecture

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   Web UI  ───────► β”‚  middleware.py  (FastAPI, port 8000)     β”‚
  (React/Vite)      β”‚  β€’ SSE per-token streaming relay          β”‚
                    β”‚  β€’ temp-0 default, /ipc-stats telemetry   β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                        β”‚  OpenAI-compatible HTTP
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  colibri engine  (glm.exe, port 8080)     β”‚
                    β”‚  β€’ GLM-5.2 744B MoE, experts streamed      β”‚
                    β”‚    from NVMe                               β”‚
                    β”‚  β€’ MTP head speculative decoding           β”‚
                    β”‚  β€’ EntMTP  (dynamic depth)   [ENT_MTP=1]   β”‚
                    β”‚  β€’ MoE-SpeQ (expert prefetch) [MOE_SPEQ=1] β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Engine (the glm.c changes) β†’ fork branch entmtp-speq
  • Pipeline (this repo) β†’ middleware, web UI wiring, orchestration, benchmarks, research

Reinstall / setup from scratch

For future-me or anyone reproducing it. Order matters.

1. Get the model (~364 GB)

The engine needs a GLM-5.2 int4 snapshot (here it lived at D:\glm52_i4). This is produced from the original GLM-5.2 weights using colibri's conversion tooling β€” see the upstream colibri README for the current, canonical download + conversion steps. It is not stored in git (way over GitHub's limits).

2. Build the engine (with the EntMTP + MoE-SpeQ work)

git clone https://github.com/andy12b/colibri.git
cd colibri
git checkout entmtp-speq
# Build the C engine (Windows: MinGW GCC / WinLibs; see c/Makefile).
# Put temp dirs on a drive with space; produces c/glm.exe
make -C c

MoE-SpeQ also needs the token→experts table (moe_top8_table.bin, ~195 MB) — it is regenerated by the instrumentation scripts in this repo (aggregate_moe*.py), not committed.

3. Get this pipeline

git clone https://github.com/andy12b/colibri-hybrid.git
cd colibri-hybrid
python -m venv .venv && .venv\Scripts\activate
pip install fastapi uvicorn httpx llama-cpp-python   # see imports in middleware.py

4. Run the stack

start_engine_eco.cmd      # engine on :8080 (ENT_MTP=1 MOE_SPEQ=1, --ram 10)
start_middleware.cmd      # middleware on :8000
# web UI: cd web && npm install && npm run dev   (in the engine repo)

Note: run.bat in this repo is outdated (it wires the rejected GPU-draft path). Use the start_engine_*.cmd / start_middleware.cmd starters.

Test protocol (if you benchmark)

  • Temperature 0 is mandatory β€” any temp > 0 tanks measured acceptance via rejection sampling.
  • Metric: tok/s = completion_tokens / wall_seconds, median of 3 runs + 1 discarded warmup.
  • A/B comparisons must be interleaved in one engine session (Windows throttles background processes β€” separate runs measure the throttle, not the algorithm).

What's in here

  • middleware.py β€” FastAPI relay (SSE streaming, telemetry, CJK-gated translation fallback)
  • quality_eval.py / quality_eval.jsonl β€” the automated quality gate (run on every change)
  • aggregate_moe*.py β€” build the MoE-SpeQ tokenβ†’experts table from engine instrumentation
  • start_engine_*.cmd, start_middleware.cmd β€” validated launchers
  • AI_HANDOFF.md, TASKS_FOR_GEMINI.md, GEMINI_REPORT.md β€” the running log of a two-AI orchestration (Claude planned/verified, Gemini executed) that produced most of the round-2/round-3 work
  • upgrade_ladder_results.md, research_*.json* β€” benchmark ladders and research notes

Credits

  • Engine & the hard part: JustVugg/colibri (Apache 2.0) β€” running 744B from SSD is their achievement.
  • EntMTP / MoE-SpeQ / pipeline / measurements: this project. See discussion #207 upstream for the datapoint report.

License: code here follows upstream (Apache 2.0) where derived; research notes are shared freely.

About

Running a 744B GLM-5.2 MoE LLM from SSD on a laptop: EntMTP dynamic speculation depth + MoE-SpeQ expert prefetch (+19% lossless). Honest findings on top of JustVugg/colibri.

Topics

glmgpu-poorllm-inferencelocal-llmmixture-of-expertsmoeon-device-aiquantizationspeculative-decoding

Resources

Readme
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.