Automatic prompt compression keeps long conversations within model context limits without losing meaning.
Not yet available. Message transforms are on the roadmap.
Every model has a fixed context window. Once a conversation grows beyond that limit, the request would simply fail. Message transforms intercept the prompt before it reaches the model and intelligently compress it so the most important content fits — without your application needing to manage truncation logic.
When a request's token count exceeds a model's context window, OpenDunes applies a middle-out compression strategy before forwarding to the model:
The transformed prompt fits within the model's context window. The model never sees the overflowing original; your application receives a response as normal.
Transforms only activate when the raw token count exceeds the target model's context limit. For conversations that fit within context, the messages array is forwarded unchanged.
You can check whether transforms were applied on a given request in your dashboard — the activity log shows both the raw input token count and the effective token count sent to the model.
| Content | Behavior |
|---|---|
| System prompt | Always kept in full |
| Recent user and assistant turns | Always kept in full |
| Older conversational turns | Summarised or pruned |
| Tool call + result pairs | Pruned if no longer referenced in recent context |
| Images in older turns | Dropped (text descriptions retained if available) |
If your application manages context manually and you never want transforms applied, pass:
With an empty transforms array, requests that exceed the model's context window will return a 400 invalid_request error with code context_length_exceeded rather than being silently compressed.
system or user message that summarises prior context. This gives the compressor a clean, dense anchor point.