Claude returned ```json blocks 14% of the time. Here is the Rust crate I wish I had earlier.
A developer created a Rust crate called `llm-json-repair` to address issues with large language models, specifically Anthropic's Claude, returning JSON output that is not always parseable. The crate attempts to fix common formatting errors like extraneous prose, trailing commas, and incorrect fence usage in three sequential passes. This tool aims to save developers from making additional API calls to re-prompt the LLM for corrected JSON. AI
IMPACT Provides a local solution for developers struggling with LLM structured output, reducing API costs and improving workflow efficiency.