You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Implement support for TOON to reduce token usage and inference costs #10773
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Hi OpenCode team 👋
First of all, great work on the project. We’ve been using OpenCode in real scenarios and it’s shaping up really nicely.
I’d like to propose adding support for TOON (Token Optimized Output Notation) as an optional output mode, with the explicit goal of reducing token usage and inference costs, especially in agent-based and iterative workflows.
Why TOON?
In many use cases (agents, tools, structured responses, follow-up calls), verbose natural language output is unnecessary and expensive. TOON allows the model to:
Produce highly compact, structured outputs
Minimize repetition and filler tokens
Improve latency and cost efficiency
Maintain semantic clarity while being machine-friendly
This is particularly valuable when:
Running multi-step agents
Chaining model calls
Operating under tight token or budget constraints
Using LLMs as reasoning engines rather than chat interfaces
Proposed Implementation
Some ideas on how this could be integrated (totally open to discussion):
Add a configurable output mode, e.g.:
outputFormat: "natural" | "toon"
Allow TOON to be enabled:
Per request
Per agent
Globally via config
Provide a minimal TOON schema or guideline so outputs stay predictable
Expected Benefits
📉 Lower token consumption
💸 Reduced inference costs
⚡ Faster responses
🤖 Better fit for agentic and automation-heavy workflows
Final Thoughts
This wouldn’t replace natural language outputs, but rather complement them for performance-critical paths. In my opinion, TOON support would be a strong differentiator for OpenCode compared to more chat-oriented tools.
#9018 is particularly relevant as it already includes TOON format as one of the planned compression technologies (35-50% reduction). You may want to coordinate with that implementation effort.
Feel free to ignore if none of these address your specific case.
Activity
github-actions commentedon Jan 27, 2026
This issue might be a duplicate of existing issues. Please check:
#9018 is particularly relevant as it already includes TOON format as one of the planned compression technologies (35-50% reduction). You may want to coordinate with that implementation effort.
Feel free to ignore if none of these address your specific case.
gitPhate commentedon Mar 28, 2026
@thdxr any plans on supporting this one?
github-actions commentedon Jul 6, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.