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: DeepSeek V4 on Windows and REAP, from #1906

JustVugg6274d5fe9b90
diff --git a/c/qwen36_tiny/config.json b/c/qwen36_tiny/config.json
deleted file mode 100644
index 2645cecc..00000000
--- a/c/qwen36_tiny/config.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "architectures": [
- "Qwen3_5MoeForCausalLM"
- ],
- "attention_bias": false,
- "attention_dropout": 0.0,
- "bos_token_id": null,
- "dtype": "float32",
- "eos_token_id": null,
- "head_dim": 16,
- "hidden_act": "silu",
- "hidden_size": 64,
- "initializer_range": 0.02,
- "intermediate_size": 128,
- "layer_types": [
- "linear_attention",
- "linear_attention",
- "linear_attention",
- "full_attention",
- "linear_attention",
- "linear_attention",
- "linear_attention",
- "full_attention"
- ],
- "linear_conv_kernel_dim": 4,
- "linear_key_head_dim": 8,
- "linear_num_key_heads": 4,
- "linear_num_value_heads": 8,
- "linear_value_head_dim": 8,
- "max_position_embeddings": 512,
- "model_type": "qwen3_5_moe_text",
- "moe_intermediate_size": 32,
- "num_attention_heads": 4,
- "num_experts": 8,
- "num_experts_per_tok": 2,
- "num_hidden_layers": 8,
- "num_key_value_heads": 2,
- "output_router_logits": false,
- "pad_token_id": null,
- "partial_rotary_factor": 0.25,
- "rms_norm_eps": 1e-06,
- "rope_parameters": {
- "partial_rotary_factor": 0.25,
- "rope_theta": 10000.0,
- "rope_type": "default"
- },
- "router_aux_loss_coef": 0.001,
- "shared_expert_intermediate_size": 32,
- "tie_word_embeddings": false,
- "transformers_version": "5.16.1",
- "use_cache": true,
- "vocab_size": 320
-}
diff --git a/c/qwen36_tiny/generation_config.json b/c/qwen36_tiny/generation_config.json
deleted file mode 100644
index ae1401e3..00000000
--- a/c/qwen36_tiny/generation_config.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "_from_model_config": true,
- "output_attentions": false,
- "output_hidden_states": false,
- "transformers_version": "5.16.1",
- "use_cache": true
-}
diff --git a/c/qwen36_tiny_c/README.md b/c/qwen36_tiny_c/README.md
deleted file mode 100644
index 59dbd3cf..00000000
--- a/c/qwen36_tiny_c/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-tags:
- - colibri
- - qwen3.6
- - qwen3.6-35b-a3b
- - moe
-library_name: colibri
----
-
-colibri container for Qwen3.6-35B-A3B (Phase 2: all layers, incl. Gated DeltaNet).
-Every layer (Gated-Attention + Gated DeltaNet linear_attention) carries its
-MoE/MLP block. DeltaNet weights live under model.layers.{i}.linear_attn.* and are
-run by the recurrent gated-delta-rule in the colibri `qwen36` engine.
-
-Engine: https://github.com/JustVugg/colibri (c/qwen36.c)
diff --git a/c/qwen36_tiny_c/config.hf.json b/c/qwen36_tiny_c/config.hf.json
deleted file mode 100644
index 2645cecc..00000000
--- a/c/qwen36_tiny_c/config.hf.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "architectures": [
- "Qwen3_5MoeForCausalLM"
- ],
- "attention_bias": false,
- "attention_dropout": 0.0,
- "bos_token_id": null,
- "dtype": "float32",
- "eos_token_id": null,
- "head_dim": 16,
- "hidden_act": "silu",
- "hidden_size": 64,
- "initializer_range": 0.02,
- "intermediate_size": 128,
- "layer_types": [
- "linear_attention",
- "linear_attention",
- "linear_attention",
- "full_attention",
- "linear_attention",
- "linear_attention",
- "linear_attention",
- "full_attention"
- ],
- "linear_conv_kernel_dim": 4,
- "linear_key_head_dim": 8,
- "linear_num_key_heads": 4,
- "linear_num_value_heads": 8,
- "linear_value_head_dim": 8,
- "max_position_embeddings": 512,
- "model_type": "qwen3_5_moe_text",
- "moe_intermediate_size": 32,
- "num_attention_heads": 4,
- "num_experts": 8,
- "num_experts_per_tok": 2,
- "num_hidden_layers": 8,
- "num_key_value_heads": 2,
- "output_router_logits": false,
- "pad_token_id": null,
- "partial_rotary_factor": 0.25,
- "rms_norm_eps": 1e-06,
- "rope_parameters": {
- "partial_rotary_factor": 0.25,
- "rope_theta": 10000.0,
- "rope_type": "default"
- },
- "router_aux_loss_coef": 0.001,
- "shared_expert_intermediate_size": 32,
- "tie_word_embeddings": false,
- "transformers_version": "5.16.1",
- "use_cache": true,
- "vocab_size": 320
-}
diff --git a/c/qwen36_tiny_c/config.json b/c/qwen36_tiny_c/config.json
deleted file mode 100644
index cd645c0a..00000000
--- a/c/qwen36_tiny_c/config.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "architectures": [
- "Qwen3_5MoeForCausalLM"
- ],
- "attention_bias": false,
- "attention_dropout": 0.0,
- "bos_token_id": null,
- "dtype": "float32",
- "eos_token_id": null,
- "head_dim": 16,
- "hidden_act": "silu",
- "hidden_size": 64,
- "initializer_range": 0.02,
- "intermediate_size": 128,
- "layer_types": [
- "linear_attention",
- "linear_attention",
- "linear_attention",
- "full_attention",
- "linear_attention",
- "linear_attention",
- "linear_attention",
- "full_attention"
- ],
- "linear_conv_kernel_dim": 4,
- "linear_key_head_dim": 8,
- "linear_num_key_heads": 4,
- "linear_num_value_heads": 8,
- "linear_value_head_dim": 8,
- "max_position_embeddings": 512,
- "model_type": "qwen3_5_moe_text",
- "moe_intermediate_size": 32,
- "num_attention_heads": 4,
- "num_experts": 8,
- "num_experts_per_tok": 2,
- "num_hidden_layers": 8,
- "num_key_value_heads": 2,
- "output_router_logits": false,
- "pad_token_id": null,
- "partial_rotary_factor": 0.25,
- "rms_norm_eps": 1e-06,
- "rope_parameters": {
- "partial_rotary_factor": 0.25,
- "rope_theta": 10000.0,
- "rope_type": "default"
- },
- "router_aux_loss_coef": 0.001,
- "shared_expert_intermediate_size": 32,
- "tie_word_embeddings": false,
- "transformers_version": "5.16.1",
- "use_cache": true,
- "vocab_size": 320
-}
\ No newline at end of file
diff --git a/c/qwen36_tiny_c/qwen36_meta.json b/c/qwen36_tiny_c/qwen36_meta.json
deleted file mode 100644
index 26970e82..00000000
--- a/c/qwen36_tiny_c/qwen36_meta.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "model_type": "qwen3_5_moe_text",
- "hidden": 64,
- "n_layers": 8,
- "n_active": 8,
- "layer_types": [
- "linear_attention",
- "linear_attention",
- "linear_attention",
- "full_attention",
- "linear_attention",
- "linear_attention",
- "linear_attention",
- "full_attention"
- ],
- "num_experts": 8,
- "topk": 2,
- "moe_inter": 32,
- "shared_inter": 32,
- "rms_eps": 1e-06,
- "ebits": 8,
- "scoring_func": "softmax",
- "n_group": 1,
- "topk_group": 1,
- "norm_topk_prob": false,
- "attn_output_gate": false,
- "rope_theta": 10000.0,
- "mrope_section": [
- 16,
- 16,
- 16
- ],
- "partial_rotary_factor": 0.25,
- "q_heads": 4,
- "kv_heads": 2,
- "q_head_dim": 32,
- "k_head_dim": 16,
- "v_head_dim": 16,
- "o_in": 64,
- "qk_rope_head_dim": 16,
- "expert_gs": 0,
- "head_dim": 16,
- "rope_dim": 16,
- "dn_vheads": 8,
- "dn_kheads": 4,
- "dn_kdim": 8,
- "dn_vdim": 8,
- "dn_convk": 4,
- "dn_conv_dim": 128
-}
\ No newline at end of file
diff --git a/docs/deepseek-v4.md b/docs/deepseek-v4.md
index 03be1944..5b61741a 100644
--- a/docs/deepseek-v4.md
+++ b/docs/deepseek-v4.md
@@ -90,6 +90,12 @@ experts per matrix and takes the original contiguous fast path everywhere else
(#1310). The banner reports it by its measured geometry, `43L x 132E`, rather
than the 284B of the official checkpoint, because that number is not its.
+Its experts take 76 GB, about half the official checkpoint's, so the RAM that suits the official
+checkpoint does not carry over, and more is not always faster: on a 128 GB
+Threadripper PRO 3975WX (#1906) `--ram 64` decoded 0.768 tok/s, 90 and 100
+0.745, 120 0.765. Two or three runs of your own prompt at different `--ram`
+values find the best one for a machine.
+
A download can finish with a truncated shard even when the client reports
success. If `st.h` rejects a shard as out of bounds, compare every local shard
size with the Hugging Face repository before treating it as an engine failure.
@@ -103,6 +109,10 @@ cd c
make deepseek-v4 # ARCH=native for the local CPU (default x86-64-v3)
```
+The build uses link-time optimization by default. A gcc built without it (the
+portable w64devkit on Windows says `LTO support has not been enabled in this
+configuration`) builds with `make deepseek-v4 LTO=0`.
+
### Windows CUDA tier
The engine is MinGW-built (MSYS2 **UCRT64** shell: `MSYSTEM=UCRT64`; the plain
@@ -178,7 +188,9 @@ $env:V4_LOADER_LANES = "3" # GPU tier: 9-lane default tuned for the CPU path,
python ./coli serve --model C:\models\DeepSeek-V4-Flash --ram 32 --ctx 20000
```
-`coli run|chat|web` take the same environment. `--ngen` is a ceiling, not a
+`coli run|chat|web` take the same environment. On Windows a prompt with text
+outside ASCII (Chinese, accented letters) does not survive the command line of
+the engine run by hand: give it with `--prompt-file <UTF-8 file>`. `--ngen` is a ceiling, not a
target (answers end at EOS; an oversized ceiling is clamped to the context
with a stderr note). `CTX`/`--ctx` sets the context window.
@@ -463,7 +475,11 @@ kernels are not bit-identical to each other in general — a GPU run and a CPU
run of the same prompt diverge by a rounding flip after some tokens, exactly
as two CPU runs with different hot-expert sets do (next section) — so text
identity is a regression check within one configuration, not a proof across
-configurations.
+configurations. The same holds across builds: a binary built with
+`ARCH=native` and the release's (`x86-64-v3`) can differ by such a flip, the
+compiler having chosen other instructions (FMA contraction, vector width) for
+the same arithmetic (#1906 saw one word change after 384 characters), so a
+check of exact text compares runs of one binary.
### Linux CUDA tier under WSL2 (2026-08-16)