Token Saving
Reduce prompt and agent-context token usage across LLM Gateway and MCP Gateway.
Token saving lets QuilrAI rewrite high-overhead input text before it is sent into an AI context. The same transform names are used across gateway settings, logs, and analytics, so teams can enable the same optimization strategy for direct LLM calls and MCP tool output.
Where It Applies
Shared Methods
Config Shape
When all toggles are off, the token-saving config is equivalent to:
{
"smart_json_compression": false,
"html_to_text": false,
"markdown_to_text": false,
"text_compression": false
}
Turn on only the methods that match your traffic. For example, a retrieval app that sends JSON search results and Markdown snippets can enable smart_json_compression and markdown_to_text without enabling every transform.
What Stays Unchanged
- Application and agent SDK code stays the same.
- LLM Gateway responses are not compressed on the way back to the application.
- MCP Gateway preserves non-text structured content unless a separate security guardrail redacts it.
- Token-saving logs report saved tokens by method, so admins can measure the effect before broad rollout.