llm_json

Library Listed

Rust crate to fix malformed JSON outputs from LLMs

Checked · Sources

Downloads
13,523
Dependents
9
Stars
21
Forks
4
Contributors
3
Commits
23
Latest release
1.0.3 ·

About

From the project README ·

A Rust library to repair broken JSON strings, particularly useful for handling malformed JSON output from Large Language Models.

This is a porting of the Python library json_repair, written by Stefano Baccianella and published under the MIT license.

All credits go to the original author for the amazing work.

Programmatic Usage

Install llm_json in your project:

cargo add llm_json

Then use it to repair your broken JSON strings:

use llm_json::{repair_json, loads, JsonRepairError};

fn main() {
  // Basic repair
  let broken_json = r#"{name: 'John', age: 30,}"#;
  let repaired = repair_json(broken_json, &Default::default())?;
  println!("{}", repaired); // {"name": "John", "age": 30}
  
  // Parse directly to Value
  let value = loads(broken_json, &Default::default())?;
}

CLI Usage

Install llm_json locally:

cargo install llm_json

Then use it to repair your broken JSON strings and files:

# Repair JSON from stdin
echo '{name: "John", age: 30,}' | llm_json

# Repair a file
llm_json broken.json

# Save to new file
llm_json input.json -o fixed.json

# Fix file in-place
llm_json broken.json --inline

License

MIT

Runs on
GPU support unknown
What shows it
  • no dependency or feature matches a backend row
Native code
None found
  • No native code found
Python bindings
No Python binding crate found
License
MIT

Compare with similar projects

Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.

llm_json beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
llm_json This page Listed

Rust crate to fix malformed JSON outputs from LLMs

13,523 downloads over 30 days 9 21 1.0.3 GPU support unknown No native code found MIT
rmcp Featured

Rust SDK for Model Context Protocol

12,149,426 downloads over 30 days 2,400 4,101 3.9.0 GPU support unknown No native code found Apache-2.0

Type-safe implementation of the Model Context Protocol in Rust, designed to reduce errors and accelerate development with powerful utilities.

107,187 downloads over 30 days 19 79 2.0.0 GPU support unknown No native code found MIT
rust-mcp-sdk Featured

An asynchronous SDK and framework for building MCP-Servers and MCP-Clients, leveraging the rust-mcp-schema for type safe MCP Schema Objects.

29,764 downloads over 30 days 51 199 2.0.0 GPU support unknown No native code found MIT
yoagent Listed

The agent loop for Rust: stream from 7 LLM protocols, run tools, loop until done. Native or wasm32 (Cloudflare Workers).

2,027 downloads over 30 days 5 369 0.27.4 GPU support unknown No native code found MIT
axp App Listed

An open protocol that gives AI agents a secure, sandboxed place to run code and use tools — with lean context usage. AXP works alongside MCP

Not measured Not applicable 3 Not measured Not measured Not measured Apache-2.0
ollama-rag-rs App Listed Dormant

Experimenting with LLMs through Ollama and retrieval augmented generation (RAG) in Rust

Not measured Not applicable 19 Not measured Not measured Not measured Apache-2.0
Why ListedNo archive, New or Featured rule places it, so it is Listed.

What it lacks for Featured

  • It has 6 active dependents and 6 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 21 stars, 4 forks and 3 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.

What else the check found

  • The last activity is on 26 Mar 2026, 228 days ago. The rules expect an update within 365 days. Dormancy rule
  • The oldest outside issue waits 523 days for a reply, past the limit of 270. No maintainer replied in 365 days. Rot signals rule

Exact rules: Listed, Featured library. The check on applied thresholds version 9.

Every rule outcome, as the check records it
  • expected-interval: version 1.0.3 base 300, capped at 4 releases = 200, raised to the 365-day floor: E = 365 days
  • dormancy: last activity 2026-03-26, 228 days ago, E = 365: active
  • rot: oldest unanswered issue 523 days (limit 270), no maintainer reply in 365 days
  • featured: not featured: active_users 6 < 11 and new_adopters 6 < 9 and repository route stars 21 (needs 4539), forks 4 (needs 434), contributors 3 (needs 79)
  • listed: listed: no archive, new or featured rule applies

Measurements and sources

Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.

Sources6 sources
Adoption6 active dependents, 6 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents6crates.io database dumpYes
New dependents (365 days)6crates.io database dumpYes
Peak active dependents6crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: 7 months ago3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-03-26GitHub repositoryYes
Latest release2026-03-26crates.io database dumpYes
First release2025-05-29crates.io database dumpYes
Latest version1.0.3crates.io database dumpYes
Days the oldest outside issue waits for a reply523GitHub repositoryYes
Maintainer replies over 365 days0GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageYes
Published docstruecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementnonecrates.io database dumpYes
Distribution4 releases, 13,523 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases4crates.io database dumpYes
Downloads over 30 days13523crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
Repository21 stars, 4 forks, 3 contributors, 23 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars21GitHub repositoryYes — one part of the repository route
GitHub forks4GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account3GitHub contributorsYes — one part of the repository route
Commits on the default branch23GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseMITcrates.io database dumpNo
Runs on, from listed crates and their direct dependenciesGPU support unknowncrates.io database dumpNo
What shows each backendno dependency or feature matches a backend rowcrates.io database dumpNo
Native code, from listed crates and their dependenciesNo native code foundcrates.io database dumpNo
Python bindings, from direct dependencies of listed cratesNo Python binding crate foundcrates.io database dumpNo
Crates that depend on a listed crate directly9crates.io database dumpNo

Corrections and review history

Report a correction

No correction applies to this entry.

Judgments

A judgment enters only through an approved issue and a merged pull request.

No judgment applies to this entry.