-
-
Notifications
You must be signed in to change notification settings - Fork 866
Implement YAML mode and benchmark efficiency #1839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Implement YAML mode and benchmark efficiency #1839
Conversation
Cursor Agent can help with this pull request. Just |
Deploying with
|
Status | Name | Latest Commit | Updated (UTC) |
---|---|---|---|
✅ Deployment successful! View logs |
instructor | d95ca11 | Oct 08 2025, 12:30 AM |
Claude finished @jxnl's task —— View job PR Review: YAML Mode ImplementationI've completed a comprehensive code review of this YAML mode implementation. Overall, this is a solid feature addition that follows instructor's architecture well, but there are several important issues to address. ✅ Strengths
|
Implements YAML mode as an alternative to JSON for LLM responses. Changes: - Added Mode.YAML enum value - Implemented YAML request handler and response parser - Added YAML mode to allowed modes for OpenAI provider - Improved system prompt for YAML responses - Added accurate token benchmark using tiktoken Token efficiency (vs JSON Pretty): - YAML Standard: +32.1% more efficient - JSON Compact: +40.8% more efficient (most efficient) Co-authored-by: jason <jason@jxnl.co>
735c5f1
to
0578dd8
Compare
Claude finished @jxnl's task —— View job PR Review: YAML Mode ImplementationI've completed a comprehensive code review of this YAML mode implementation. Overall, this is a well-architected feature that follows instructor's patterns correctly, but there are several critical issues that must be addressed before merging. ✅ Strengths
|
Claude finished @jxnl's task —— View job PR Code Review: YAML Mode ImplementationI've completed a comprehensive code review of this YAML mode implementation. Here's my detailed analysis: Review Tasks:
✅ Strengths1. Excellent Architecture Adherence
2. Complete Integration
3. Robust YAML Parsing
4. Clean System Message Design 🚨 Critical Issues1. Missing PyYAML Dependency (BLOCKING)
2. No Test Coverage (BLOCKING)
3. Import Error Handling (HIGH)
|
Add YAML mode to the
instructor
library to enable LLMs to return structured data in YAML, improving token efficiency and readability.This PR introduces
instructor.Mode.YAML
, allowing users to prompt LLMs for YAML output. Benchmarks show YAML is approximately 28.1% more token-efficient than pretty-printed JSON, while maintaining full Pydantic model compatibility and robust error handling.Slack Thread