-
Notifications
You must be signed in to change notification settings - Fork 415
Expand file tree
/
Copy pathcompaction_model.yaml
More file actions
45 lines (43 loc) · 1.97 KB
/
Copy pathcompaction_model.yaml
File metadata and controls
45 lines (43 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Compaction Model Example
#
# This example demonstrates how a model can delegate session compaction
# (summary generation) to another, cheaper/faster model via the
# `compaction_model` field.
#
# When a session is compacted (manual `/compact`, the proactive ~90% threshold
# trigger, or post-overflow recovery), the whole conversation is fed to a model
# to be summarized. That summary call is the slowest and most expensive call in
# a session, and it only runs when the context is already large. There is no
# need to spend a heavyweight reasoning model on it: point the primary model's
# `compaction_model` at a small model and docker-agent will use it for the
# summary call only. Everything else still runs on the primary model. When
# `compaction_model` is omitted, compaction reuses the agent's own model.
#
# The field can also be set directly on an agent. A `compaction_model` set on
# the agent's model takes precedence over the agent-level value.
#
# Note: if the compaction model has a SMALLER context window than the primary,
# docker-agent triggers compaction against the smaller window so the summary
# call can always ingest the conversation it must compact. Pair the primary
# with a compaction model whose context window is at least as large to keep the
# proactive trigger aligned with the primary's window.
models:
primary:
provider: anthropic
model: claude-sonnet-4-5
# Summarize the conversation with the cheaper Haiku model instead of Sonnet.
compaction_model: fast
fast:
provider: anthropic
model: claude-haiku-4-5
agents:
root:
model: primary
description: An assistant that compacts its sessions with a cheaper model.
instruction: You are a helpful assistant.
reviewer:
model: anthropic/claude-sonnet-4-5
description: An assistant configuring its compaction model at the agent level.
instruction: You are a helpful code reviewer.
# Agent-level alternative: same effect as setting it on the primary model.
compaction_model: fast