For AI agents: the complete documentation index is available at https://docs.flezise.com/llms.txt, the full documentation bundle is available at https://docs.flezise.com/llms-full.txt, and this page is available as Markdown at https://docs.flezise.com/administration/token-saving.md.

Token saving

Token Saving compresses prompt text inside the AI Gateway before it reaches providers. The pipeline runs entirely on the gateway side; models receive the compressed text, not the original.

::::note Read this if you administer the platform AI Gateway. Token Saving is a platform-scope setting that applies to all projects. ::::

Token Saving settings showing the Enable pipeline toggle, a Minimum size field, and three engine rows: Terminal noise stripping, Whitespace cleanup, and Filler-word condensation

Enable the pipeline

Open SettingsToken Saving ("Compress prompt text inside the gateway before it reaches providers.").

The Pipeline section has two controls:

ControlDescription
Enable pipelineWhen off, requests pass through untouched.
Minimum sizeSkip messages shorter than this many characters.

Turn the pipeline off to pass all prompts to providers without modification.

Configure engines

The Engines section runs three steps in order: noise stripping, then whitespace cleanup, then filler-word condensation.

EngineDefaultNotes
Terminal noise strippingOnRemoves terminal control sequences and ANSI codes
Whitespace cleanupOnCollapses redundant whitespace
Filler-word condensationOffMarked Lossy · opt-in; off by default for privacy and audit safety

::::warning Filler-word condensation rewrites prompt text. Enable it only when a lossy rewrite of prompt content is acceptable for your use case and audit requirements. ::::

Next steps

  • Guardrails: screen gateway traffic for PII, injections, and secrets
  • Request Tracing: inspect how compressed requests reached providers
  • AI providers: connect the providers that receive compressed prompts