Native GGUF
Read weights directly from disk with memory mapping and inspect tensors, metadata, and tokenization.
LOCAL-FIRST LLM INFRASTRUCTURE
Run GGUF models directly in Rust — with a clear path from mapped weights to generated tokens, a local API, and benchmarks you can reproduce.
$ rusty-llm model.gguf --prompt
"Explain inference in one sentence."
Inference turns your prompt into tokens, runs them through model weights, and predicts the next token — locally.
01WHY RUSTYLLM
RustyLLM keeps the full inference path visible: GGUF parsing, zero-copy model access, quantized matrix-vector kernels, KV caching, sampling, and HTTP routing.
It is practical enough to run a local assistant — and compact enough to understand, modify, and benchmark without a sprawling framework.
Read weights directly from disk with memory mapping and inspect tensors, metadata, and tokenization.
Keep models, prompts, and embeddings on your own machine. No hosted runtime required.
Compare prefill and decode throughput, inspect kernels, and make optimisation decisions from data.
02THE INFERENCE PATH
Every stage has a home in the source and a reason to exist.
Open a GGUF file, parse its metadata, and keep quantized tensors close to the original bytes.
GGUF → mmapApply tokenizer rules and the model's native chat template before inference begins.
text → idsBuild the KV cache, reuse it across turns when appropriate, then generate one next token at a time.
KV → logitsUse the CLI, local web UI, embeddings API, or OpenAI-compatible HTTP endpoints.
logits → response03PERFORMANCE, WITH CONTEXT
RustyLLM exposes separate prefill and decode timings, kernel benchmarks, backend policies, and Metal telemetry — so an optimisation is more than a hopeful toggle.
See benchmark notes ↗Measured local CLI decode, Metal auto, short prompt.
Tune the path your workload actually uses.
04MAKE IT YOURS
Trace a response from GGUF metadata to SIMD kernels and KV-cache reuse — without losing the system in abstraction.
↗Start a small HTTP server for chat, completions, embeddings, and familiar OpenAI-style clients.
Compare CPU and Metal routes, profile kernels, and keep the data that justified a change.
OPEN SOURCE · MIT LICENSE
Bring a compatible GGUF file. RustyLLM handles the rest — transparently.
cargo install --git https://github.com/SimonWaldherr/RustyLLM rusty-llm
rusty-llm ./model.gguf --prompt "Hello local inference."View RustyLLM on GitHub →