Bare-metal C++20 and CUDA LLM inference for Qwen4-35B-A3B and Inkling-2-Mini with 1M context on one 24 GiB GPU
| Why seppia | ** 1M Context Quickstart** | ** How 1M Fits in 24 GiB** | ** Benchmarks** | ** Build** | ** References** |
Warning
Super early beta. seppia is under active development. Expect rough edges and breaking CLI changes.
Anthropic has banned us for developing this, so we are now using Gemini Neon.
You should not need a $30,000 datacenter GPU or a Python stack to run frontier MoEs at hardware speed.
seppia is a single-binary C++20 and CUDA inference engine for Qwen4-35B-A3B and Inkling-2-Mini. It holds 1,048,576 native context tokens on one 24 GiB GPU with SealKV trellis-coded KV compression and streams Qwen4's 20.5B n-gram table from host RAM at 0.00 GiB VRAM. Native DFlash2 and DSpark drafters accelerate decoding behind an OpenAI-compatible HTTP server and built-in chat UI.
Native Linux and Windows builds target RTX 3090 sm_86, RTX 4090 sm_89, and Blackwell sm_120a. Sibling project: sfumato-ai/tela.
<sub>1x real-time capture on one 24 GiB RTX 4090: Qwen4-35B-A3B + DFlash2 + 1M native context + CUDA W4A8 Vision all loaded in 23.0 GiB VRAM (1,596 tokens in 3.47 s, 470.0 tok/s live interactive chat; up to 568.7 tok/s greedy HumanEval). Full 60 FPS MP4.</sub>
1. Build or grab a Release binary
Requires CMake 3.28+, Ninja, a C++20 compiler, and CUDA Toolkit 12.4+. Blackwell sm_120a requires CUDA 12.8+.
git clone https://github.com/sfumato-ai/seppia.git && cd seppia
cmake --preset sm89 && cmake --build --preset sm89 -j # presets: sm86 (3090), sm89 (4090), sm120 (5090/PRO 6000)
Pull UD-IQ4_XS from unsloth/Qwen4-35B-A3B-GGUF and the optional 754 MB drafter from RadixArk/Qwen4-35B-A3B-Dflash2. The checkpoint takes 31 GB on disk: 20 GB of weights in shard 1 and 11 GB for the n-gram table in shard 2.
hf download unsloth/Qwen4-35B-A3B-GGUF --include "*UD-IQ4_XS*" --local-dir ./Qwen4-35B-A3B/UD-IQ4_XS
hf download RadixArk/Qwen4-35B-A3B-Dflash2 --local-dir ./Qwen4-35B-A3B/DFlash2
Swap sm89 for sm86 on RTX 3090 or sm120 on Blackwell. Both commands enable 2-bit SealKV via --quant kv=seal2 so the full 1M context fits in 24 GiB VRAM.
./build/sm89/seppia serve ./Qwen4-35B-A3B/UD-IQ4_XS/Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf \
--drafter dflash2 --drafter-path ./Qwen4-35B-A3B/DFlash2 \
--quant kv=seal2 --embed-host --ctx 1048576 --port 8003
./build/sm89/seppia serve ./Qwen4-35B-A3B/UD-IQ4_XS/Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf \
--drafter none --quant kv=seal2 --embed-host --ctx 1048576 --port 8003
Open http://127.0.0.1:8003 for the built-in chat UI or point any OpenAI-compatible client at http://127.0.0.1:8003/v1.
hf download thinkingmachines/Inkling-2-Mini --local-dir ./Inkling-2-Mini
./build/sm89/seppia serve ./Inkling-2-Mini \
--drafter hybrid --quant kv=seal2,dense=int8,vision=int8 --ctx 1048576 --port 8003
./build/sm89/seppia serve ./Inkling-2-Mini \
--drafter none --quant kv=seal2,dense=int8 --ctx 524288 --port 8003
Qwen4-35B-A3B stores a 20.5B-parameter per-layer n-gram embedding table in shard 2. seppia maps that 11 GB file into host RAM via read-only hugepage mmap with zero startup copy and 0.00 GiB GPU VRAM. Active rows stream over PCIe overlapped behind layer 0 at 0.005 ms GPU cost. Keep 00001-of-00002.gguf and 00002-of-00002.gguf in the same folder and pass shard 1 to seppia; if shard 2 sits elsewhere, pass --ple-path /path/to/ple.gguf.
Uncompressed KV caches overflow a 24 GiB card well before 1M tokens. seppia implements TurboQuant and trellis-coded SealKV in zero-spill CUDA kernels; seal2 packs 1M full-attention KV tokens on Inkling-2-Mini into 4.82 GiB with zero speculative verification violations. Full scaling curves and algorithm details live in docs/sealkv.md.
| Format | Bits / Val | KV VRAM @ 1M | 4K Mean KL β | Top-1 Match β | Spec Violations |
|---|---|---|---|---|---|
k8v4 |
6.06 | 12.13 GiB | 0.003474 | 94.12% | β |
tq4 |
4.06 | 8.13 GiB | 0.002057 | 97.06% | 1 |
tq3 |
3.06 | 6.13 GiB | 0.011500 | 97.06% | 2 |
seal4 |
4.41 | 8.82 GiB | 0.001062 | 100.00% | 0 |
seal3 |
3.41 | 6.82 GiB | 0.002047 | 97.06% | 0 |
seal2 |
2.41 | 4.82 GiB | 0.004645 | 97.06% | 0 |
Measured on Inkling-2-Mini against unquantized BF16 with dense=int8. Lower Mean KL stays closer to BF16 logits; higher Top-1 Match agrees more often on the greedy token; Spec Violations counts speculative verify mismatches against BF16, where 0 is exact.
All numbers come from Francesco/llm-serving-bench`` v3.3, executed by src/cli/bench.cpp and src/cli/bench_suite.cpp. Reproduce any suite with ./build/sm89/seppia bench MODEL --suite short or --suite code.
Runs below were measured on idle local RTX 4090 sm_89 and RTX 3090 sm_86 300 W GPUs with tokens=256, temperature=0.0, kv=seal2, and CUDA Graphs enabled. Throughput is decode speed in tok/s where higher is better; values in parentheses show accepted tokens per verify step (tok/verify, higher is better).
| Mode | VRAM | Boot | mt_bench |
translation |
code (HumanEval) |
math_reasoning |
|---|---|---|---|---|---|---|
Plain ( --drafter none ) |
19.5 GiB | 15.2 s | 216.1 tok/s | 216.3 tok/s | 215.5 tok/s | 216.2 tok/s |
Native MTP ( --drafter mtp , zero download) |
20.9 GiB | 14.6 s | 251.9 tok/s (2.18) | 254.0 tok/s (2.26) | 329.5 tok/s (2.91) | 308.9 tok/s (2.70) |
DFlash2 (--drafter dflash2 ) |
20.5 GiB | 12.8 s | 276.4 tok/s (2.92) | 374.9 tok/s (4.02) | 568.7 tok/s (6.27) | 547.5 tok/s (5.95) |
At --ctx 1048576 with QSA sparse prefill and seal2, RTX 4090 boots in 7.8 s at 22.0 GiB VRAM, or 23.0 GiB with DFlash2. It passes 2/2 needle recall at 1,009,499 tokens at 25% depth and 1,009,494 tokens at 75% depth, decoding at 97.5β100.9 tok/s at full 1M depth. Tensor-Core chunked GDN, INT8 MoE, and FP8 dense prefill reach 7,702 tok/s on 2.3K-token prompts and cut HumanEval median TTFT from 57.8 ms to 34.2 ms (1.69x faster).
| Mode | VRAM | Boot | mt_bench |
translation |
code (HumanEval) |
math_reasoning |
|---|---|---|---|---|---|---|
Plain ( --drafter none ) |
19.5 GiB | 8.5 s | 151.2 tok/s | 150.7 tok/s | 152.9 tok/s | 151.7 tok/s |
Native MTP ( --drafter mtp , zero download) |
21.1 GiB | 6.3 s | β | β | 183.6 tok/s (2.88) | β |
DFlash2 (--drafter dflash2 ) |
20.5 GiB | 8.8 s | 155.0 tok/s (3.16) | 193.2 tok/s (4.01) | 300.2 tok/s (6.30) | 297.5 tok/s (6.26) |
At --ctx 1048576, RTX 3090 boots in 4.8 s at 22.4 GiB VRAM and decodes short prompts at 118.5β122.3 tok/s.
| Mode | VRAM | Boot | mt_bench |
translation |
code (HumanEval) |
math_reasoning |
|---|---|---|---|---|---|---|
Plain ( --drafter none ) |
18.3 GiB | 6.3 s | 210.7 tok/s | 210.7 tok/s | 206.3 tok/s | 211.0 tok/s |
DSpark (--drafter hybrid ) |
18.7 GiB | 4.7 s | 252.2 tok/s (1.87) | 304.7 tok/s (2.52) | 310.6 tok/s (2.47) | 352.9 tok/s (2.96) |
DFlash2 (--drafter dflash2 ) |
19.0 GiB | 4.5 s | 247.5 tok/s (3.12) | 361.8 tok/s (4.69) | 328.5 tok/s (4.12) | 430.5 tok/s (5.37) |
| Mode | VRAM | Boot | mt_bench |
translation |
code (HumanEval) |
math_reasoning |
|---|---|---|---|---|---|---|
Plain ( --drafter none ) |
18.6 GiB | 17.1 s | 162.7 tok/s | 161.1 tok/s | 159.2 tok/s | 159.5 tok/s |
DSpark (--drafter hybrid ) |
18.7 GiB | 8.5 s | 201.3 tok/s (1.90) | 239.0 tok/s (2.48) | 241.0 tok/s (2.50) | 274.0 tok/s (3.01) |
On RTX 4090, seal2 with Hybrid DSpark and int8 vision holds 1,048,576 tokens in 22.4 GiB VRAM and decodes at 108.5 tok/s at 802K depth. Plain seal2 reaches 1,400,000 tokens in 23.4 GiB VRAM; see docs/sealkv.md for full depth curves.
cmake --preset dev && cmake --build --preset dev -j # multi-arch sm_86 + sm_89 + sm_120 -> ./build/dev/seppia
cmake --workflow --preset cpu-tests # CPU unit tests, no GPU needed
Every sm_86 and sm_89 kernel is verified at zero register spills (STACK:0 LOCAL:0) via cuobjdump.
CLI subcommands: seppia serve, seppia bench, seppia validate, and seppia suffix-build. Run seppia <cmd> --help for quantization, KV parking, NVMe spill, and vision streaming flags.
Docs: Architecture Design Β· Module Map Β· SealKV Benchmarks Β· Roofline Ceilings Β· Perf Engineering Β· Coding Style
| Work | Link | Role in seppia |
|---|---|---|
| Qwen4-35B-A3B | Qwen/Qwen4-35B-A3B | Target hybrid MoE + PLE + QSA architecture |
| Unsloth GGUF | unsloth/Qwen4-35B-A3B-GGUF | Quantized UD-IQ4_XS weights and host-mapped PLE shard |
| RadixArk DFlash2 | RadixArk/Qwen4-35B-A3B-Dflash2 | Pretrained block-diffusion speculative drafter for Qwen4 |
| Inkling-2-Mini | thinkingmachines/Inkling-2-Mini | Target looped MoE + multimodal ViT architecture |
| Inkling-2-Mini DFlash2 | incoai/Inkling-2-Mini-DFlash2 | Block-diffusion drafter and published 1x H200 SGLang reference |
| Qwen4 Uncensored Quants | dealignai GGUF Β·NVFP4 | Community calibrated uncensored Qwen4-35B-A3B checkpoints |
| tela | sfumato-ai/tela | Sibling bare-metal C++20/CUDA engine for MiniMax-H3 |
| Work | Link | Role in seppia |
|---|---|---|
| SealKV | arXiv:2612.02036 | CPTC L=10 trellis-coded 2β4 bit KV compression enabling 1M context |
| TurboQuant | arXiv:2504.19874 | Hadamard-rotated 3-bit and 4-bit KV cache formats |
| FlashAttention-2 | arXiv:2307.08691 | Online-softmax tiled attention for prefill and verification |
| FlashAttention-3 | arXiv:2407.08608 | Asynchronous warp-specialized FP8/Hopper+ attention design |
| FlashDecoding | Stanford CRFM | Split-K long-context decode parallelization across SMs |
| Gated DeltaNet | arXiv:2412.06464 | Linear-attention recurrence design in hybrid attention layers |
| Hyper-Connections | arXiv:2409.19606 | Multi-stream residual routing in modern transformer blocks |
| Native Sparse Attention | arXiv:2502.11089 | Hardware-aligned block-sparse long-context attention design |
| Work | Link | Role in seppia |
|---|---|---|
| DFlash & DFlash2 | arXiv:2602.06036 Β·z-lab/dflash | Parallel block-diffusion speculative drafter |
| DSpark | arXiv:2607.05147 | Native lightweight drafter for Inkling-2-Mini |
| SuffixDecoding | arXiv:2411.04975 | Model-free suffix-tree drafting and hybrid speculation |
| Speculative Decoding | arXiv:2211.17192 | Exact rejection-sampling verification (Leviathan et al.) |
| EAGLE-3 | arXiv:2503.01840 | Multi-layer feature fusion for speculative draft heads |
| SpecForge | sgl-project/SpecForge Β·PR #983 | Open drafter training ecosystem and Qwen4 DFlash2 next_attn_mix tap spec |
| Multi-Token Prediction | arXiv:2404.19737 | Multi-token prediction foundation behind Qwen4 native blk.40 MTP |
| Work | Link | Role in seppia |
|---|---|---|
| SGLang | sgl-project/sglang Β·arXiv:2312.07104 | Serving baseline and RadixAttention prefix-caching reference |
| llama.cpp | ggml-org/llama.cpp | GGUF v3 container spec, K/IQ quantization layouts, Jinja runtime |
| ik_llama.cpp | ikawrakow/ik_llama.cpp | Low-bit GGUF quantization formats and consumer-GPU MoE ideas |
| Strata | Niko1221/Strata Β·PR #7774 | Consumer-GPU Qwen4 kernel optimizations and host-RAM streaming inspiration |
| NVIDIA HyperFlare | NVIDIA/hyperflare-inference | Adaptive speculation width ( PrefixEstimate ), Tensor-Core QSA/GDN prefill, and Blackwell kernel patterns |
| DeepSeek-V3 | arXiv:2412.19437 | Fine-grained MoE routing and native MTP architecture reference |
| GPTQ | arXiv:2210.17323 | 4-bit weight quantization format supported natively in seppia |
| CUTLASS | NVIDIA/cutlass | Tensor Core MMA layouts, swizzling, and warp-specialized patterns |
| FlashInfer | flashinfer-ai/flashinfer Β·arXiv:2501.01005 | Split-K attention scheduling and writethrough merge patterns |
| Marlin | IST-DASLab/marlin Β·arXiv:2408.11743 | Register-level INT4/FP4 weight unpacking into Tensor Core fragments |
| Stream-K | arXiv:2301.03598 | Work-centric persistent GEMM scheduling across SMs |
| OCP Microscaling (MX) | OCP MX v1.0 Spec | Block-scaled MXFP8 and FP4 tensor formats |
| vLLM | vllm-project/vllm Β·arXiv:2309.06180 | Paged KV management and serving systems reference |
| Work | Link | Role in seppia |
|---|---|---|
| llm-serving-bench | Francesco/llm-serving-bench | Reproducible v3.3 multi-domain throughput benchmark suite |
| HumanEval | arXiv:2107.03374 | Code generation prompts in the code suite |
| MATH & MATH-500 | arXiv:2103.03874 Β·HuggingFaceH4/MATH-500 | Math reasoning benchmark suite |
| MT-Bench | arXiv:2306.05685 | Multi-turn chat prompts in the mt_bench suite |
| Vendored C/C++ | stb_image Β·cpp-httplib Β·nlohmann/json Β·spdlog Β·utf8proc Β·libwebp | Zero-external-dependency HTTP, JSON, logging, UTF-8, and image decoding |
Built by Sfumato AI at sfumato-ai/seppia.