SuperAPI AI Directory

Colibrì - Open-source lightweight local inference engine with tiered-storage inference

Author: AI小集 · Original source: AI工具集

What is Colibrì

Colibrì is an open-source lightweight local inference engine that can run a 744B-parameter GLM-5.2 flagship MoE model on a consumer-grade computer with 25GB of RAM. Through a tiered-storage architecture, the model keeps resident parameters in memory and stores massive routed expert parameters on an NVMe drive, loading them on demand, breaking through the traditional limitation that a model must fit entirely into high-speed memory.

Colibrì

Main features of Colibrì

  • Tiered-storage inference: Distributes expert parameters across three tiers of storage—GPU VRAM, system memory, and NVMe drive—loading them dynamically on demand, breaking through memory capacity limits.
  • Local deployment of ultra-large-scale models: Supports running the 744B-parameter GLM-5.2 MoE flagship model on a consumer-grade computer with 25GB of RAM.
  • int4 quantization compression: Resident parameters after int4 quantization occupy about 9.9GB of resident memory; the 370GB of routed expert parameters are stored on the local drive.
  • Pure C streaming CPU inference: A lightweight engine with zero external dependencies that achieves dynamic scheduling of expert parameters through streaming loading, with no need to load the full model into high-speed memory.
  • Web visual control panel: Built-in Chat interface that displays inference performance metrics such as TTFT, throughput, and queue status in real time.
  • Expert routing brain view: The Brain page presents routing heatmaps and storage tiers using a 76-layer × 256-expert matrix; hovering the mouse shows each expert's topic preferences.

Technical principles of Colibrì

  • Exploiting MoE sparse activation: GLM-5.2 has 744B total parameters with about 40B activated per token; Colibrì uses this sparsity to keep fixed parameters resident in memory and load only the expert parameters that change with routing on demand.
  • Tiered-storage architecture: Splits the model into about 9.9GB of resident parameters and about 370GB of routed experts, residing respectively in memory and on the NVMe drive, forming a three-tier storage pool of VRAM/memory/disk.
  • Streaming expert loading: The 21,504 routed experts are dynamically streamed from disk during inference based on the router's selection.
  • LRU and learning cache: Each layer has an independent LRU cache that retains hot experts, while a learning cache records usage history across sessions, prioritizing keeping high-frequency experts pinned in memory to reduce disk I/O.
  • Router-Lookahead prefetching: Predicts the experts needed by the next layer based on the current layer's post-attention state, and asynchronously prefetches them via a dedicated I/O thread while the current layer is computing, using WILLNEED system calls to accelerate reads.
Dig into GitHub

Follow on WeChat and reply "open source" to join theAI open-source project community group

How to use Colibrì

  • Environment preparation: Requires a Linux or WSL2 system, an x86-64 CPU supporting AVX2, a GCC compiler, at least 16GB of memory, and a local NVMe SSD with about 400GB of available space.
  • Get the engine source code: Run git clone https://github.com/JustVugg/colibri to clone the repository, enter the colibri/c directory, then run ./setup.sh to complete one-click compilation and generate a pure C zero-dependency executable.
  • Download the pre-converted model: From the Hugging Face repository jlnsrk/GLM-5.2-colibri-int4 download the int4-quantized model container and store it on the local NVMe drive.
  • Start a local conversation: after setting the model path, run COLI_MODEL=/nvme/glm52_i4 ./coli chat. The first load takes about 30 seconds, and it resides in memory at about 9.9GB. You can interact with GLM-5.2 in the terminal.
  • Start the API service: run COLI_MODEL=/nvme/glm52_i4 ./coli serve --host 0.0.0.0 --port 8000 to start an OpenAI-compatible HTTP service. Any client that supports the OpenAI protocol can connect directly.
  • Native Windows compilation: Windows 11 users can install GCC via MinGW-w64 or MSYS2, and in the c/ directory run make glm.exe to compile a native executable.

Colibrì's core advantages

  • Run flagship models on consumer-grade hardware: It breaks through the traditional limitation that the 744B-parameter GLM-5.2 must be deployed on server clusters. It can run locally with only 25GB of memory and an NVMe drive.
  • Pure C, zero dependencies, extremely lightweight: The entire engine is written in pure C and does not depend on any external libraries or runtime. The compiled output is extremely small, and startup is fast.
  • Tiered storage with intelligent scheduling: Its original three-tier expert cache system spans VRAM, memory, and disk. Combined with LRU and learned caching, it keeps frequently used experts resident in memory and streams low-frequency experts from disk on demand.
  • Router-Lookahead prefetch acceleration: It predicts the experts needed by the next layer based on the current layer's state, with an accuracy rate above 70%. Asynchronous I/O threads complete prefetching during computation gaps, significantly reducing disk read latency.
  • int4 quantization and hand-written kernels: Global int4 quantization compresses the 744B model to about 380GB of disk usage. Combined with hand-written AVX2 integer dot-product kernels, it enables efficient inference without BLAS dependencies.
  • Extreme MLA KV-Cache compression: The KV-Cache uses only 576 values per token, about 1/57 of traditional solutions. This greatly reduces memory usage for long contexts and supports persistent recovery.

Colibrì's project address

  • GitHub repository:https://github.com/JustVugg/colibri

Comparison of Colibrì with similar competing products

Dimension Colibrì KTransformers
Core positioning A pure C, zero-dependency inference engine with tiered storage for very large MoE models A CPU-GPU heterogeneous MoE inference and fine-tuning framework from Tsinghua
Maximum model support 744B GLM-5.2 (runs with 25GB RAM + NVMe) 671B DeepSeek-R1 / 1T+ Kimi-K2.5 (requires large memory + optional GPU)
Expert scheduling strategy Three-tier streaming across VRAM/memory/disk + Router-Lookahead prefetching CPU-GPU frequency-aware placement + dynamic reallocation + three-tier Prefix Cache
Hardware threshold Pure CPU is sufficient; the minimum threshold is 25GB RAM + NVMe Recommended: a large-memory workstation + consumer-grade GPU; CPU must support AVX2/AMX
Dependency footprint Pure C, zero dependencies, extremely lightweight Python + PyTorch + CUDA, relatively heavy
Quantization support Global int4 + hand-written AVX2 kernels Multi-level quantization: FP8 / BF16 / INT8 / INT4 / GGUF
Visualization Cerebral-cortex-level expert routing heatmap Basic monitoring panel and logs
Fine-tuning capability Inference only Native support for LoRA SFT fine-tuning, integrated with LLaMA-Factory

Colibrì's application scenarios

  • Personal local deployment of flagship large models: Developers with no server budget can experience the full inference capabilities of the 744B-parameter GLM-5.2 on a home computer.
  • Offline inference on edge devices: Run ultra-large MoE models on memory-constrained industrial PCs or edge boxes to meet intelligent decision-making needs in offline environments.
  • Rapid preliminary research on model performance: Without applying for expensive cloud resources, you can verify the actual performance of ultra-large-scale models on specific business tasks.
  • Processing of privacy-sensitive data: In scenarios such as healthcare, finance, and government affairs, data never leaves the local device throughout the process, meeting strict data privacy compliance requirements.
  • Teaching and research on MoE mechanisms: Low-cost research on expert routing, hierarchical caching, and quantized inference technologies, facilitating university classroom demonstrations and academic paper experiments.