A from-scratch LLM inference engine and model server in Rust, with CUDA kernels. It runs DeepSeek V4.1 Flash on two 24 GB GPUs by keeping the routed experts in host RAM and a working set of them on the GPUs.
Warning
Firecrest is under heavy development. Expect breaking changes between releases: configuration keys, HTTP extensions, the management API, command-line options and the model file format may all change without a deprecation period.
What it does #
- DeepSeek V4.1 Flash (the 1017 checkpoint) on two NVIDIA GPUs with 24 GB each. The dense weights are split across the GPUs as tensor-parallel ranks; the routed experts (MXFP4, about 270 GiB) stay in host memory and are cached on the GPUs by popularity, with the CPU computing the experts that are not resident. The Engram tables are read from disk on demand.
- OpenAI- and Anthropic-compatible APIs (
/v1/chat/completions,/v1/messages) with streaming, tool calls, reasoning, image input and log-probabilities. - Profiles that trade exactness for speed per request:
accurate(exact routing),balanced(the default) andspeed; see docs/profiles.md for what each one changes and what it costs in quality. - A context store over GPU memory, host RAM and disk, so long conversations and repeated prefixes are not recomputed, up to the model's 1M-token window.
- Adapters and steering vectors applied per request or by default (docs/adapters.md), and policy scripts in Python that inspect and rewrite requests (docs/policies.md).
- A web console and a management API for models, requests, logs, statistics, policies and configuration, plus Prometheus metrics.
An engine for Inkling 2 Mini is in engines/inkling/. It is
experimental: its model, GPU kernels and speculative drafter exist as
libraries and tools, and firecrest serve does not serve it yet.
An engine for SmolLM3-3B, a small dense model, is in engines/smollm3/.
firecrest serve runs it with engine = "smollm3". It reads the published
GGUF files in every quantization (F16 down to the 1-bit IQ formats) and runs
on one GPU or on the CPU. Its tokenizer and chat format give the same tokens
as the publisher's, and its forward passes are checked against the
publisher's implementation. Served on an RTX 4060 Ti, the Q4_K_M file
decodes a short answer at 96 tokens/s
(engines/smollm3/gpu/VALIDATION.md,
"Serving", has the requests).
An engine for Qwen3.6-35B-A3B, a mixture-of-experts model with 3B
active parameters and Gated DeltaNet layers, is in engines/qwen3.6/.
firecrest serve runs it with engine = "qwen3.6", with thinking and tool
calls. It reads the published UD-Q4_K_XL GGUF file and runs on one GPU
(or, slowly, on the CPU): the dense weights, the cache and as many routed
experts as fit stay in VRAM, chosen by how often the model's own traffic
routes to them, and the host computes the others from the mapped file or,
in long prefills, copies them to the GPU. Its forward passes are checked
against the publisher's implementation. On an RTX 4060 Ti 16 GB with a
Ryzen 5 5500 it decodes at 54.5 tokens/s after short prompts and 50.8
after 4K-token prompts, and prefills 512 / 2048 / 8192 tokens at
571 / 553 / 509 tokens/s
(engines/qwen3.6/gpu/VALIDATION.md,
"Speed", has the commands and the prompt sets; served requests in
engines/qwen3.6/engine/README.md,
"Serving").
On the reference machine single-stream decode runs at
about 53 tokens/s in the balanced profile and 37 tokens/s in accurate.
docs/profiles.md has the measurements.
Requirements #
- Linux on x86-64. The CPU expert kernels use AVX-512 when the CPU has it and fall back to portable code otherwise (much slower).
- Two NVIDIA GPUs with 24 GB each and compute capability 8.0 or newer, and
the NVIDIA driver. The default build carries code for 8.0 and 8.6
(
FIRECREST_CUDA_SASS); newer GPUs compile it from PTX at first load. Only RTX 3090s have been tested. - Host RAM for the routed experts: about 300 GiB plus what the operating system and the context store use.
- About 470 GiB on a fast local SSD for the model file.
- To build: Rust (the toolchain in
rust-toolchain.toml) and the CUDA toolkit (nvccat build time; cuBLAS and the driver at run time). Node.js is needed only to build the web console.
Reference machine #
Every measurement in this repository was taken on this machine unless the document says otherwise. Memory bandwidth and PCIe bandwidth bound decode speed, so results on other machines scale with them.
| Part | |
|---|---|
| GPUs | 2× NVIDIA RTX 3090 24 GB, each on PCIe 3.0 x16, joined by an NVLink bridge (4 links); power limits 300 W and 220 W |
| CPU | Intel Xeon Gold 6152, 22 cores / 44 threads, one socket |
| Memory | 384 GB DDR4-2400 in six channels, one 64 GB LRDIMM per channel |
| Storage | NVMe SSD (Lexar NM790 4 TB) holding the model file |
Quick start #
-
Get the model files: docs/models.md.
-
Build the server with the GPU backend and image input. Building the console first embeds it in the binary; without
ui/distthe server runs without the console.(cd ui && npm ci && npm run build) # optional: the web console cargo build --release -p firecrest-cli --features gpu,vision -
Write a configuration (start from
engines/deepseek-v4.1/engine/examples/gpu.tomlwith your paths and CPU layout), check it, and start the server:target/release/firecrest config check firecrest.toml target/release/firecrest serve -c firecrest.toml -
Send a request:
curl -s http://127.0.0.1:7290/v1/chat/completions \ -H 'content-type: application/json' \ -d '{"model": "deepseek-v4.1-flash", "messages": [{"role": "user", "content": "Hello"}]}'
firecrest serve --mock starts the server with a fake model, which is enough
to try the APIs and the console without GPUs or weights. firecrest bench -c firecrest.toml measures a model's prefill and decode speed, as described in
"Measuring speed" in docs/operations.md.
Documentation #
docs/README.md indexes everything: operations, configuration, profiles, adapters, policies, the design notes and the model specifications. Contributors start with CONTRIBUTING.md; coding agents read AGENTS.md as well.
Roadmap #
- A native weight format and a converter from the official checkpoints, laid out for how Firecrest uploads and computes experts. GGUF stays supported as an input to the converter.
- Serving Inkling 2 Mini.
Acknowledgements #
The DeepSeek V4.1 Flash weights are DeepSeek's. The ds4 engine was the behavioural reference for the DeepSeek implementation, and its published GGUF files are the recommended way to get the model. Inkling 2 Mini is Thinking Machines'.
License #
MIT. See LICENSE.