A solo-built Python framework called Forge turned an 8B local model from a 53% failure rate into a 99.3% success rate on multi-step agentic workflows. The same wrapper lifted Claude Sonnet from 87.2% to near-perfect. The project hit Hacker News front page on May 19 with 206 points and ships as pip install forge-guardrails.


What Happened

Antoine Zambelli, AI Director at Texas Instruments, published Forge. It is a reliability layer that sits between a self-hosted LLM and any client that speaks the OpenAI or Anthropic API. The framework does not replace your model. It catches malformed tool calls, retries failed steps, rescues garbled JSON, and forces small models to stay in tool-calling mode. An IEEE-track paper backs the results (DOI: 10.1145/3786335.3813193).

The headline numbers come from Forge's own 26-scenario eval suite:

  • Bare Ministral-3 8B Q8 on llama-server: ~53%
  • Same model + Forge guardrails: 99.3%
  • Claude Sonnet bare: 87.2%
  • Claude Sonnet + Forge: ~100%

The gap between a $0 local model on a $600 GPU and a frontier API shrinks to under 1 percentage point when both run through Forge.


End-User Angle: Why This Changes What You Can Run at Home

For most of 2025 and early 2026, local agents were a toy. You could chat with a 7B or 8B model. You could ask it to call a tool. But hand it a five-step workflow and it would typo a function name, return plain text instead of JSON, forget which step it was on, and die somewhere in the middle. Real agentic work stayed on OpenAI or Anthropic APIs.

Forge changes the math. The model does not get smarter. The harness around it gets smarter. Forge adds five things:

  • Retry nudges — When a tool call fails, Forge injects a small corrective message and tries again. The model learns from the error inline.
  • Rescue parsing — When the model emits JSON inside a code fence, or uses Mistral's [TOOL_CALLS] syntax, or dumps Qwen XML, Forge extracts the structured call and rewrites it into canonical OpenAI format.
  • Step enforcement — Required steps are tracked and the loop cannot terminate until they finish.
  • Context compaction — Older turns get compressed so a runaway loop does not quietly drop the original user request.
  • Synthetic respond tool — Small models cannot decide between "emit text" and "emit a tool call." Forge removes the choice. There is always a tool to call. The proxy strips it from the outbound response so the client sees normal text.

The practical result: a self-hosted 8B model on consumer hardware now completes multi-step workflows at the same reliability as a frontier API. If you have a 24 GB GPU and you have been waiting for local agents to stop feeling like a hobby project, this is the moment.

The easiest on-ramp is the drop-in proxy. Run python -m forge.proxy --backend-url http://localhost:8080 --port 8081, point any OpenAI-compatible client at http://localhost:8081/v1, and the guardrails apply transparently. The client thinks it is talking to a smarter model.


Engineer Angle: What Is Actually Happening Under the Hood

Forge is not an agent orchestrator. It does not do DAG planning or multi-agent graphs. It is a reliability middleware for a single agentic loop. You can use it three ways:

  1. WorkflowRunner — Define tools, pick a backend client, attach a ContextManager, and run structured loops. Best for building on Forge directly.
  2. Guardrails middleware — Call ResponseValidator, the nudge system, and context compaction inside your own loop. You control the flow. Forge cleans the responses.
  3. Proxy server — Drop-in OpenAI/Anthropic-compatible proxy. Most popular entry point. Zero rewrite.

The core pipeline runs in this order on every request:

  • Response validation against the tool schema
  • Rescue parsing for non-canonical tool-call formats
  • Retry loop with corrective tool-result messages on failure
  • Synthetic respond tool injection (stripped before the client sees it)

The proxy supports Ollama, llama-server (llama.cpp), Llamafile, vLLM, and Anthropic. The top eval configs all run on llama-server with --jinja for native function calling. Without that flag, you fall back to prompt-injected tool calling, which drops accuracy measurably on the harder eval tier.

One finding from the HN thread deserves attention: the serving backend matters as much as the model. Zambelli found that Mistral-Nemo 12B weights score 7% accuracy on llama-server with native function calling and 83% on Llamafile in prompt-injected mode. Same weights. The difference is chat template and parsing behavior at the backend layer. This is under-reported and super consistent across backends.

The repo ships 865 deterministic unit tests and a 26-scenario eval harness split into OG-18 (baseline) and advanced_reasoning (harder). Batch eval outputs JSONL with automatic resume. Reports export to ASCII tables, HTML dashboards, or Markdown.


Contrarian Note: The Latency Story Is Still Blank

The published numbers are all accuracy. There are no public latency benchmarks. This is the most important gap in the project right now.

A single-shot 8B model might return in 800 milliseconds and be wrong. A Forge-wrapped run might take 2 to 4 seconds and finish correctly. That trade-off is reasonable for batch or background workflows. It is painful for interactive agents where every step adds round-trip delay.

Zambelli acknowledged this in the HN thread. He is introducing a new metric called ETTWS — Estimated Time To Working Solution — in the next paper revision. But that data does not exist yet. If you are building a real-time voice assistant or a chatbot that needs sub-second responses, you need to time-box your retries and prove the wall-clock-to-success beats your current setup.

Other honest limitations:

  • Python only. No JS, Go, or Rust bindings. Node-first stacks need a sidecar or they wait.
  • Model coverage is uneven. The eval suite is heavily skewed toward Ministral-3 and Mistral-Nemo. Qwen, Llama 3.x, and Gemma configs exist but are less battle-tested.
  • Solo maintainer. One author plus an academic paper. If you adopt it, plan to read the code.
  • The synthetic respond tool is a workaround. Some engineers will be uncomfortable that the proxy injects an extra tool into every request. ADR-013 in the repo explains the reasoning, but it is still a workaround.

The HN thread also surfaced a real pushback from a heavy local-LLM user: accuracy around tool calling has not been the problem for 6 to 12 months. The real pain is context management and timing. Forge adds layers and wrappers. For some local-agent setups, those wrappers could make the experience unusably slow. The retry loop means you do not error fast. You succeed slowly.


Key Facts

  • Author: Antoine Zambelli, AI Director at Texas Instruments
  • Repo: github.com/antoinezambelli/forge
  • License: MIT
  • Install: pip install forge-guardrails
  • Stars: 1,735 | Forks: 101
  • HN debut: May 19, 2026 — 206 points
  • Top eval result: 99.3% (Ministral-3 8B Q8 + Forge on strict tool-calling reliability)
  • Combined eval score: 86.5% (OG-18 + advanced_reasoning)
  • Hardest tier score: 76% (advanced_reasoning subset)
  • Backends: Ollama, llama-server, Llamafile, vLLM, Anthropic
  • Paper: DOI 10.1145/3786335.3813193
  • Python: 3.12+
  • Unit tests: 865 deterministic tests
  • Eval scenarios: 26 (OG-18 baseline + 8 advanced_reasoning)

Sources