Shim: JSON Repair Layer for LLM Outputs

Shim intercepts malformed JSON from language models and repairs it in sub-millisecond time. Prevents production API failures caused by truncated JSON, markdown fences, and syntax errors.

Developer Tools
Web, API
Live in Production
Reality check
38% of GPT-4 streaming outputs have JSON syntax errors
Retries cost 200x more latency. Shim fixes in 8ms.

Stop your LLM from breaking production.

Repair broken JSON from LLMs as it streams. Sub-millisecond fixes. Zero data stored. No retries needed.

Streaming & batch support
Zero data persistence
Confidence scoring
response_body
MALFORMED
{
  name: "Widget A",
  status: 'active',
  score: NaN,
  tags: ['new', 'promo',],
}
Repaired by Shim
Confidence:HIGH

Sub-Millisecond Repair

Repair engine runs in <0.1ms. Total API response in 5-15ms. 200x faster than OutputFixingParser.

Streaming Support

Repair JSON as it streams from your LLM. No waiting for complete output. Zero retries.

Confidence Scoring

Every repair includes a confidence level. Know when to trust the output or flag for review.

Zero Data Persistence

We don't want your data. Privacy is built-in: ephemeral processing only.

100% Reliability

Never throw a 500 error again. Shim guarantees valid JSON or a structured error.

Developer First

Simple API. Typed SDKs. Console shows exactly what we fixed.

3 lines. 0 crashes.

Drop in Shim. Never worry about broken JSON again.

Without Shim

const llmOutput = await getLLMResponse();

// ❌ Crashes on malformed JSON
const data = JSON.parse(llmOutput);

// Your app never reaches here
processData(data);
SyntaxError: Unexpected end of JSON input

With Shim

import { shim } from 'shim-sdk';

const llmOutput = await getLLMResponse();

// ✓ Repairs and returns valid JSON
const data = await shim.repair(llmOutput);

// Always reaches here
processData(data);
Repaired in 1.2ms • High confidence

Faster and cheaper than alternatives

Compare Shim to OutputFixingParser, LLM retries, and custom parsing solutions.

SolutionLatencyCostSuccess Rate
Shim8-50ms$0.00199.7%
OutputFixingParser1,500-3,000ms$0.0394%
Full LLM Retry3,000-8,000ms$0.05-$0.10~100%
try/catch only0ms$00%
200x
Faster than OutputFixingParser (no LLM round-trip needed)
30x
Cheaper than LLM retries (fixed cost per repair)
99.7%
Success rate with confidence scoring for safety

Migrate in under 5 minutes

Before (OutputFixingParser)
from langchain.output_parsers \
  import OutputFixingParser

parser = OutputFixingParser\
  .from_llm(llm, base_parser)

# 1,500-3,000ms 😓
result = parser.parse(broken_json)
After (Shim)
from shim import ShimClient

shim = ShimClient(api_key="sk_...")

# 8-50ms ⚡
result = shim.repair.create(
  content=broken_json,
  schema=schema
)

Simple, transparent pricing.

Pay for repairs, not promises.

Free

$0/mo

Full features. Limited scale.

  • 1,000 repairs/month
  • 100 req/min
  • All core features
  • Community support
MOST POPULAR

Pro

$29/mo

Production scale. Faster support.

  • 100,000 repairs/month
  • 1,000 req/min
  • Priority support (24h)
  • 99.9% SLA

Team

$99/mo

High volume. Team access.

  • 1,000,000 repairs/month
  • 10,000 req/min
  • Dedicated support (4h)
  • Team collaboration

Frequently asked questions

Everything you need to know about Shim.

Still have questions?

Contact support →