cd /news/artificial-intelligence/building-ai-agents-in-rust-part-10 · home topics artificial-intelligence article
[ARTICLE · art-65611] src=pub.towardsai.net ↗ pub= topic=artificial-intelligence verified=true sentiment=· neutral

Building AI Agents in Rust - part 10

In the tenth installment of a series on building AI agents in Rust, the author explores running local models as child processes via stdin/stdout instead of HTTP, using Salvatore Sanfilippo's DwarfStar inference engine for DeepSeek models as an example.

read1 min views1 publishedJul 20, 2026
Building AI Agents in Rust - part 10
Image: Pub (auto-discovered)

Member-only story

A provider with no socket #

Every provider Eugene has spoken to so far, going all the way back to Part 6, ends the same way: a URL, a header, a JSON body over HTTP. Anthropic’s Messages API, OpenAI’s Chat Completions, and even Ollama running on the same laptop as the agent all get the same treatment, because the Provider

trait was built around one assumption: somewhere, there is a socket. Ollama already narrows the distance to zero latency-wise, but the shape of the call is still “make an HTTP request to localhost and wait.” This closing post asks what happens when you drop that assumption entirely and drive a local model the way you’d drive any other child process: stdin in, stdout out, no port to bind, nothing to `curl`

while it’s still warming up.

The model behind this post is DwarfStar, Salvatore Sanfilippo’s local inference engine for DeepSeek V4 Flash and PRO. It is deliberately narrow: not a GGUF runner for any model you throw at it, a purpose-built engine for one model family, tuned for Metal, CUDA, and ROCm, with native tool calling, disk-backed KV caches, and even a distributed mode that splits layers across two Mac Studios over Thunderbolt. It ships two binaries. ds4-server

speaks OpenAI, Anthropic, and Responses-shaped HTTP, which means the Part 6 OpenAiProvider

already works against it with nothing more than a base_url

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @anthropic 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/building-ai-agents-i…] indexed:0 read:1min 2026-07-20 ·