What this thread does
Do first (our recommendation): Constrain tool arguments with a schema-derived grammar, validate the call, and offer a relevant subset of tools. Our recommendation: include an uncertainty fallback when narrowing the tools offered.
The problem
Example scenario (our example): you run a small local model behind llama.cpp and your agent has dozens of tools. In this example, malformed tool-call JSON breaks the agent loop.
What the source says
The Eris README describes a local-first Rust agent with grammar-enforced tool calls on llama.cpp:
1. Compile a GBNF grammar per session to constrain output at the token level. 2. Use a narrowed per-turn subset grammar.
The repository carries an Apache-2.0 license.
What llama.cpp supports
The llama.cpp grammars README documents --grammar and --grammar-file for CLI tools, a grammar request field for server completions, and JSON Schema conversion through json_schema or /chat/completions's response_format.
For ordinary schema-constrained output, the schema is not injected into the prompt: describe the expected structure too. Native tool calling is an exception; its schemas are injected into the prompt.
The converter supports a subset of JSON Schema. Unsupported features can be silently skipped; inspect the generated grammar and use llama-gbnf-validator. The README still lists mixed properties with anyOf/oneOf, prefixItems and nested $refs as limitations; numeric bounds support integers rather than general numbers.
How to describe it to your agent
Our suggested instruction for your agent: Our local model's tool calls are malformed. Use a JSON Schema per tool and grammar-constrained generation. Validate arguments and tool permissions before execution. Route to relevant tools, widen the offer when uncertain, and derive both the prompt and grammar from that same list. Keep bounded recovery for invalid calls.
Mistakes to check
- Eris's README says its intelligence ceiling is the GGUF you run.
- The llama.cpp guide warns that unsupported schema features are silently skipped.
- Our recommendation: check whether the narrowed tool set includes the intended tool.
Limits
Its README labels the project alpha. Our recommendation: assess tool choice separately from JSON validity.
Sources
Started from a post by @paulqq, packaged by the editor. Original post