You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5b87f2c
Browse filesBrowse the repository at this point in the historyBrowse files
feat(compaction): add configurable threshold and model (global + per-model)
Add compaction settings at both global and per-model levels:
- threshold: trigger compaction at a percentage of context (1-100, default: 100)
- model: use a different model for compaction summaries
This allows users to:
- Trigger compaction earlier for models that degrade at lower context usage
- Use cheaper/faster models for compaction to save costs
Closesanomalyco#11930
Relates to anomalyco#11314, anomalyco#8140, anomalyco#10017, anomalyco#8629
-`auto` - Automatically compact the session when context is full (default: `true`).
497
499
-`prune` - Remove old tool outputs to save tokens (default: `true`).
500
+
-`threshold` - Percentage of context usage that triggers compaction, from 1-100 (default: `100`). Lower values trigger compaction earlier, which can help maintain model performance in long sessions.
501
+
-`model` - Model to use for generating the compaction summary. Defaults to the session's current model.
502
+
503
+
You can also configure compaction per-model. This is useful when different models have different optimal context thresholds.
Copy file name to clipboardExpand all lines: packages/web/src/content/docs/models.mdx
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,29 @@ The built-in provider and model names can be found on [Models.dev](https://model
105
105
106
106
You can also configure these options for any agents that you are using. The agent config overrides any global options here. [Learn more](/docs/agents/#additional).
107
107
108
+
You can also configure per-model compaction settings. This is useful when different models perform better with earlier compaction thresholds.
-`compaction_threshold` - Percentage of context (1-100) that triggers compaction. Overrides the global setting.
127
+
-`compaction_model` - Model to use for compaction. Useful for using a cheaper/faster model.
128
+
129
+
[Learn more about compaction](/docs/config#compaction).
130
+
108
131
You can also define custom variants that extend built-in ones. Variants let you configure different settings for the same model without creating duplicate entries:
0 commit comments