Instructions to use infosave/Kimi-Linear-48B-A3B-Code-CMF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- cortiq
How to use infosave/Kimi-Linear-48B-A3B-Code-CMF with cortiq:
# one Rust binary, no additional dependencies cargo install cortiq-cli # or a prebuilt binary from github.com/infosave2007/cmf/releases hf download infosave/Kimi-Linear-48B-A3B-Code-CMF --include "*.cmf" --local-dir . ls *.cmf # some repos ship more than one quantization
cortiq run FILE.cmf --prompt "What is the capital of France?"
cortiq serve FILE.cmf --port 8080 # OpenAI-compatible server
- Notebooks
- Google Colab
- Kaggle
Kimi-Linear-48B-A3B β CMF code specialist (17.7 GB, runs on a 24 GB MacBook)
A code-calibrated specialist build of moonshotai/Kimi-Linear-48B-A3B-Instruct in the CMF format β one file, mmap-served, no Python at inference:
| original bf16 | CMF q4t (full) | this file | |
|---|---|---|---|
| Size | 98 GB | 27.7 GB | 17.7 GB |
| Held-out code ppl | β | 7.11 | 7.30 (+2.7%) |
| Decode, M4 MacBook 24 GB | β | 4.8 tok/s (pages) | 11.1 tok/s |
| Decode, RTX A5000 24 GB (CUDA) | β | β | 164 tok/s |
| Decode, RTX A5000 24 GB (Vulkan) | β | β | 97 tok/s |
The speedup is structural: the full 27.7 GB file does not fit a 24 GB page cache and pages on every token; the specialist does fit, so the same machine decodes Γ2.3 faster.
How it was made
- Convert (pure Rust, streamed β one shard on disk at a time, so
a 98 GB checkpoint converts on a laptop):
cortiq convert --model moonshotai/Kimi-Linear-48B-A3B-Instruct --quant q4t --output kimi48-q4t.cmfThe engine executes Kimi's KDA (Kimi Delta Attention: delta rule with per-channel decay, per-projection short convolutions, sigmoid-gated output norm), NoPE MLA full-attention layers, and the sigmoid MoE router with its selection bias. The tiktoken rank table becomes a standard tokenizer.json at convert time. - Calibrate: run a representative code corpus once with
CMF_MOE_STATS=stats.jsonβ the engine records per-layer expert routing frequencies. On code, the top 64 of 256 experts carry 73% of the routing mass. - Defrag:
cortiq moe-defrag kimi48-q4t.cmf --stats stats.json --cover 0.95 --output kimi48-code.cmfPer layer, the smallest expert set covering 95% of the recorded routing mass is kept (~160 of 256); experts are renumbered into a dense prefix and the router rows AND the noaux selection bias are sliced to match. Runtime semantics equal the runtime expert mask β the ppl of the cut file is bit-identical to masking the full file.
The expert restriction is task-shaped: this file is at its best on code and technical text. For general-purpose use, convert the full model yourself with the command above (30.7 GB of free disk is enough).
Speed on NVIDIA (RTX A5000 24 GB, CUDA, cortiq 0.8.98)
cortiq bench, CMF_GPU=cuda on a build with the CUDA backend (cargo install cortiq-cli --features cuda, the NVIDIA driver and the CUDA 12.x libraries). Kimi Delta Attention and MLA run on the card:
| Mode | Speed |
|---|---|
| decode | 162.6β164.1 tok/s |
| 4096-token prompt | 2,210β2,255 tok/s (first token 1.82β1.85 s) |
| decode after the 4096-token prompt | 134.4β136.1 tok/s |
Speed on Vulkan (RTX A5000 24 GB, cortiq 0.8.98)
cortiq bench on the default build (Vulkan / DX12). Kimi Delta Attention, MLA and the experts run on the card:
| Mode | Speed |
|---|---|
| decode | 96.6β97.6 tok/s |
| 4096-token prompt | 507 tok/s |
| decode after the 4096-token prompt | 67.7β72.0 tok/s |
Run it
cargo install cortiq-cli # pure Rust, no Python
hf download infosave/Kimi-Linear-48B-A3B-Code-CMF kimi48-code.cmf --local-dir .
cortiq run kimi48-code.cmf --prompt "Write a Python function that returns the n-th Fibonacci number iteratively." --max-tokens 120
cortiq serve kimi48-code.cmf # OpenAI-compatible API
License
MIT, inherited from the base model. Weights Β© Moonshot AI; this repackaging only changes the storage format and the served expert set.
Ecosystem
- Engine / converter / format spec:
https://github.com/infosave2007/cmf β the pure-Rust runtime this
file targets (
cargo install cortiq-cli). - CMF Mobile β a Flutter app on the same runtime: local on-device chat, or the phone as an OpenAI-compatible server. This 17.7 GB specialist wants a desktop's RAM; on phones pick a smaller CMF build (e.g. Bonsai-1.7B or Nanbeige 4.2 3B).
- Downloads last month
- 1,023
Model tree for infosave/Kimi-Linear-48B-A3B-Code-CMF
Base model
moonshotai/Kimi-Linear-48B-A3B-Instruct