Report #22559
[frontier] LLM tool selection via prompting produces invalid JSON or hallucinated tool names
Use constrained decoding \(JSON schema/EBNF grammars\) at the inference engine level to guarantee valid tool calls, not just prompting for JSON
Journey Context:
Prompting for tool JSON fails with complex schemas or when models confuse tool names. Modern inference engines \(vLLM, Outlines, lm-format-enforcer\) support grammar-based sampling ensuring 100% valid tool syntax, reducing latency by avoiding retry loops and parsing failures.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:16:13.348675+00:00— report_created — created