GitHub - lingster/decodrs: Optimising inference on nvidia gpus

GitHub

19 min read Original article ↗

Rust inference server for GGUF models on NVIDIA cards, with hand-written PTX kernels and no CUDA runtime libraries. It began as a from-scratch replacement for the bonsai2 llama.cpp fork's server path on an RTX 3080 and was first called bonsai-rs after that model. Models it runs:

  • Ternary-Bonsai-2-27B (GGUF arch qwen35, PTQ1_0 ternary weights)
  • Inkling-2-Mini (GGUF arch inkling2_loop, NVFP4 and Q8_0 weights)
  • Qwen3-0.6B, 16-bit and Q8_0 (arch qwen3); see docs/qwen3-port.md
  • Qwen3.8-Flash-Next, GSQ-RCO Q2_0 and Coder builds (arch qwen4exp; one copy split across two cards); see docs/qwen4exp-port.md
  • Qwen4-35B-A3B, UD-IQ4_XS and native NVFP4 with optional DFlash2 speculative decoding (arch qwen4exp; one copy per card; provisional — see docs/qwen4-35b-accuracy.md)

Crates (crates/*):

  • decodrs-api shared Engine trait
  • decodrs-gguf GGUF reader, dequantisers, tokenizer
  • decodrs-gpu thin GPU adapter trait + NVIDIA sm_86 backend (PTX -> SASS cubin, driver API only)
  • decodrs-model qwen35 forward pass (CPU reference + GPU)
  • decodrs-chat chat template, tool-call/reasoning parsing
  • decodrs-server OpenAI-compatible HTTP server

Measured speed

One request at a time

Tokens per second at prompts of about 90 / 2,000 / 8,200 tokens (bench_openai.py, 200 generated tokens, timed from the client). The reference server is the llama.cpp build that runs the same GGUF file. The change is decodrs against the reference at each prompt size.

Model GPU Server Decode tok/s Change Prefill tok/s Change
Ternary Bonsai 2 27B (PTQ1_0) RTX 3080 reference: llama.cpp fork, MTP drafting 91.2 / 89.4 / 85.5 366-454 / 1107-1160 / 1131-1177
decodrs 93.7 / 92.6 / 89.7 +3% / +4% / +5% 850 / 1262 / 1241 +107% / +11% / +8%
Ternary Bonsai 2 27B (PTQ1_0) RTX 3090 reference: llama.cpp fork, MTP drafting 95.8 / 91.7 / 87.5 574 / 1193 / 1200
decodrs 101.5 / 100.5 / 97.2 +6% / +10% / +11% 865 / 1288 / 1248 +51% / +8% / +4%
2x RTX 3090, layers split decodrs --backend gpu2 (reference not measured) 100.8 / 99.8 / 96.7 881 / 2254 / 2290
Inkling-2-Mini (UD-Q4_K_XL) RTX 3090 reference: llama.cpp 78.4 / 75.9 / 74.2 373 / 1386 / 1558
decodrs 115.8 / 112.8 / 111.0 +48% / +49% / +50% 1260 / 2064 / 1900 +238% / +49% / +22%
Qwen3.8-Flash-Next (GSQ-RCO Q2_0) 2x RTX 3090, layers split reference: llama.cpp 77.8 / 75.7 / 73.5 531 / 1751 / 1983
decodrs 104.2 / 102.5 / 102.8 +34% / +35% / +40% 1699 / 3239 / 2254 +220% / +85% / +14%
Qwen3.8-Flash-Next Coder (256 experts) 2x RTX 3090, layers split reference: llama.cpp 70.4 / 69.1 / 68.4 368 / 1615 / 2029
decodrs 87.7 / 85.3 / 86.3 +25% / +23% / +26% 1583 / 2908 / 2073 +330% / +80% / +2%
Qwen4-35B-A3B (UD-IQ4_XS) RTX 3090 reference: llama.cpp 110.3 / 109.0 / 107.1 586 / 2760 / 3358
decodrs (provisional) 148.4 / 145.4 / 144.8 +35% / +33% / +35% 2048 / 3105 / 2942 +249% / +13% / -12%
decodrs + DFlash2 (DECODRS_Q4_DFLASH, provisional) 245.6 / 183.4 / 164.1 +123% / +68% / +53% 2040 / 3082 / 2929 +248% / +12% / -13%
Qwen4-35B-A3B (NVFP4) RTX 3090 decodrs + DFlash2 (RadixArk/Qwen4-35B-A3B-NVFP4, provisional) 230.5 / 158.1 / 159.3 +109% / +45% / +49% 2062 / 3063 / 2904 +252% / +11% / -14%

Decode and prefill speed per model, decodrs against its reference server

The chart shows the 2,000-token column. Where the RTX 3080 reference prefill was measured as a range, the change and the bar use the middle of the range. Bonsai decodes with one drafted token per pass in both servers; Inkling, Qwen3.8-Flash-Next, and the plain Qwen4-35B-A3B row have no drafting in either. The DFlash2 rows use RadixArk/Qwen4-35B-A3B-Dflash2 (7-token block drafting with O(1) state rollback; character-for-character identical output to plain decodrs on all prompts tested; NVFP4 change is shown against the llama.cpp UD-IQ4_XS reference because SGLang OOMs on one 24 GB card). Both Qwen3.8-Flash-Next builds pass all real-model gates (17/17 next-token + greedy on General; 4/4 next-token + greedy on Coder) with strict recorded fingerprints. Qwen4-35B-A3B is labelled provisional: 17 of 17 next-token prompts pass, while greedy_a3b disagrees on 3 of 1,717 teacher-forced steps (p100_prose steps 10, 83, 298) against a llama.cpp reference that itself varies with batching; see docs/qwen4-35b-accuracy.md.

Many short requests (Qwen3-0.6B)

bench/throughput.py: 256 requests, prompts of 16-512 tokens, 64-256 generated tokens, greedy, over HTTP, on one RTX 3090. Aggregate generated tokens per second by number of concurrent requests. References: vLLM 0.34 (8.2 GB of VRAM) and SGLang 1.0.0 (about 10 GB) with the same 16-bit weights, and llama.cpp with the same GGUF files, each the mean of two runs; decodrs used a 6 GiB cache pool. Measured 2026-12-04.

Server 1 8 32 64 128 256
reference: vLLM, 16-bit 358 2,068 3,928 5,072 6,087 5,847
reference: SGLang, 16-bit 399 2,177 4,246 3,352 5,114 5,870
reference: llama.cpp, 16-bit 325 1,192 1,158 1,206
decodrs, 16-bit 399 2,203 4,647 5,906 6,553 6,401
change against vLLM +11% +7% +18% +16% +8% +9%
change against SGLang 0% +1% +9% +76% +28% +9%
reference: llama.cpp, Q8_0 425 1,248 1,256 1,227
decodrs, Q8_0 506 2,370 4,664 5,962 6,709 6,701
reference: vLLM, 1,000-token shared prefix 335 1,465 2,442 2,784 2,985 2,812
reference: SGLang, 1,000-token shared prefix 388 1,995 3,505 3,179 4,364 4,360
reference: llama.cpp, 16-bit, shared prefix 310 1,031 976 798
decodrs, 16-bit, shared prefix 364 1,913 3,486 4,223 4,562 4,476
decodrs, Q8_0, shared prefix 453 2,064 3,509 4,251 4,693 4,698
change against vLLM (16-bit) +9% +31% +43% +52% +53% +59%
change against SGLang (16-bit) -6% -4% -1% +33% +5% +3%

The decodrs 16-bit and Q8_0 rows are the build on main (2026-12-05: tensor-core decode attention reading a shared prefix once per group of rows, few-row variant, CUDA-graph pass replay, carried 16-bit outputs, w-tile dispatch for 129–256-row attn_out/down, direct argmax fast-path for greedy k = 1, and prefill-first burst scheduling enabled by default on Qwen3 via DECODRS_Q3_PREFILL_FIRST, =0 turns it off). Without a shared prefix, 16-bit decodrs matches or beats both vLLM (+7% to +18%) and SGLang (0% to +76%) in every concurrency column, while Q8_0 reaches 506 to 6,709 tok/s (5.4x llama.cpp Q8_0 at c = 64). With the 1,000-token shared prefix, 16-bit decodrs beats vLLM everywhere (+9% to +59%) and beats SGLang at c = 64, 128, 256 (+33% / +5% / +3%), while Q8_0 beats SGLang 16-bit in every column (453 to 4,698 tok/s). Median time to first token without prefix at c = 128 / 256: SGLang 0.07 / 0.62 s, decodrs 0.073 / 0.65 s (down from 0.16 / 1.77 s before prefill-first), vLLM 0.11 / 0.71 s. With the 1,000-token prefix, decodrs median TTFT at c = 128 / 256 dropped from 0.24 / 2.43 s to 0.118 / 1.01 s. A 256-key decode chunk (DECODRS_Q3_DM_CHUNK=256, a switch, not the default) lifts c = 1 and c = 8 further for about 1% less at c = 64..256 with the prefix. In process, decode only, decodrs reached 12,900 tok/s at 256 rows per pass in an earlier build.

Agentic serving

bench/agentbench.py: a lead agent and six subagents sharing a prompt prefix of about 12K tokens, 34 requests, on the RTX 3090s. "Single-request" is decodrs before agentic serving (one request at a time, with drafting); "agentic" is -np 8 on the scheduler, with several sequences per pass and the shared prefix stored once. Best of two runs where two were made; the change is in wall time against the reference server.

Model Server Wall time Change Time to first token p50 / p95 Decode per stream p50
Ternary Bonsai 2 27B reference: llama.cpp fork -np 8, one card, no drafting 130.0 s 5.26 / 51.71 s 18.0 tok/s
reference with MTP drafting 147.2 s 8.61 / 54.91 s 21.1 tok/s
decodrs single-request, one card 76.5 s -41% 7.02 / 13.22 s 89.3 tok/s
decodrs agentic, one card 52.8 s -59% 1.20 / 2.45 s 28.2 tok/s
decodrs agentic, a replica per card 43.9 s -66% 0.76 / 1.39 s 43.6 tok/s
Inkling-2-Mini reference: llama.cpp -np 8, one card 100.6 s 3.86 / 42.0 s 27.3 tok/s
decodrs single-request, one card 69.8 s -31% 6.87 / 14.05 s 106.8 tok/s
decodrs agentic, one card 38.2 s -62% 1.41 / 2.85 s 50.5 tok/s
decodrs agentic, a replica per card 31.4 s -69% 0.49 / 2.49 s 75.6 tok/s
Qwen3.8-Flash-Next reference: llama.cpp -np 8, split over two cards 68.2 s 2.10 / 21.35 s 33.8 tok/s
decodrs agentic, split over two cards 31.3 s -54% 0.55 / 1.72 s 50.0 tok/s
Qwen3.8-Flash-Next Coder reference: llama.cpp -np 8, split over two cards 71.7 s 2.30 / 21.88 s 30.3 tok/s
decodrs agentic, split over two cards 33.7 s -53% 0.56 / 1.91 s 42.3 tok/s
Qwen4-35B-A3B reference: llama.cpp -np 8, one card 50.1 s 1.38 / 12.8 s 39.8 tok/s
decodrs agentic, one card (provisional) 26.9 s -46% 0.64 / 1.68 s 79.5 tok/s
decodrs agentic, a copy per card (provisional) 34.5 s -31% not recorded 88-97 tok/s

Wall time of the agent benchmark per model and server

The change is against each model's faster reference run (for Bonsai the fork without drafting, 130.0 s; with MTP drafting and eight slots it took 147.2 s). A second run on a server whose cache is already full can be much slower: Inkling's single-request server took 136.5 s on its second run, evaluating three times the prompt tokens. The traces are generated per tokenizer, so wall times compare servers on one model better than they compare models. Everything else measured (several sequences per pass, the opencode game, two-card serving, how each number was taken, what was not measured) is in docs/model-benchmarks.md. Regenerate the charts with python3 tools/plot_speeds.py after adding a row.

Qwen4 optimizations and repeat-run serving (on main, 2026-12-05)

  • Fused GDN + CUDA-graph pass replay (q4_gdn_fused.ptx). Fused the 3-kernel GDN sequence (conv + rec + norm) into one self-resetting CUDA-graph-safe launch (61 regs, 0 spills, bit-identical) and enabled CUDA-graph pass replay for <= 16 rows on single- and dual-card Qwen4 batches (+6.4% to +8.6% decode on q4_bench; 35B-A3B plain HTTP decode rose from 130.2 / 126.9 / 127.1 to 146.6 / 144.4 / 144.0 tok/s and Flash-Next General from 98.7 / 95.4 / 95.7 to 104.2 / 102.5 / 102.8 tok/s).
  • Opt-in Tensor-Core QSA attention (DECODRS_Q4_ATTN_TC=1|auto, q4_attn_tc.ptx). Coalesced split-K/V cp.async.cg + two-part f16 m16n8k16 MMA kernel for QSA sparse GQA (154 regs, 32 KiB smem, 0 spills): up to 1.50x faster attention at 16K context and +14.9% end-to-end prefill at 32K context on Qwen4-35B-A3B (2,783 -> 3,198 tok/s, +7.9% on Flash-Next General). auto engages q4_attn_tc only where it wins (rows >= 4 || max_kv >= 8192). Kept opt-in because two-part f16 rounding (~1e-6) shifts strict bit-exact fingerprints.
  • Native NVFP4 routed experts (ride_fp4_glu, ride_fp4_down). Supports per-expert tensor scales and fused gate+up NVFP4 mat-vec alongside Q8_0 shared experts, with tools/convert_qwen4_nvfp4_gguf.py converting RadixArk/Qwen4-35B-A3B-NVFP4 into GGUF (19.22 GiB on GPU, leaving a 2,711 MiB KV/state pool on one 24 GB RTX 3090 — +434 MiB over UD-IQ4_XS).
  • Fused quantized HC epilogues (qhc_mv.ptx, q4_hc_epi.rs). Fuses q4_hc_lo into down/inject (q8_mv_many_hclo, q5k_mv_many_hclo) and q4_hc_post into up (q8_mv_hcpost, q6k_mv_hcpost, q5k_mv_hcpost), cutting 5 launches to 3 across all 81 HC mixers of Qwen4-35B-A3B (UD-IQ4_XS and NVFP4, 0 spills, bit-identical) and adding p1_smem_once on Flash-Next two-part tiled mixers (q4_dflash_bench: NVFP4 208.6 -> 214.4 tok/s, math 251.6 tok/s / 1.76x; UD-IQ4_XS plain 149.4 -> 154.4 tok/s, DFlash2 195.5 -> 201.9 tok/s).
  • DFlash2 speculative decoding (DECODRS_Q4_DFLASH=<dflash2.gguf>, kernels/dflash.ptx). Converts RadixArk/Qwen4-35B-A3B-Dflash2 via tools/convert_dflash2_gguf.py (287 MiB Q8_0 GPU weights + host-resident BF16 CandidateSelector codebooks), captures auxiliary hidden states at layers [20, 24, 28, 32, 36] via graph-safe dflash_cap_feat, writes GDN/PLE rollback inputs directly into rollback buffers (zero device copies, unbroken 40-layer CUDA-graph verify pass), drafts 7 tokens per step via CUDA-graph replay (~2.3 ms, single contiguous output download), verifies 8 rows (~12.0 ms) with batched greedy argmax_rows, and rolls back PLE/GDN/KV state in O(1) (~0.25 ms). Supports exact speculative rejection sampling (temperature > 0, top_k/top_p/min_p/seed) and O(1) multi-turn prefix caching (cache_prompt: true, 4,527/4,535 cached tokens cutting 4.5K-token Turn-2 latency from 1,730 ms to 254 ms, exact match). Verified 100% greedy token-for-token identical across 768 benchmark tokens (NVFP4 overall 214.4 tok/s, peak math 251.6 tok/s / 1.76x; UD-IQ4_XS 201.9 tok/s) and up to 245.6 tok/s (peak 265.8, 2.23x vs llama.cpp) over HTTP on UD-IQ4_XS.
  • Host-backed LRU Paged Experts (DECODRS_Q4_EXPERT_CACHE=<slots>). Keeps slots routed experts per layer in a GPU LRU cache and streams misses from pre-packed host RAM on demand (bit-identical to full-VRAM execution). With DECODRS_Q4_EXPERT_CACHE=160 on Qwen4-35B-A3B-NVFP4 + DFlash2, total GPU weights drop from 19.23 GiB to 12.90 GiB (+ 287 MiB DFlash2 = 13.18 GiB, fitting a 16 GB GPU) while delivering 122.1 tok/s overall (up to 142.9 tok/s on math, 100–112 tok/s plain) over PCIe Gen4 x8.
  • Host-side data-integrity sidecars (DECODRS_VERIFY_HOST=1, gguf_sums). Verifies 4 KiB file blocks against <shard>.sums sidecars at upload and during host table reads, using O_DIRECT re-reads on mismatch to distinguish RAM page-cache flips from disk corruption (docs/data-integrity.md).
  • Greedy k = 1 fast-path & Qwen3 prefill-first burst scheduling. Direct argmax / argmax_rows readback (8 B/row, inside the CUDA graph) replaces select_ge scans for greedy decoding across all models, and prefill-first scheduling on Qwen3 cuts c = 128 / 256 median TTFT by 2.2-2.7x while raising aggregate throughput to 6,553 / 6,401 tok/s (6,709 / 6,701 on Q8_0; 4,562 / 4,476 16-bit and 4,693 / 4,698 Q8_0 with a 1K shared prefix).
  • Repeat runs on one server. Rewriting the scheduler's eviction order removed the second-run penalty on agentbench: three consecutive Inkling runs on one quiet card took 40.1, 38.2, and 39.0 s (92.2% / 93.1% / 92.8% prefix cache hit rate; previously 46.3 s then 60.6 s).
  • SGLang comparison on other models. Only Qwen3-0.6B runs head-to-head on these cards: RadixArk/Qwen4-35B-A3B-NVFP4 OOMs on one 24 GB RTX 3090 in SGLang (22.30 GiB allocated before the 970 MiB lm_head, and --language-only rejects Qwen4ExpForConditionalGeneration), SGLang 1.0.0 lacks sm_86 attention kernels for Inkling-2-Mini, and Qwen3.8-Flash-Next does not fit in 48 GB there.

Writing a small game with opencode (a sanity check, not a benchmark)

One opencode session per row, same prompt each time (bench/opencode_game/PROMPT.md): a lead agent writes a contract, starts four subagents in parallel that each write one module of a small canvas game, then integrates and syntax-checks the result. It exercises what real agent work exercises (long shared prompts, tool calls, several requests at once, long generations) on a server exactly as you would run it.

Model Server Cards Wall time Requests Tokens generated Prompt tokens evaluated Decode per request, median
Ternary Bonsai 2 27B decodrs, --backend gpu2 2 2,771 s 87 190,157 134,353 50.1 tok/s
Inkling-2-Mini reference: llama.cpp, -np 4 1 1,567 s 82 98,719 245,634 48.8 tok/s
Inkling-2-Mini decodrs, -np 8 1 381 s 47 39,577 50,604 64.5 tok/s
Inkling-2-Mini decodrs, --backend gpu2 -np 8 2 238 s 43 29,098 45,204 81.8 tok/s
Qwen3.8-Flash-Next reference: llama.cpp, -np 4, split 2 did not finish (1,760 s) 104 90,135 191,212 58.8 tok/s
Qwen3.8-Flash-Next decodrs, --backend gpu2 -np 4 2 327 s 44 31,465 31,596 83.1 tok/s
Qwen4-35B-A3B reference: llama.cpp, -np 4 1 588 s 37 21,509 57,022 38.7 tok/s
Qwen4-35B-A3B decodrs, -np 4 (provisional) 1 335 s 49 44,235 113,295 75.4 tok/s

This is not scientific; read it as a reference for what day-to-day agent work feels like:

  • One run per row. An agent takes a different path every time (more or fewer requests, longer or shorter answers), so wall time mixes the server's speed with how much work the model chose to do. Tokens generated per second over the whole run is the steadier figure: for Qwen4-35B-A3B, 132 on decodrs against 37 on llama.cpp; for Qwen3.8-Flash-Next, 96 against 51.
  • Every run produced a complete game whose files pass node --check. No game was opened or played, and nothing here says which model writes better code.
  • The Qwen4-35B-A3B rows shared the host with other CPU work, and that model's accuracy checks on decodrs are not finished, so its decodrs row is provisional.
  • The Qwen3.8-Flash-Next run on llama.cpp did not end by itself: its game files were complete after 1,147 s, the lead agent went on testing, then tried to read a screenshot, which llama-server rejects without a vision projector, and opencode retried until the run was stopped. Its figures cover the 1,760 s up to the last completed request.
  • Not run: Bonsai on its reference server or on one card, Qwen3-0.6B.

The method and the full table are in docs/model-benchmarks.md.

Build and run

Needs Rust, an NVIDIA driver (libcuda.so.1), and optionally ptxas (set PTXAS, default /opt/cuda/bin/ptxas; without it the driver JIT-compiles the PTX). No CUDA runtime libraries are used.

cargo build --release -p decodrs-server
./target/release/decodrs-server -m MODEL.gguf -c 28672 --snapshots 4 --host 127.0.0.1 --port 8899

The llama-server flags used by the original launch scripts are accepted. --backend cpu runs the slow CPU reference; --mock runs without a model.

Status (RTX 3080 10 GB, 2026-12-01)

  • Greedy output matches the original llama.cpp fork token for token on the prompts tested.
  • Measured through the server: decode 62–70 tok/s, prefill about 530–700 tok/s (original fork: 85–100 and about 1100).
  • One sequence only (-np > 1 is not supported); no grammar-constrained output.
  • MTP speculative drafting (--spec-type draft-mtp, on by default when the model has an MTP block; --spec-type none / --no-draft turns it off): one token drafted and verified per pass, same output. Decode with it, 200 tokens after prompts of 83 / 2066 / 8210 tokens: 93 / 92 / 89 tok/s greedy (original fork with --spec-draft-n-max 1: 91 / 89 / 86).

Agentic serving (in progress, branch serving/agentic)

Serving a coding harness that runs subagents: several sequences per GPU pass, a scheduler, and a prefix cache shared between requests. Design: docs/agentic-serving.md.

  • crates/decodrs-sched: page allocator, prefix tree of checkpoints, scheduler, and the BatchForward trait they sit on, tested against a fake model (every request must produce the tokens it produces alone, under any interleaving). Not wired to the GPU model or the server yet.
  • bench/agentbench.py: replays a lead agent and a burst of subagents against any OpenAI-compatible server and reports the wall time of the whole session.
  • Kernels: an exact multi-row ternary mat-vec (ptq_rows3..16), bit-identical per row to the one-row kernel, plus per-row RoPE and arg-max. Measured on the real model (RTX 3080, no drafting), tokens per second summed over the sequences in a pass: 72 at one sequence, 140 at four, 158 at eight, flat beyond. Exact arithmetic therefore tops out near 2.2x one stream.
  • A fixed-point decode regime (ptq_fx, selected with DECODRS_FIXED_POINT=1; exact stays the default): 69 at one sequence, 221 at four, 346 at eight, 430 at sixteen, with every row bit-identical to the same sequence alone in that regime. Against exact decode it produced the same token at all 5,481 teacher-forced steps tested (greedy, contexts up to about 3,400 tokens), and it is as close to the original server's outputs as exact decode is. Single stream: about 4% slower without drafting, about 11% faster with it.
  • On the RTX 3090s (branch serving/agentic-3090): attention through a page table (reading a prefix that sequences share once per pass), the GPU model behind BatchForward, and decodrs-server -np N on the scheduler (--backend gpu2, a replica per card, is wired but not yet measured). A lead agent and six subagents on a 12.6K-token shared prefix: 76.5 s on the single-request server, 53 s on one card, 44 s on two. Greedy output matched the single-request server token for token on the 16 prompts tried. No drafting in this path yet, so -np 1 keeps the single-request engine. Section 10 of docs/agentic-serving.md has the numbers and what was not measured.
  • A real agent on that server (opencode 2.4.3, a lead and four subagents writing a small canvas game, bench/opencode_game/): completed in 46 minutes with a 16K output cap after failing with a 4K one; 67% of that time had one request in flight, at 50-58 tok/s. One run per setting; section 11 has the numbers, the bug in the result and what was not checked.

Inkling-2-Mini (2026-12-03)

decodrs-server -m Inkling-2-Mini-UD-Q4_K_XL.gguf -np 8 -c 65536 serves Inkling-2-Mini (inkling2_loop: an NVFP4 / Q8_0 MoE with a looped core of 48 layer visits) through the agentic scheduler on one RTX 3090. --backend gpu2 runs one replica per card.

  • Single stream on one card: prefill 1,260-2,064 tok/s against llama.cpp's 373-1,558; decode 111-116 tok/s against 74-78.
  • Agentbench trace: 40.5 s on one card and 31.4 s on two, against 101-103 s for llama.cpp on one card.
  • opencode writing the game: 381 s on one card, against 1,567 s for llama.cpp. One run each; the work differs between runs.
  • Weights are verified after upload. A bit flip in resident weights was seen once on GPU 1 (no ECC). See the reliability section of docs/inkling2-port.md.
  • Built, checked and measured: docs/inkling2-port.md. The model itself: docs/inkling2-architecture.md. No vision input, no drafting.

Porting another GGUF

Other models do not load yet: each needs a forward pass for its architecture and kernels for its weight formats. The gguf-port skill in .claude/skills/ walks Claude Code through that. Open Claude Code in this repo and run /gguf-port path/to/model.gguf llama.cpp (or vllm). It inspects the file and sizes the job, records the reference server's speed and outputs, builds the CPU and GPU forward passes with plain kernels checked against that reference, then tunes one kernel at a time: scripts/kloop.py runs the tests, measures, and logs keep / revert in a ledger, and scripts/bench_openai.py runs the same end-to-end benchmark on both servers.

RTX 3090s (2026-12-02)

  • One 3090 uses its own measured launch geometries: decode 101 / 100 / 97 tok/s with drafting.
  • Two 3090s: --backend gpu2 splits the layers between the cards. Prefill of long prompts runs at about 2,300 tok/s (1.8x one card); decode is the same as on one card.
  • Details, the comparison table and what was not measured: docs/dual-3090.md.

Every model's measurements side by side, and how to add one: docs/model-benchmarks.md.

See docs/kernel-optimisation.md and docs/serving-engines-compared.md. For a learner's reference to every PTX kernel and the decode and prefill flows, open docs/ptx-kernels/decodrs-ptx-kernels.html in a browser (regenerate with python3 docs/ptx-kernels/gen.py).

Run as a service

decodrs-server takes its settings from flags (--host, --port, -m/--model, -a/--alias, -c, --backend, --parallel, an optional --api-key, and more) or from a config.yaml in which every option is a key of the same name; the command line, then the environment, win over the file. Minimal ~/.config/decodrs/config.yaml:

host: 127.0.0.1
port: 8080
model: /models/model.gguf
alias: decodrs
ctx: 65536
backend: gpu2
parallel: 8
cargo build --release -p decodrs-server && install -Dm755 target/release/decodrs-server ~/.local/bin/decodrs-server
install -Dm644 contrib/decodrs.service ~/.config/systemd/user/decodrs.service && systemctl --user enable --now decodrs

Clients (opencode, the OpenAI SDKs, curl) use http://127.0.0.1:8080/v1; contrib/opencode.example.json has the opencode entry. All options, the API key, a connection checklist and troubleshooting: docs/serving.md.

License

Apache License 2.0; see LICENSE and NOTICE. Model files are not part of this repository and carry their own licenses.