Skip to content

About

Pure-Rust LLM inference engine for GGUF (Qwen, DeepSeek, GLM, Hy4, Flint). Runs models bigger than your VRAM on CUDA and Vulkan, with MTP drafts and an OpenAI/Anthropic server. 12 GB RTX 3060 vs llama.cpp: Qwen3.6-35B-A3B UD-Q5_K_M 80.5 vs 64.4 tok/s, Flint UD-Q5_K_XL 64.6 vs 48.6. With MTP: 108 tok/s (UD-Q3_K_M), up to 160 (UD-Q2_K_XL).

Topics

Resources

Code of conduct

Contributing

Stars

401 stars

Watchers

3 watching

Forks

Repository files navigation

RustingStrata

Reviewed by Aletheore

A pure-Rust inference engine for GGUF models, built for MoE models that do not fit in VRAM. The CUDA kernels are compiled at run time with NVRTC, and the same kernels run on Vulkan: no C++ build step, no ggml. Experts that do not fit in VRAM run on the CPU at the same time as the GPU work, and the expert placement adapts to the routing it sees.

Supported models: Qwen3, Qwen3-Next, Qwen3.5/3.6, Qwen3.8-Flash-Next, Recursive Flint, Gemma 4, DeepSeek-V4.1-Flash, GLM-5.3-Flash, Hy4-flash and Inkling 2 Mini. The architectures, the GGUF types and the notes for each model are in docs/MODELS.md.

Version 1.3.0.

Numbers

Qwen3.6-35B-A3B on an RTX 3060 12 GB (Ryzen 5 7600X, 32 GB RAM), CUDA, greedy, against llama.cpp tuned for the same file. Neither file fits in VRAM.

RustingStrata llama.cpp
UD-Q5_K_M (25.2 GiB), decode after a 4K prompt 80.5 tok/s 64.4
UD-Q5_K_M, prefill of a 4K prompt 1530 tok/s 1118-1122
UD-Q2_K_XL (11.7 GiB), decode after a 4K prompt 113.4 tok/s 66.5
UD-Q2_K_XL, prefill of a 4K prompt 2216 tok/s ~2236

The method, the ranges, Vulkan, the other models and the quality checks are in docs/BENCHMARKS.md.

Install

Download a binary for Linux or Windows from the releases page, or build it (Rust 2024 edition; on Windows install the Visual Studio C++ Build Tools first):

cargo build --release    # the binary is target/release/rustingstrata

A GPU run needs one of:

  • an NVIDIA driver with the CUDA NVRTC library (loaded at run time). Volta (sm_70), Turing (sm_75) and Ampere or newer (sm_80+) work; CUDA 13 dropped Volta, so a V100 needs the 12.x toolkit. Pascal and older use Vulkan. The library is found by name (libnvrtc.so; on Windows nvrtc64_130_0.dll or nvrtc64_120_0.dll, on PATH or under %CUDA_PATH%\bin); STRATA_NVRTC names another file. Without it the run falls back to Vulkan.
  • a Vulkan 1.3 driver with shaderFloat64, int8/16/64 and subgroup size 32 or a fixed 64 (tested on RTX 3060, Radeon VII and V100; Intel Arc lacks shaderFloat64).

--gpu picks CUDA when it loads, else Vulkan; --backend chooses. The first CUDA run compiles the kernels (~15 s) and caches them. Every GPU tried so far is in docs/SUPPORTED_GPUS.md.

Quick start

Run rustingstrata with no arguments (double-click rustingstrata.exe on Windows). It starts a server on http://127.0.0.1:8080 and opens a chat page that downloads models from Hugging Face and switches between the ones in your models folder. Any app that takes an OpenAI-compatible address (Open WebUI, Jan, SillyTavern, code editors) can use http://127.0.0.1:8080/v1.

rustingstrata interface asks for the model, the mode (terminal chat, chat page, API server, speed test), GPU or CPU, the context length and the address, prints the command these make and runs it.

With flags:

M=path/to/model.gguf

rustingstrata calibrate --model $M     # once per model and machine: best chunk size, MTP drafts
rustingstrata chat --model $M --gpu    # --think for thinking mode, --temp 0.7 to sample
rustingstrata generate --model $M --gpu --prompt "Write a haiku about rivers." -n 128
rustingstrata serve --model $M --gpu --addr 127.0.0.1:8080
rustingstrata bench --model $M --gpu --pp 512,4096 --tg 128

Without --gpu the model runs on the CPU reference, which is slow and meant for checking. DeepSeek, GLM, Hy4 and Inkling 2 open the GPU by themselves.

Docs

Development

cargo test --release                      # GPU tests need the model: STRATA_MODEL=path/to/model.gguf
python -I tools/parity.py $M --extra "--gpu" --tag gpu   # agreement with llama.cpp (needs llama-server once)

CI only builds, so run the tests before a pull request.

Source map: src/gguf.rs (file reader), src/quant/ (dequantization), src/model.rs (CPU reference forward), src/cuda/ and src/vulkan/ (GPU kernels, behind src/backend.rs), src/gpu_model.rs (GPU forward), src/expert_cache.rs (expert placement), src/deepseek/, src/glm/, src/hy4/, src/inkling2/ and src/gemma4/ (the models with their own forward), src/serve.rs (HTTP), src/chat.rs (chat templates and tool calls), src/main.rs (CLI).

License

RustingStrata is released under the RustingStrata License 1.0. You may use, modify and distribute it, including for commercial services, as long as you keep the license and credit Vasyl Trefilov as the original author. You may not sell RustingStrata itself.

About

Pure-Rust LLM inference engine for GGUF (Qwen, DeepSeek, GLM, Hy4, Flint). Runs models bigger than your VRAM on CUDA and Vulkan, with MTP drafts and an OpenAI/Anthropic server. 12 GB RTX 3060 vs llama.cpp: Qwen3.6-35B-A3B UD-Q5_K_M 80.5 vs 64.4 tok/s, Flint UD-Q5_K_XL 64.6 vs 48.6. With MTP: 108 tok/s (UD-Q3_K_M), up to 160 (UD-Q2_K_XL).

Topics

Resources

Code of conduct

Contributing

Stars

401 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages