json-repair  by RealAlexandreAI

JSON repair tool for LLM outputs

Created 1 year ago
278 stars

Top 93.4% on SourcePulse

GitHubView on GitHub
Project Summary

This Go library and CLI tool, json-repair, addresses the common problem of malformed JSON output generated by Large Language Models (LLMs). It provides a robust solution for developers and data engineers who need to reliably parse and process this often-unpredictable data, saving significant debugging time.

How It Works

The library intelligently detects and corrects a wide array of JSON syntax and structural errors. It handles issues like single quotes, line feeds, unclosed arrays/objects, incorrect key-value pairs, and even comments within JSON strings. Its zero-dependency design ensures easy integration into existing Go projects and minimal overhead.

Quick Start & Requirements

  • Install: go get github.com/RealAlexandreAI/json-repair
  • CLI Install: brew install realalexandreai/tap-jsonrepair/jsonrepair
  • Prerequisites: Go toolchain.
  • Usage: Refer to the Online Playground or Test Cases.

Highlighted Details

  • Supports numerous LLM-generated JSON anomalies.
  • Offers a zero-dependency Go library and a CLI tool.
  • Includes a comprehensive test suite for reliability.
  • Auto-detects and repairs a broad spectrum of JSON errors.

Maintenance & Community

The project is open-source and welcomes contributions. A roadmap is available, with some features already implemented.

Licensing & Compatibility

Distributed under the GPLv3 License. This copyleft license may have implications for use in closed-source commercial applications.

Limitations & Caveats

The GPLv3 license may restrict commercial use in proprietary software without adherence to its terms.

Health Check
Last Commit

3 weeks ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
6 stars in the last 30 days

Explore Similar Projects

Starred by Philipp Schmid Philipp Schmid(DevRel at Google DeepMind) and Stas Bekman Stas Bekman(Author of "Machine Learning Engineering Open Book"; Research Engineer at Snowflake).

json_repair by mangiucugna

1.3%
3k
JSON repair tool for LLM outputs
Created 2 years ago
Updated 1 day ago
Feedback? Help us improve.