mangiucugna/json_repair
A python module to repair invalid JSON from LLMs
Provides syntax error correction for common LLM output mistakes—missing quotes, unescaped characters, incomplete arrays/objects—while preserving content integrity. Uses a two-stage approach: first attempts standard library `json.loads()` for performance, then falls back to a custom repair parser only on failure. Offers drop-in replacements for `json.load()` and `json.loads()`, with optional `skip_json_loads` and `strict` modes for performance tuning and validation control.
4,585 stars and 16,557,243 monthly downloads. Used by 31 other packages. Actively maintained with 10 commits in the last 30 days. Available on PyPI.
Stars
4,585
Forks
175
Language
Python
License
MIT
Category
Last pushed
Mar 07, 2026
Monthly downloads
16,557,243
Commits (30d)
10
Reverse dependents
31
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/llm-tools/mangiucugna/json_repair"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
Compare
Related tools
antfu/shiki-stream
Streaming highlighting with Shiki. Useful for highlighting text streams like LLM outputs.
yokingma/fetch-sse
An easy API for making Event Source requests, with all the features of fetch(), Supports...
iw4p/partialjson
+1M Downloads! Repair invalid LLM JSON, commonly used to parse the output of LLMs — Parsing...
kaptinlin/jsonrepair
A high-performance Golang library for easily repairing invalid JSON documents. Designed to fix...
a-r-d/ai-json-safe-parse
Depedency free safe fuzzy JSON parsing for semi malformed LLM responses