Skip to content

Commit c647519

Browse files
committed
Add options for context compaction
1 parent 7ec7f48 commit c647519

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

aider/website/docs/config/aider_conf.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,18 @@ cog.outl("```")
173173
## Soft limit on tokens for chat history, after which summarization begins. If unspecified, defaults to the model's max_chat_history_tokens.
174174
#max-chat-history-tokens: xxx
175175
176+
######################
177+
# Context Compaction:
178+
179+
## Enable automatic compaction of chat history to conserve tokens (default: False)
180+
#enable-context-compaction: false
181+
182+
## The maximum number of tokens in the conversation before context compaction is triggered. (default: 80% of model's context window)
183+
#context-compaction-max-tokens: xxx
184+
185+
## The target maximum number of tokens for the generated summary. (default: 4096)
186+
#context-compaction-summary-tokens: 4096
187+
176188
#################
177189
# Cache settings:
178190

aider/website/docs/config/options.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ usage: aider [-h] [--model] [--openai-api-key] [--anthropic-api-key]
3535
[--show-model-warnings | --no-show-model-warnings]
3636
[--check-model-accepts-settings | --no-check-model-accepts-settings]
3737
[--max-chat-history-tokens]
38+
[--enable-context-compaction | --no-enable-context-compaction]
39+
[--context-compaction-max-tokens]
40+
[--context-compaction-summary-tokens]
3841
[--cache-prompts | --no-cache-prompts]
3942
[--cache-keepalive-pings] [--map-tokens]
4043
[--map-refresh] [--map-multiplier-no-files]
@@ -241,6 +244,25 @@ Aliases:
241244
Soft limit on tokens for chat history, after which summarization begins. If unspecified, defaults to the model's max_chat_history_tokens.
242245
Environment variable: `AIDER_MAX_CHAT_HISTORY_TOKENS`
243246

247+
## Context Compaction:
248+
249+
### `--enable-context-compaction`
250+
Enable automatic compaction of chat history to conserve tokens (default: False)
251+
Default: False
252+
Environment variable: `AIDER_ENABLE_CONTEXT_COMPACTION`
253+
Aliases:
254+
- `--enable-context-compaction`
255+
- `--no-enable-context-compaction`
256+
257+
### `--context-compaction-max-tokens VALUE`
258+
The maximum number of tokens in the conversation before context compaction is triggered. (default: 80% of model's context window)
259+
Environment variable: `AIDER_CONTEXT_COMPACTION_MAX_TOKENS`
260+
261+
### `--context-compaction-summary-tokens VALUE`
262+
The target maximum number of tokens for the generated summary. (default: 4096)
263+
Default: 4096
264+
Environment variable: `AIDER_CONTEXT_COMPACTION_SUMMARY_TOKENS`
265+
244266
## Cache settings:
245267

246268
### `--cache-prompts`

0 commit comments

Comments
 (0)