llmtrim_compress
Reduce token costs by compressing LLM request bodies. Provide raw request JSON to receive a compressed request in the same shape, along with token savings and stage-by-stage 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. |