llmtrim_compress
Compresses LLM request bodies to reduce token usage, returning token counts and savings breakdown.
Instructions
Compress an LLM request body and report the token savings. Pass the raw request JSON; get back the compressed request in the same shape plus before/after token counts and the per-stage breakdown.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes | The provider request body (OpenAI, Anthropic, or Google shape). Accepts either the JSON object itself or a JSON string of it; the whole body is compressed and returned in the same shape. | |
| provider | No | Provider hint: `openai`, `anthropic`, or `google`. Leave unset to detect it from the request shape. |