Migrating from LangChain OutputFixingParser
OutputFixingParser works but has two problems: latency and retries. Shim fixes both.
The Problems
1. Latency
OutputFixingParser waits for the full LLM output before attempting repair. This adds 2-5 seconds of delay.
2. Retries are Expensive
OutputFixingParser sends broken JSON to another LLM call:
Migration Path
Before: LangChain
After: Shim
Benefits
| Metric | OutputFixingParser | Shim |
|---|---|---|
| Latency | 4-10s | <10ms |
| Retry cost | $0.03/repair | $0.001/repair |
| Streaming | No | Yes |
| Schema validation | No | Yes |
| Confidence scoring | No | Yes |
With Schema Validation
Before: LangChain (Pydantic)
After: Shim (JSON Schema)
Streaming Support
Before: No Streaming
LangChain parsers don’t support streaming. Must wait for full output.After: Shim Streaming
Using the TypeScript SDK
For Node.js/TypeScript projects:Cost Comparison
OutputFixingParser
Shim Pro Tier
Confidence Scoring
Shim adds confidence levels that LangChain doesn’t provide:Error Handling
Before: Exceptions
After: Structured Errors
Migration Checklist
- Sign up at console.shim.so/signup
- Get API key from console
- Install
shim-sdk(if using TypeScript) - Replace
OutputFixingParserwith Shim API call - Add schema validation (optional)
- Implement confidence-based handling
- Add structured error handling
- Test with production traffic
- Remove LangChain parser dependencies
Hybrid Approach
Keep LangChain, add Shim as a repair layer:FAQ
Can I use Shim with LangChain?
Yes. Use Shim as a post-processing step after LLM output.Do I need to remove LangChain?
No. Shim complements LangChain. Replace only the parser.What about LCEL (LangChain Expression Language)?
Shim works with LCEL. Add it as a final step in the chain.Does Shim support Pydantic?
Shim uses JSON Schema. Convert Pydantic models withmodel.model_json_schema().
Can I use OutputFixingParser as a fallback?
Yes, but Shim is faster and cheaper. Fallback not needed.Next Steps
Quick Start
Get your first repair working
Schema Validation
Add JSON Schema validation
TypeScript SDK
Use the official SDK
Confidence Levels
Understand confidence scoring
