topai_token_slimmer
Compress HTML, JSON, or plain-text payloads losslessly to cut LLM input tokens by 30% to 70% without losing meaning before sending large API responses, logs, or RAG chunks into a context window.
Instructions
Compresses bloated HTML, JSON, or plain-text payloads losslessly to reduce LLM input token consumption by 30% to 70% without losing semantic meaning. Use before sending large JSON API responses, logs, or RAG chunks into an LLM context window. Do not use for converting a live URL directly into Markdown (use topai_web_to_markdown instead) or for caching full prompt completions (use topai_semantic_cache instead). Stateless, read-only, idempotent compression.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Payload syntax format: 'html', 'json', or 'text' (default: 'text'). | |
| content | Yes | Raw HTML, JSON, or text payload string to compress for LLM context optimization. |