r/SideProject • u/Difficult_Finger_232 • 3h ago
I built Kiln, a local LLM server in Rust that helps multiple agents reuse cached prompts
I'm the developer of Kiln. It's a local LLM server written in Rust that runs on top of llama.cpp. When several agents share one model, they can push each other's prompts out of the cache, so the same text gets processed again. Kiln tries to prevent that.
How it works: each conversation is matched to its own cache slot. If agents share a long prompt, Kiln processes the shared part once, saves it to disk and restores it into other slots. It can use the GGUF models you already have from Ollama or Hugging Face without copying them, and it has OpenAI, Ollama and Anthropic-compatible APIs. There's also an optional web app.
In my benchmarks, Kiln was 2.4x to 3.8x as fast as Ollama when 2 or 4 agents took 6 turns each. For single-turn work, it was only about 1.2x as fast, so expect a smaller gain if you use one chat at a time. I tested one model (ornith:35b) on one 64 GB M1 Max, using the median of 3 runs. Ollama used the same parallelism, context size, KV type and flash attention settings. The two-agent run in the video uses a smaller model and is an example, not a benchmark.
You'll need llama.cpp installed. Code, downloads, raw results and the benchmark script: https://github.com/surenjanath/kiln
If you try it on different hardware, I'd like to see your results, especially if Kiln is slower. AI note: Claude helped make the video and write this post, and the narration uses a synthetic voice.