json_repair and partialjson
These are competitors—both parse and repair malformed JSON from LLM outputs, with json_repair offering more mature adoption while partialjson specializes in handling partial/streaming JSON responses.
About json_repair
mangiucugna/json_repair
A python module to repair invalid JSON from LLMs
This tool helps developers clean up messy JSON data, especially when it comes from large language models (LLMs) that might make formatting mistakes. You feed it a JSON string that's not quite right, and it gives you back a perfectly valid, standard JSON string or object. It's for software engineers who integrate LLMs or other external services and need reliable data parsing.
About partialjson
iw4p/partialjson
+1M Downloads! Repair invalid LLM JSON, commonly used to parse the output of LLMs — Parsing ChatGPT and llm JSON stream response — Partial and incomplete JSON parser python library for OpenAI | repair invalid JSON, parse output of LLMs
When working with AI language models, you often receive data that looks like a structured list or object, but it's cut off or malformed. This tool takes that incomplete, text-based output from an AI and converts it into a usable, structured data format like a Python dictionary or list, even if it's not perfectly formed. It's for developers building applications that rely on AI responses, ensuring they can reliably process the AI's output into structured data for further use.
Related comparisons
Scores updated daily from GitHub, PyPI, and npm data. How scores work