Give smaller models a fair shot
Test a smaller model on your own tool calls. If it chooses the right action but formats an argument incorrectly, CheckJSON can often fix the format. Measure task success and repair cost before switching.

Fix malformed tool calls before they reach your app. CheckJSON repairs supported JSON and schema errors without asking the original model to start over.
"rooms": "Entry""rooms": ["Entry"]Test a smaller model on your own tool calls. If it chooses the right action but formats an argument incorrectly, CheckJSON can often fix the format. Measure task success and repair cost before switching.
Fix supported syntax and type errors with local rules. Reserve another model call for cases where the rules leave a gap.
Inspect the candidate, applied edits, and returned status. During a client handoff or an incident review, show exactly what was repaired and what still needs a decision.
Add CheckJSON between model output and tool execution. Try it first on one tool, then compare outcomes before rolling it out across a workflow.
On 157 RestGPT queries, CheckJSON increased schema-valid calls from 46.50% to 99.36%. In the controlled benchmark, it preserved 9,724 of 9,726 clean calls and correctly handled 18,379 of 20,674 controlled tasks (88.90%). On recorded Llama-3.1-8B outputs, it corrected 608 previously incorrect outputs and made 20 previously correct outputs incorrect. Both evaluations drew from the task pool used to refine the rules.
pip install checkjson-repairFor the alpha release, use pip install --pre checkjson-repair.
from checkjson import RulesOnly
checker = RulesOnly()Rules-only repair runs locally and needs no API key.
result = checker.repair(task, trace=True){ "area": 'Entry', "domain": "lock" }{ "area": "Entry", "domain": ["lock"] }checkjson tuickjn tuiPress F3 to see your project’s outcomes and recent runs.
CheckJSON is MIT-licensed. Run rules locally with no API key. Optional model providers may charge for their calls.
Read the licenseIt sits between the model that writes a tool call and the application that decides whether to run it.

The left column shows the request, schema, and candidate for the selected example. Open either JSON box to inspect it.
Parser checks JSON syntax. Validate checks the call against the tool schema. A valid call goes straight to Output.
Lexical rules fix syntax. Semantic rules fix supported schema errors. The optional corrector can propose values for unresolved fields. The saved examples on this page use rules only. A live repair can also use the corrector.
The active box shows whether the call is valid, has a hole, or needs no call. Expand the payload to inspect what CheckJSON returned. Your application still checks intent before running a tool.
Replay a recorded trace, pick any of the 20,674 benchmark calls, or edit a call and repair it live.
Choose an example in the list under this box, or press Random there.
Benchmark calls come from API-Bank, BFCL, NexusRaven and ToolAlpaca with injected errors. NexusRaven data is for non-commercial use. Sources and licences
Ask your model a question with tools. CheckJSON then checks and repairs its reply, step by step.
Your key is sent to the CheckJSON Space on Hugging Face, which uses it for this one request to your provider. The page does not save it, and the Space is written not to save or log it. Use a key with a spending limit. Your provider may charge you. A model on your own computer cannot be reached from here: use checkjson demo.
Running sends this request, these tools and this call to the CheckJSON Space on Hugging Face. Do not paste private data or keys. No tool is run.

Hover over a box, or click it, to see the input it got and the output it gave.
Schema validity, exact-call accuracy, and task success measure different outcomes.
| Setting | Metric | n | Baseline | CheckJSON | Change (pp) | Rescued / harmed |
|---|
Scores are percentages. Application rows count improved and worsened runs. The corruption and recorded-output tests drew from the task pool used to refine the rules. Application comparisons used independently sampled replies.
Run a built-in example with no API key or model download.
python -m pip install --pre checkjson-repair checkjson example checkjson tui