Availability
The Prompt Compressor is available from Tyk AI Studio 2.3.0.
Install the plugin, attach it to your LLMs, and measure the savings in
audit mode before you turn on enforce mode. For how the plugin compresses requests, refer to Prompt Compressor.
Install the Plugin
These steps install version 1.0.3 of the plugin. The marketplace ID iscom.tyk.prompt-compressor.
- In the admin console, go to Plugins > Marketplace.
- Find Prompt Compressor and install version 1.0.3.
- Approve the service scopes that the plugin requests. Refer to Service Scopes.
- Make sure that the plugin is active. The admin sidebar then shows a Prompt Compressor section with the Dashboard, Policies, and Preview pages.
Attach the Plugin to an LLM
The plugin compresses requests only to the LLMs that it is attached to.- Go to LLM management > LLM providers and edit the LLM.
- In the Plugins section, select Prompt Compressor.
- Save the LLM.
- Push the configuration to your Edge Gateways.

Measure the Savings in Audit Mode
A new installation starts inaudit mode with level 1 on tool outputs. In this mode, the plugin does not change the requests that go to the vendor.
- Send your usual traffic through the Edge Gateways for a few days.
- Go to Prompt Compressor > Dashboard and examine the projected savings and the cache-read share. Refer to Savings Dashboard.
- Go to Prompt Compressor > Preview and test your policies on real request bodies. Refer to Preview a Policy.
Configure Policies
- Go to Prompt Compressor > Policies.
- Edit the policies and the bindings.
- Select Save. The page validates the configuration before it saves it. It also tells you that a change causes one prompt cache miss for each affected session.
- Push the configuration to your Edge Gateways.

Preview a Policy
The Prompt Compressor > Preview page shows the result of a policy before you use it.- Go to Prompt Compressor > Preview.
- In the Input section, select the type of input:
- Tool output: Paste a tool output.
- Request body: Select the Vendor. Then paste a request body, or upload a JSON file.
- In the Policy section, select a policy in Saved policy. To try a change, select Edit a copy here (not saved) and edit the policy.
- Select Preview.
drop_tools removes or keeps. The preview uses the same compression as the Edge Gateway. It does not call an external engine, and AI Studio does not store the input.

Turn On Enforce Mode
- Go to Prompt Compressor > Policies.
- Set Mode to Enforce.
- Select Save.
- Push the configuration to your Edge Gateways. The Edge Gateways show the change as pending until the push.

enforce mode, use the level in audit mode first. Compare the dashboard with your own quality signals.