Every kernel is in the tree
A from-scratch C++20/CUDA inference engine for GGUF and EXL3. The kernels are the product: there is no llama.cpp, ggml, Candle, PyTorch or ExLlamaV3 underneath.
An inference engine, not a wrapper around one
TinyCoder is a from-scratch C++20/CUDA inference library for NVIDIA GPUs. The kernels are the product — there is no llama.cpp, ggml, Candle, PyTorch or ExLlamaV3 underneath.
Every kernel in the tree
GGUF and EXL3 dequantisation, the int8 mma.s8.m8n8k16 stream-K GEMM, warp flash attention, the gated-delta-net recurrent kernels and the samplers are implemented in this repository. No inference library is linked, embedded or called.
cuBLAS is only a GEMM
cuBLAS appears as a plain GEMM and nothing else. Prefill has two paths: cuBLAS fp16 tensor cores, and the in-tree int8 stream-K MMA that quantises activations to Q8_0 and reads GGUF blocks straight from VRAM.
Two first-class formats
GGUF v3 — K-quants Q2_K to Q6_K, Q5_0/Q5_1/Q8_0, the IQ series (IQ1_S/M, IQ2_XXS/S/XS, IQ3_XXS/S, IQ4_NL/XS), NVFP4/Q2_0 and Prism pq2_0 ternary. EXL3 — exllamav3's trellis format, read directly from a Hugging Face checkpoint directory. Model::load sniffs the format; both share the same kernels, KV cache and offload path.
Model families
Qwen2.5, Qwen3.6 and Qwen3.8 — dense qwen35 and mixture-of-experts qwen35moe — plus Ornith, Gemma 4, Inkling-2-Mini (looped MoE, inkling2_loop) and Prism Ternary-Bonsai.
Turing to Blackwell
Turing, Ampere, Ada and Blackwell run native SASS (sm_75 / sm_86 / sm_89 / sm_120). ./scripts/build.sh detects the GPU it is building on and adds that architecture; sm_120 needs CUDA ≥ 12.8 (verified with 13.2). The reference box is an RTX 2080 Ti with 11 GB — the MoE path splits each layer between a pinned, per-layer staged slice computed on the GPU and the rest streamed by the CPU, so the 34.4 GB Ornith-1.5-35B-A3B checkpoint runs on it.
A CPU path that actually ships
Runtime SIMD dispatch picks AMX, AVX-512, AVX2 or a scalar fallback, with OpenMP across cores. Each loaded model gets its own CPU thread pool, so a small model can run beside a large one without borrowing its workers. Without CUDA it still runs — several times to orders of magnitude slower, and a model that does not fit in RAM will not run at all.
Context windows sized by memory
The window is planned, not fixed: --ctx N or model.setContextLength(N) asks for N tokens, and the planner grants the largest window that fits the measured free VRAM/RAM after the weights and the session's scratch, switching to an int8 K/V store when that is what makes it fit.
The default stays 2048. A window below 1024 tokens refuses the load rather than silently truncating, and the grant is a capacity, not an accuracy claim beyond the checkpoint's trained length.
A second first-class format — and a measured win in both columns
EXL3 is exllamav3's trellis-quantised checkpoint format. TinyCoder loads it natively, alongside GGUF, and is faster than the reference implementation on both prefill and decode.
What EXL3 is
EXL3 stores weights as a trellis code over 16×16 (k,n) tiles in a Hugging Face safetensors directory — config.json, *.safetensors, tokenizer.json — rather than in a GGUF file. At 1.60bpw, a 27B checkpoint is 8.6 GB.
Why native support matters
Before this, an EXL3 checkpoint meant running exllamav3: PyTorch, a JIT-compiled CUDA extension, Python per token. Now the same engine runs both formats — one loader, one KV cache, one offload path, and no conversion pass.
Model::loaddetects the format and selectsEXL3Loaderautomatically.- Trellis reconstruction, the EXL3 GEMV and the fused prefill GEMM live in
src/cpp/core/cuda/exl3/. - The autotuned cublasLt path is the default;
TINYCODER_EXL3_LT=0pins the older fixed-order k summation bit-for-bit. - Checkpoint shape and tokenizer are read from the directory — no GGUF conversion step.
against exllamav3 1.6.6 at 716.8 tok/s pp512 and 23.67 tok/s tg128 — same checkpoint, Qwen3.8-27B EXL3 1.60bpw, 8.6 GB.
TinyCoder leads both columns: prefill 725.8 against 716.8 (+1.3%, spreads 1.2 and 1.6), and decode 29.83 against 23.67 (+26.0%, spreads 0.06 and 0.07), three alternating interleaved pairs each. The decode margin is the mul1 dp4a fold in exl3GemvV3. A repeat session measured 30.77 / 23.63, so the between-session spread on this row is about 3% — larger than the within-session spread, but far below the decode lead. exllamav3's tg128 also includes Python per-token overhead, which makes that figure a floor rather than a best case.
The VS Code extension is one consumer
The TinyCoder extension embeds tinycoder_core through its own N-API bridge — the engine's FetchContent path exists for exactly this. It adds a chat panel and editor commands on top, and it is how many people meet the engine day to day.
It is not the pitch. The library is the product; the extension is a downstream integration that proves the embedding path works.
TinyCoder extension