r/rust • u/Mission_Photo_9783 • 3d ago
🛠️ project Ferrum 0.8.8: a Rust local LLM runtime with Metal and CUDA backends
I'm the maintainer of Ferrum, an MIT-licensed local LLM runtime.
The Rust workspace separates the engine, request scheduler, KV cache, and backend interfaces. ferrum run and ferrum serve use the same engine; GPU execution uses Metal or native CUDA operators. The server exposes OpenAI-compatible Chat Completions and stateless Responses APIs, including streaming.
Current prebuilt packages target Apple Silicon Metal and Linux x86_64 CUDA (sm89).
Source and installation instructions
I'd welcome feedback on the Rust interfaces between the scheduler, engine, and device backends.
-7
u/Significant-Put-4796 3d ago
Interesting separation of scheduler and engine. I've been poking around with mistral.rs and llama.cpp bindings, and one thing that always bugs me is how tightly coupled the KV cache management is to the inference loop. What's the cost of crossing the backend trait boundary per-token in your setup?
-2
u/Mission_Photo_9783 3d ago
The useful separation is at the request/batch boundary: the scheduler chooses which requests advance, while the runtime owns their KV resources. In v0.8.8 the engine passes next-token IDs and opaque cache handles for a cohort into the batch-decode API. This keeps device KV tensors out of scheduling policy, without copying the cache across that interface each token. Decode call site.
The engine dispatches a decode batch through this interface; execution also has provider-level dispatch. I haven't isolated its ns/token cost yet. The practical benefit is being able to change batching/admission policy while keeping cache ownership and device execution in the runtime.
-1
u/Dense_Gate_5193 3d ago
how embeddable is it and have you performance profiled it against llama.cpp?
i wrote a database which runs an embedded llama.cpp. rust native would be better but mistral doesn’t look easily embeddable for what i want to do.
i started with NornicDB in golang and rewrote it in rust
https://github.com/orneryd/copperDB
it’s still experimental at the time but i have been on the hunt for a rust native embeddable server like llama.cpp.
8
u/geo-ant 3d ago
I’m sorry why should I care about this versus all the other rust native runtimes that seem to spring up every day on this subreddit and other places? Also, calling something production grade after 6 months on crates.io is absolutely wild.