Show HN: Forge – Guardrails take an 8B model from 53% to 99% on agentic tasks Forge is a reliability layer for self-hosted LLM tool-calling that uses guardrails and context management to dramatically improve performance on multi-step agentic tasks, boosting an 8B model from 53% to 99% accuracy. It offers three integration methods: a full WorkflowRunner for structured agent loops, composable guardrails middleware for custom orchestration, and an OpenAI-compatible proxy server that transparently applies guardrails to any client. The system supports multiple backends including Ollama, llama-server, Llamafile, and Anthropic, with the top self-hosted configuration scoring 86.5% across 26 evaluation scenarios. A reliability layer for self-hosted LLM tool-calling. You give forge a set of tools; the model calls whichever it wants in whatever order. Workflow structure is opt-in — required steps , prerequisites , and terminal tool let you constrain the loop when you need to, but forge's guardrails rescue parsing, retry nudges, response validation apply with zero required steps too. Forge takes an 8B local model from single digits to 84% across forge's 26-scenario v0.7.0 eval suite — and even lifts Sonnet 4.6 from 85% to 98% on the same workload Anthropic numbers measured in v0.6.0; not re-run in v0.7.0 since the cost is non-trivial . What forge isn't: Not an agent orchestrator. Forge sits inside one agentic loop and makes its tool calls reliable. Multi-agent graphs, DAG planners, and cross-agent coordination are out of scope. Not a coding harness. Forge is domain-agnostic. If you're building a coding agent or already using one like opencode, aider, Cline , proxy mode proxy-server lifts your existing harness with forge's guardrails — no rewrite. Three ways to use it: - Proxy server — Drop-in proxy python -m forge.proxy speaking both the OpenAI chat-completions and Anthropic Messages /v1/messages APIs, sitting between any client and a local model server. Point OpenAI-compatible tools opencode, Continue, aider or Claude Code at it and forge applies guardrails transparently — the client thinks it's talking to a smarter model. Most popular entry point. - WorkflowRunner — Define tools, pick a backend, run structured agent loops. Forge manages the full lifecycle: system prompts, tool execution, context compaction, and guardrails. SlotWorker adds priority-queued access to a shared inference slot with auto-preemption — for multi-agent architectures where specialist workflows share a GPU slot. Best when you're building on forge directly. - Guardrails middleware — Use forge's reliability stack composable middleware /antoinezambelli/forge/blob/main/examples/foreign loop.py inside your own orchestration loop. You control the loop; forge validates responses, rescues malformed tool calls, and enforces required steps. Supports Ollama, llama-server llama.cpp , Llamafile, vLLM, and Anthropic as backends. - Python 3.12+ - A running LLM backend see below pip install forge-guardrails core only pip install "forge-guardrails anthropic " + Anthropic client For development: git clone https://github.com/antoinezambelli/forge.git cd forge pip install -e ". dev " llama-server recommended — top 10 eval configs all run on llama-server : Install from https://github.com/ggml-org/llama.cpp/releases llama-server -m path/to/Ministral-3-8B-Instruct-2512-Q8 0.gguf --jinja -ngl 999 --port 8080 Ollama alternative — easier setup, slightly weaker on harder workloads : Install from https://ollama.com/download ollama pull ministral-3:8b-instruct-2512-q4 K M Anthropic API, no local GPU needed : pip install -e ". anthropic " export ANTHROPIC API KEY=sk-... See Backend Setup /antoinezambelli/forge/blob/main/docs/BACKEND SETUP.md for full instructions and Model Guide /antoinezambelli/forge/blob/main/docs/MODEL GUIDE.md for which model fits your hardware. Start llama-server however you normally do e.g. in a separate shell : llama-server -m path/to/Ministral-3-8B-Instruct-2512-Q8 0.gguf --jinja -ngl 999 --port 8080 Then the Python you'll run e.g. from another shell : python import asyncio from pydantic import BaseModel, Field from forge import Workflow, ToolDef, ToolSpec, WorkflowRunner, LlamafileClient, ContextManager, TieredCompact, def get weather city: str - str: return f"72°F and sunny in {city}" class GetWeatherParams BaseModel : city: str = Field description="City name" workflow = Workflow name="weather", description="Look up weather for a city.", tools={ "get weather": ToolDef spec=ToolSpec name="get weather", description="Get current weather", parameters=GetWeatherParams, , callable=get weather, , }, required steps= , terminal tool="get weather", system prompt template="You are a helpful assistant. Use the available tools to answer the user.", async def main : client = LlamafileClient gguf path="path/to/Ministral-3-8B-Instruct-2512-Q8 0.gguf", mode="native", recommended sampling=True, ctx = ContextManager strategy=TieredCompact keep recent=2 , budget tokens=8192 runner = WorkflowRunner client=client, context manager=ctx await runner.run workflow, "What's the weather in Paris?" asyncio.run main For multi-step workflows, multi-turn conversations, and backend auto-management, see the User Guide /antoinezambelli/forge/blob/main/docs/USER GUIDE.md . If you're building a long-running session CLI, chat server, voice assistant , see the long-running session advisory /antoinezambelli/forge/blob/main/docs/USER GUIDE.md long-running-sessions-filtering-transient-messages for important guidance on filtering transient messages. Drop-in proxy that sits between any client and a local model server, speaking both the OpenAI chat-completions API and the Anthropic Messages API /v1/messages . Point your client at the proxy e.g. http://localhost:8081/v1 and forge applies its guardrails transparently — the client thinks it's talking to a smarter model. This is the path for using forge with an existing harness opencode, Continue, aider, Cline, anything that speaks the OpenAI chat-completions schema — or Claude Code, which speaks the Anthropic Messages API . No Python rewrite. External mode — you manage the backend, forge proxies it python -m forge.proxy --backend-url http://localhost:8080 --port 8081 Managed mode — forge starts the backend and the proxy together python -m forge.proxy --backend llamaserver --gguf path/to/model.gguf --port 8081 Managed vLLM — pass a model directory or HF repo id via --model-path python -m forge.proxy --backend vllm --model-path /path/to/awq-dir --port 8081 Then configure your client to use http://localhost:8081/v1 as the API base URL. Claude Code: the proxy also serves the Anthropic Messages API on POST /v1/messages , so you can point Claude Code at a forge-guarded local model — set ANTHROPIC BASE URL=http://localhost:8081 and ANTHROPIC AUTH TOKEN=anything for the claude process. See Using forge with Claude Code /antoinezambelli/forge/blob/main/docs/USER GUIDE.md using-forge-with-claude-code for the full setup native-vs-prompt FC, Anthropic-shape downstreams, cache control . Backend compatibility: Managed mode spins up the backend for you. Supported backends: llamaserver , llamafile , ollama , vllm use --backend