compactlab 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- compactlab/__init__.py +3 -0
- compactlab/adapters/__init__.py +2 -0
- compactlab/adapters/base.py +212 -0
- compactlab/adapters/cache.py +396 -0
- compactlab/adapters/claude_code.py +226 -0
- compactlab/adapters/codex.py +298 -0
- compactlab/adapters/dsh.py +287 -0
- compactlab/adapters/gemini_cli.py +259 -0
- compactlab/adapters/opencode.py +375 -0
- compactlab/apply/__init__.py +582 -0
- compactlab/cli/__init__.py +5 -0
- compactlab/cli/main.py +2436 -0
- compactlab/data/config_knobs.json +158 -0
- compactlab/data/harness_defaults.json +72 -0
- compactlab/data/harness_formats.json +300 -0
- compactlab/data/pricing.json +51 -0
- compactlab/engine/__init__.py +138 -0
- compactlab/engine/live.py +306 -0
- compactlab/engine/settings.py +175 -0
- compactlab/engine/watch.py +82 -0
- compactlab/eval/__init__.py +1 -0
- compactlab/eval/deep.py +390 -0
- compactlab/eval/executors.py +84 -0
- compactlab/eval/factcheck.py +75 -0
- compactlab/lens.py +80 -0
- compactlab/model/__init__.py +285 -0
- compactlab/pricing/__init__.py +211 -0
- compactlab/pricing/auto.py +118 -0
- compactlab/pricing/ids.py +148 -0
- compactlab/pricing/refresh.py +299 -0
- compactlab/publish.py +125 -0
- compactlab/py.typed +0 -0
- compactlab/recommend/__init__.py +201 -0
- compactlab/recommend/claude_code.py +172 -0
- compactlab/recommend/codex.py +104 -0
- compactlab/recommend/dsh.py +89 -0
- compactlab/recommend/gemini_cli.py +85 -0
- compactlab/recommend/opencode.py +117 -0
- compactlab/recommend/units.py +63 -0
- compactlab/report/__init__.py +3 -0
- compactlab/report/html.py +27 -0
- compactlab/report/template.html +1189 -0
- compactlab/service/__init__.py +1 -0
- compactlab/service/core.py +220 -0
- compactlab/service/http.py +133 -0
- compactlab/service/lock.py +92 -0
- compactlab/service/policy.py +258 -0
- compactlab/service/schedule.py +212 -0
- compactlab/share.py +553 -0
- compactlab/sim/__init__.py +1 -0
- compactlab/sim/baseline.py +214 -0
- compactlab/sim/calibrate.py +108 -0
- compactlab/sim/engine.py +1130 -0
- compactlab/sim/select.py +238 -0
- compactlab/sim/timing.py +134 -0
- compactlab/synth.py +416 -0
- compactlab/term/__init__.py +0 -0
- compactlab/term/style.py +134 -0
- compactlab/term/top.py +531 -0
- compactlab/term/views.py +598 -0
- compactlab/term/widgets.py +238 -0
- compactlab/verify.py +462 -0
- compactlab-0.2.0.dist-info/METADATA +243 -0
- compactlab-0.2.0.dist-info/RECORD +67 -0
- compactlab-0.2.0.dist-info/WHEEL +4 -0
- compactlab-0.2.0.dist-info/entry_points.txt +2 -0
- compactlab-0.2.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"verified_on": "2026-10-29",
|
|
4
|
+
"status_legend": {
|
|
5
|
+
"documented": "stated in the vendor's current docs",
|
|
6
|
+
"public-source": "read from the vendor's open-source code",
|
|
7
|
+
"unverified": "the mechanism exists but the docs do not say this key works there; emitted with a warning"
|
|
8
|
+
},
|
|
9
|
+
"knobs": {
|
|
10
|
+
"claude.settings.modelSettings.autoCompactWindow": {
|
|
11
|
+
"harness": "claude-code", "where": "settings.json: modelSettings.<model>.autoCompactWindow",
|
|
12
|
+
"values": "integer 100000..1000000 or \"auto\"; capped at the model's window", "min_version": "2.1.288",
|
|
13
|
+
"scopes": ["~/.claude/settings.json", ".claude/settings.json", ".claude/settings.local.json"],
|
|
14
|
+
"note": "Per model; wins over top-level autoCompactWindow in the same file. Keyed by canonical name (e.g. claude-opus-5-5), which also matches its alias, date-suffixed, [1m] and recognized provider-specific IDs.",
|
|
15
|
+
"status": "documented", "source": "https://code.claude.com/docs/en/settings-reference#modelsettings", "verified_on": "2026-10-29"
|
|
16
|
+
},
|
|
17
|
+
"claude.settings.autoCompactWindow": {
|
|
18
|
+
"harness": "claude-code", "where": "settings.json: autoCompactWindow (top level)",
|
|
19
|
+
"values": "integer 100000..1000000; capped at the model's window", "min_version": "",
|
|
20
|
+
"note": "Applies to every model in that file unless modelSettings sets one.",
|
|
21
|
+
"status": "documented", "source": "https://code.claude.com/docs/en/settings-reference#autocompactwindow", "verified_on": "2026-10-29"
|
|
22
|
+
},
|
|
23
|
+
"claude.agent.autoCompactWindow": {
|
|
24
|
+
"harness": "claude-code", "where": "subagent frontmatter in ~/.claude/agents/*.md or .claude/agents/*.md",
|
|
25
|
+
"values": "integer 100000..1000000 (plain integer)", "min_version": "2.1.296",
|
|
26
|
+
"note": "Lowers the window for that subagent. A subagent's window is sized by its own model.",
|
|
27
|
+
"status": "documented", "source": "https://code.claude.com/docs/en/sub-agents", "verified_on": "2026-10-29"
|
|
28
|
+
},
|
|
29
|
+
"claude.env.CLAUDE_CODE_AUTO_COMPACT_WINDOW": {
|
|
30
|
+
"harness": "claude-code", "where": "environment variable",
|
|
31
|
+
"values": "token count 100000..1000000 (k/M suffix needs v2.1.304+; a bare 200 means 200 tokens)", "min_version": "",
|
|
32
|
+
"note": "Takes precedence over --autocompact, /autocompact and autoCompactWindow; applies to every model in the session.",
|
|
33
|
+
"status": "documented", "source": "https://code.claude.com/docs/en/model-config#set-the-auto-compact-window", "verified_on": "2026-10-29"
|
|
34
|
+
},
|
|
35
|
+
"claude.flag.--autocompact": {
|
|
36
|
+
"harness": "claude-code", "where": "claude --autocompact <value>",
|
|
37
|
+
"values": "100K..1M as 200000, 500k, 1M, or 100..1000 meaning thousands; or auto", "min_version": "",
|
|
38
|
+
"note": "One launch only; overrides saved settings, not the env var.",
|
|
39
|
+
"status": "documented", "source": "https://code.claude.com/docs/en/model-config#set-the-auto-compact-window", "verified_on": "2026-10-29"
|
|
40
|
+
},
|
|
41
|
+
"claude.settings.idleCompaction": {
|
|
42
|
+
"harness": "claude-code", "where": "settings.json: idleCompaction (top level)",
|
|
43
|
+
"values": "false turns idle compaction off; on when unset", "min_version": "2.1.290",
|
|
44
|
+
"scopes": ["~/.claude/settings.json", ".claude/settings.json", ".claude/settings.local.json"],
|
|
45
|
+
"note": "Summarizes a long conversation left idle on the one-hour cache before that cache expires, and applies the summary when you return. Global, not per model.",
|
|
46
|
+
"status": "documented", "source": "https://code.claude.com/docs/en/prompt-caching", "verified_on": "2026-11-23"
|
|
47
|
+
},
|
|
48
|
+
"claude.env.CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS": {
|
|
49
|
+
"harness": "claude-code", "where": "environment variable (or the env block of settings.json)",
|
|
50
|
+
"values": "token count; default 200000; values below 100000 count as 100000", "min_version": "2.1.290",
|
|
51
|
+
"note": "Smallest context idle compaction acts on. compactlab reads it; it does not recommend a value.",
|
|
52
|
+
"status": "documented", "source": "https://code.claude.com/docs/en/env-vars", "verified_on": "2026-11-23"
|
|
53
|
+
},
|
|
54
|
+
"claude.env.CLAUDE_CODE_MAX_CONTEXT_TOKENS": {
|
|
55
|
+
"harness": "claude-code", "where": "environment variable",
|
|
56
|
+
"values": "context window in tokens", "min_version": "2.1.193",
|
|
57
|
+
"note": "For gateway or custom model IDs Claude Code does not recognize (it assumes 200K for them).",
|
|
58
|
+
"status": "documented", "source": "https://code.claude.com/docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id", "verified_on": "2026-10-29"
|
|
59
|
+
},
|
|
60
|
+
"codex.config.model_auto_compact_token_limit": {
|
|
61
|
+
"harness": "codex", "where": "config.toml top level",
|
|
62
|
+
"values": "number of tokens; unset = model default (90% of the context window); configured values are clamped to that 90%", "min_version": "",
|
|
63
|
+
"scopes": ["~/.codex/config.toml", ".codex/config.toml (trusted projects only)"],
|
|
64
|
+
"note": "Global for the session's model; there is no per-model table.",
|
|
65
|
+
"status": "documented", "source": "https://learn.chatgpt.com/docs/config-file/config-reference", "verified_on": "2026-10-29"
|
|
66
|
+
},
|
|
67
|
+
"codex.config.model_auto_compact_token_limit_scope": {
|
|
68
|
+
"harness": "codex", "where": "config.toml top level", "values": "total (default) | body_after_prefix", "min_version": "",
|
|
69
|
+
"note": "compactlab's numbers assume `total` (full active context).",
|
|
70
|
+
"status": "documented", "source": "https://learn.chatgpt.com/docs/config-file/config-reference", "verified_on": "2026-10-29"
|
|
71
|
+
},
|
|
72
|
+
"codex.flag.-c": {
|
|
73
|
+
"harness": "codex", "where": "codex -c key=value (or --config)", "values": "TOML value", "min_version": "",
|
|
74
|
+
"note": "One run; highest precedence above profiles, project and user config.",
|
|
75
|
+
"status": "documented", "source": "https://developers.openai.com/codex/config-advanced", "verified_on": "2026-10-29"
|
|
76
|
+
},
|
|
77
|
+
"codex.profile.model_auto_compact_token_limit": {
|
|
78
|
+
"harness": "codex", "where": "$CODEX_HOME/<profile>.config.toml, selected with --profile <profile>", "values": "as config.toml", "min_version": "",
|
|
79
|
+
"note": "Profile files exist, but the docs do not list which keys they may set.",
|
|
80
|
+
"status": "unverified", "source": "https://learn.chatgpt.com/docs/config-file/config-reference", "verified_on": "2026-10-29"
|
|
81
|
+
},
|
|
82
|
+
"codex.agent.model_auto_compact_token_limit": {
|
|
83
|
+
"harness": "codex", "where": "agents.<name>.config_file = \"<role>.toml\" (a config layer for that role)", "values": "as config.toml", "min_version": "",
|
|
84
|
+
"note": "The role config layer exists; the docs do not say compaction keys are honoured in it.",
|
|
85
|
+
"status": "unverified", "source": "https://learn.chatgpt.com/docs/config-file/config-reference", "verified_on": "2026-10-29"
|
|
86
|
+
},
|
|
87
|
+
"codex.env": {
|
|
88
|
+
"harness": "codex", "where": "environment variable", "values": "", "min_version": "",
|
|
89
|
+
"note": "No documented environment variable sets the auto-compact limit.", "status": "none",
|
|
90
|
+
"source": "https://learn.chatgpt.com/docs/config-file/config-reference", "verified_on": "2026-10-29"
|
|
91
|
+
},
|
|
92
|
+
"dsh.plugin.compaction-basic.modelPolicies": {
|
|
93
|
+
"harness": "dsh", "where": "config of the @deepseek-ai/dsh-compaction-basic plugin (Cordis YAML)",
|
|
94
|
+
"values": "thresholdRatio: fraction of the context window (default 0.8, must exceed retainRatio 0.16); headroomTokens: tokens kept free beyond the output reserve (default 65536); trigger = min(window x thresholdRatio, window - reserved output - headroomTokens); modelPolicies[] overrides per exact provider/model",
|
|
95
|
+
"min_version": "",
|
|
96
|
+
"scopes": ["dsh profile / cordis.yml (location not verified)"],
|
|
97
|
+
"note": "Experimental: the keys come from dsh's published config catalog, but where a user's plugin config lives was not verified; check that the plugin loads after editing.",
|
|
98
|
+
"status": "documented",
|
|
99
|
+
"source": "https://github.com/deepseek-ai/deepseek-harness/blob/main/docs/config-catalog.md#deepseek-aidsh-compaction-basic",
|
|
100
|
+
"verified_on": "2026-10-29"
|
|
101
|
+
},
|
|
102
|
+
"opencode.config.provider.models.limit": {
|
|
103
|
+
"harness": "opencode", "where": "opencode.json: provider.<providerID>.models.<modelID>.limit {context, input, output}",
|
|
104
|
+
"values": "token counts; context and output are required when limit is set. OpenCode 1.x compacts at limit.input - compaction.reserved (reserved default min(20000, max output)) when input is set, else at context - min(output, 32000)",
|
|
105
|
+
"min_version": "",
|
|
106
|
+
"scopes": ["~/.config/opencode/opencode.json", "opencode.json in the project root", "$OPENCODE_CONFIG"],
|
|
107
|
+
"note": "Per model. Setting limit replaces the catalog's limits for that model, so context and output must be the model's real values; an output above 32,000 changes nothing (OpenCode caps it).",
|
|
108
|
+
"status": "public-source",
|
|
109
|
+
"source": "https://github.com/anomalyco/opencode/blob/v1.19.6/packages/core/src/v1/config/provider.ts (limit); packages/opencode/src/session/overflow.ts",
|
|
110
|
+
"verified_on": "2026-11-23"
|
|
111
|
+
},
|
|
112
|
+
"opencode.config.compaction.reserved": {
|
|
113
|
+
"harness": "opencode", "where": "opencode.json: compaction.reserved",
|
|
114
|
+
"values": "tokens kept free below limit.input (default min(20000, the model's max output))",
|
|
115
|
+
"min_version": "",
|
|
116
|
+
"scopes": ["~/.config/opencode/opencode.json", "opencode.json in the project root"],
|
|
117
|
+
"note": "OpenCode 1.x applies it only to models whose limit sets input; for every other model the trigger is context - max output and this key has no effect. Global: one value for every model.",
|
|
118
|
+
"status": "public-source",
|
|
119
|
+
"source": "https://github.com/anomalyco/opencode/blob/v1.19.6/packages/core/src/v1/config/config.ts (compaction); packages/opencode/src/session/overflow.ts",
|
|
120
|
+
"verified_on": "2026-11-23"
|
|
121
|
+
},
|
|
122
|
+
"opencode.config.compaction.buffer": {
|
|
123
|
+
"harness": "opencode", "where": "opencode.json: compaction.buffer (OpenCode 2.x)",
|
|
124
|
+
"values": "\"1%\"..\"99%\" of the window (decimals allowed) or a token count; default \"15%\", at least 16k",
|
|
125
|
+
"min_version": "2.x (pre-release)",
|
|
126
|
+
"scopes": ["~/.config/opencode/opencode.json", "opencode.json in the project root"],
|
|
127
|
+
"note": "Room kept free: \"20%\" compacts at 80% full. Global for every model. Not in OpenCode 1.x.",
|
|
128
|
+
"status": "documented",
|
|
129
|
+
"source": "https://github.com/anomalyco/opencode/blob/dev/services/site/src/docs/content/compaction.mdx; packages/schema/src/config/compaction.ts",
|
|
130
|
+
"verified_on": "2026-11-23"
|
|
131
|
+
},
|
|
132
|
+
"gemini.settings.model.compressionThreshold": {
|
|
133
|
+
"harness": "gemini-cli", "where": "settings.json: model.compressionThreshold",
|
|
134
|
+
"values": "fraction of the model's token limit (default 0.5); compared with the last request's prompt tokens",
|
|
135
|
+
"min_version": "",
|
|
136
|
+
"scopes": ["~/.gemini/settings.json", "<project>/.gemini/settings.json", "system settings (/Library/Application Support/GeminiCli/settings.json) override both"],
|
|
137
|
+
"note": "Global: one fraction for every model. Requires a restart. If unset, a remote experiment flag can set a different value.",
|
|
138
|
+
"status": "documented",
|
|
139
|
+
"source": "https://github.com/google-gemini/gemini-cli/blob/v0.70.0/docs/reference/configuration.md (model.compressionThreshold; settings precedence)",
|
|
140
|
+
"verified_on": "2026-11-23"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"providers": {
|
|
144
|
+
"claude-code": {
|
|
145
|
+
"anthropic": "Anthropic API: use the canonical model name as the modelSettings key.",
|
|
146
|
+
"bedrock": "Amazon Bedrock: model IDs differ (e.g. regional inference profile IDs); recognized provider IDs match the canonical modelSettings entry. Check /model shows a recognized model and the expected window.",
|
|
147
|
+
"vertex": "Google Cloud Agent Platform (Vertex): IDs may carry an @date suffix, which Claude Code strips; same canonical modelSettings entry.",
|
|
148
|
+
"foundry": "Microsoft Foundry: as above, provided Claude Code recognizes the model ID.",
|
|
149
|
+
"gateway": "LLM gateway / custom ANTHROPIC_BASE_URL alias: Claude Code may not recognize the ID and assumes a 200K window. Map it with modelOverrides, append [1m] for 1M models, or set CLAUDE_CODE_MAX_CONTEXT_TOKENS; otherwise the threshold is capped at 200K."
|
|
150
|
+
},
|
|
151
|
+
"codex": {
|
|
152
|
+
"openai": "OpenAI (default provider): the limit is clamped to 90% of the model's context window.",
|
|
153
|
+
"amazon-bedrock": "Built-in Bedrock provider (model_providers.amazon-bedrock): window depends on the model; set model_context_window if Codex does not know it.",
|
|
154
|
+
"ollama / lmstudio": "Local OSS providers: windows are often much smaller; the recommendation is clamped to 90% of the window seen in your logs.",
|
|
155
|
+
"custom": "Custom model_providers.<id>: set model_context_window so the 90% clamp uses the right window."
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"updated": "2026-11-23",
|
|
4
|
+
"claude-code": {
|
|
5
|
+
"rules": [
|
|
6
|
+
{
|
|
7
|
+
"match": [
|
|
8
|
+
"opus-4-6",
|
|
9
|
+
"sonnet-4-6"
|
|
10
|
+
],
|
|
11
|
+
"threshold": 200000,
|
|
12
|
+
"note": "Sonnet 4.6 / Opus 4.6 without extended context compact at the 200K boundary (with [1m] they use the 1M rule)",
|
|
13
|
+
"note_zh": "Sonnet 4.6 / Opus 4.6 未开扩展上下文时在 200K 边界压缩(带 [1m] 时按 1M 规则)"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"match": [
|
|
17
|
+
"fable",
|
|
18
|
+
"sonnet-5",
|
|
19
|
+
"haiku-5-5",
|
|
20
|
+
"opus-4-7",
|
|
21
|
+
"opus-4-8",
|
|
22
|
+
"opus-5"
|
|
23
|
+
],
|
|
24
|
+
"threshold": 967000,
|
|
25
|
+
"note": "models with a native 1M window compact at about 967K tokens by default (a Claude model not in this list counts when its window is 1M)",
|
|
26
|
+
"note_zh": "原生 1M 窗口的模型默认在约 967K token 时压缩(不在列表里的 Claude 模型按窗口判断)",
|
|
27
|
+
"min_window": 1000000
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"otherwise": "window",
|
|
31
|
+
"otherwise_note": "other models compact when the conversation reaches the model's context limit",
|
|
32
|
+
"caveats": "CLAUDE_CODE_DISABLE_1M_CONTEXT=1 makes 1M models compact at 200K; cloud sessions compact as they approach the limit; unrecognized model IDs assume 200K.",
|
|
33
|
+
"source": "https://code.claude.com/docs/en/model-config#default-auto-compact-thresholds",
|
|
34
|
+
"status": "documented",
|
|
35
|
+
"otherwise_note_zh": "其他模型在对话达到模型上下文上限时压缩"
|
|
36
|
+
},
|
|
37
|
+
"codex": {
|
|
38
|
+
"rule": "fraction_of_window",
|
|
39
|
+
"fraction": 0.9,
|
|
40
|
+
"note": "with model_auto_compact_token_limit unset, the limit is 90% of the resolved context window; a configured value is clamped to that 90%",
|
|
41
|
+
"source": "https://github.com/openai/codex/blob/main/codex-rs/protocol/src/openai_models.rs (ModelInfo::auto_compact_token_limit)",
|
|
42
|
+
"status": "public-source",
|
|
43
|
+
"note_zh": "未设置 model_auto_compact_token_limit 时,上限为上下文窗口的 90%;设置的值也会被截到这 90%"
|
|
44
|
+
},
|
|
45
|
+
"dsh": {
|
|
46
|
+
"rule": "pressure",
|
|
47
|
+
"threshold_ratio": 0.8,
|
|
48
|
+
"headroom_tokens": 65536,
|
|
49
|
+
"reserved_output": 256000,
|
|
50
|
+
"note": "dsh-compaction-basic compacts at min(80% of the window, window - reserved output (256k) - headroom (65,536)): about 678k on a 1,000,000 window, 727k on 1,048,576",
|
|
51
|
+
"note_zh": "dsh-compaction-basic 在「窗口×80%」与「窗口 − 预留输出(256k) − 余量(65,536)」中较小者处压缩:100 万窗口约 678k,1,048,576 窗口约 727k",
|
|
52
|
+
"source": "https://github.com/deepseek-ai/deepseek-harness/blob/main/packages/compaction/compaction-basic/src/config.ts (resolveConfig, resolveCompactSpec); packages/llm/llm-deepseek/src/defaults.ts (DEFAULT_MAX_TOKENS)",
|
|
53
|
+
"status": "public-source"
|
|
54
|
+
},
|
|
55
|
+
"opencode": {
|
|
56
|
+
"rule": "window_minus_output",
|
|
57
|
+
"output_reserve": 32000,
|
|
58
|
+
"reserved_default": 20000,
|
|
59
|
+
"note": "OpenCode 1.x compacts once a reply's tokens (its context plus its output) reach the window minus the model's output reserve (its max output, capped at 32,000): about window - 32k. A model with limit.input uses limit.input - compaction.reserved (default 20,000) instead; a custom model with no known window never compacts automatically.",
|
|
60
|
+
"note_zh": "OpenCode 1.x 在一次回复的 token(上下文加该回复的输出)达到「窗口 − 模型输出预留(最大输出,上限 32,000)」时压缩,约为窗口 − 32k。设置了 limit.input 的模型改用 limit.input − compaction.reserved(默认 20,000);没有已知窗口的自定义模型不会自动压缩。",
|
|
61
|
+
"source": "https://github.com/anomalyco/opencode/blob/v1.19.6/packages/opencode/src/session/overflow.ts (usable, isOverflow); packages/opencode/src/provider/transform.ts (OUTPUT_TOKEN_MAX, maxOutputTokens)",
|
|
62
|
+
"status": "public-source"
|
|
63
|
+
},
|
|
64
|
+
"gemini-cli": {
|
|
65
|
+
"rule": "fraction_of_window",
|
|
66
|
+
"fraction": 0.5,
|
|
67
|
+
"note": "Gemini CLI compresses when the last request's prompt tokens reach model.compressionThreshold (default 0.5) of the model's token limit (1,048,576 for Gemini models): about 524k.",
|
|
68
|
+
"note_zh": "Gemini CLI 在上一次请求的提示 token 达到模型上限(Gemini 模型为 1,048,576)的 model.compressionThreshold(默认 0.5)时压缩,约 524k。",
|
|
69
|
+
"source": "https://github.com/google-gemini/gemini-cli/blob/v0.70.0/packages/core/src/context/chatCompressionService.ts (DEFAULT_COMPRESSION_TOKEN_THRESHOLD); packages/core/src/core/tokenLimits.ts",
|
|
70
|
+
"status": "public-source"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"updated": "2026-11-23",
|
|
4
|
+
"status_legend": {
|
|
5
|
+
"documented": "stated in the vendor's public docs",
|
|
6
|
+
"public-tool": "relied on by a public open-source parser (CodexBar, ccusage); not checked against vendor docs",
|
|
7
|
+
"assumed": "compactlab's own reading; needs verification against real files with the user's approval",
|
|
8
|
+
"public-source": "read from the harness's own open-source code, docs or test snapshots; not yet checked against a user's real logs"
|
|
9
|
+
},
|
|
10
|
+
"harnesses": {
|
|
11
|
+
"claude-code": {
|
|
12
|
+
"log_roots": {
|
|
13
|
+
"value": [
|
|
14
|
+
"$CLAUDE_CONFIG_DIR/projects (comma-separated)",
|
|
15
|
+
"~/.claude/projects",
|
|
16
|
+
"~/.config/claude/projects"
|
|
17
|
+
],
|
|
18
|
+
"status": "public-tool",
|
|
19
|
+
"source": "https://github.com/ryoppippi/ccusage"
|
|
20
|
+
},
|
|
21
|
+
"config_dir_env": {
|
|
22
|
+
"value": "CLAUDE_CONFIG_DIR",
|
|
23
|
+
"status": "documented",
|
|
24
|
+
"source": "https://code.claude.com/docs/en/settings"
|
|
25
|
+
},
|
|
26
|
+
"subagent_files": {
|
|
27
|
+
"value": "files under a subagents/ directory",
|
|
28
|
+
"status": "public-tool",
|
|
29
|
+
"source": "https://github.com/steipete/CodexBar"
|
|
30
|
+
},
|
|
31
|
+
"usage_fields": {
|
|
32
|
+
"value": "message.usage.{input_tokens, cache_read_input_tokens, cache_creation_input_tokens, output_tokens} on assistant lines",
|
|
33
|
+
"status": "public-tool",
|
|
34
|
+
"source": "https://github.com/ryoppippi/ccusage"
|
|
35
|
+
},
|
|
36
|
+
"dedupe": {
|
|
37
|
+
"value": "streamed responses repeat; key = message.id + requestId",
|
|
38
|
+
"status": "public-tool",
|
|
39
|
+
"source": "https://github.com/ryoppippi/ccusage"
|
|
40
|
+
},
|
|
41
|
+
"compact_boundary": {
|
|
42
|
+
"value": "type=system, subtype=compact_boundary, compactMetadata.preTokens; next user line isCompactSummary=true holds the summary",
|
|
43
|
+
"status": "assumed",
|
|
44
|
+
"source": ""
|
|
45
|
+
},
|
|
46
|
+
"parent_session": {
|
|
47
|
+
"value": "parentSessionId on lines of resumed/forked sessions",
|
|
48
|
+
"status": "assumed",
|
|
49
|
+
"source": ""
|
|
50
|
+
},
|
|
51
|
+
"compact_setting": {
|
|
52
|
+
"value": "modelSettings.<model>.autoCompactWindow: 100000..1000000 or \"auto\"; top-level autoCompactWindow; v2.1.288+",
|
|
53
|
+
"status": "documented",
|
|
54
|
+
"source": "https://code.claude.com/docs/en/settings-reference"
|
|
55
|
+
},
|
|
56
|
+
"latency_proxy": {
|
|
57
|
+
"value": "turn latency = assistant line timestamp minus the last user/tool_result line timestamp; the first content block of a streamed response is kept",
|
|
58
|
+
"status": "assumed",
|
|
59
|
+
"source": ""
|
|
60
|
+
},
|
|
61
|
+
"compaction_latency_proxy": {
|
|
62
|
+
"value": "compactMetadata.durationMs when present, else the compact_boundary timestamp minus the last input line before it; idle compactions have no wait",
|
|
63
|
+
"status": "assumed",
|
|
64
|
+
"source": ""
|
|
65
|
+
},
|
|
66
|
+
"idle_compaction": {
|
|
67
|
+
"value": "idleCompaction (on unless false) summarizes a long conversation left idle on the one-hour cache before the cache expires (summary line timestamped 54.5-62 min after the last turn) and applies it on return: an auto compact_boundary written an hour or more after the last turn with durationMs under 5 s (newer versions add precomputed: true). Only at or above CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS (default 200000). It fired on 124 of 335 eligible gaps in the maintainer's logs, at a rate that does not depend on the context size",
|
|
68
|
+
"status": "documented",
|
|
69
|
+
"source": "https://code.claude.com/docs/en/prompt-caching (setting); https://code.claude.com/docs/en/env-vars (minimum); log shape from the maintainer's logs, 2026-11-23"
|
|
70
|
+
},
|
|
71
|
+
"default_threshold": {
|
|
72
|
+
"value": "~967K for native-1M models; 200K for Sonnet/Opus 4.6 without extended context; else the context limit",
|
|
73
|
+
"status": "documented",
|
|
74
|
+
"source": "https://code.claude.com/docs/en/model-config#default-auto-compact-thresholds"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"codex": {
|
|
78
|
+
"log_roots": {
|
|
79
|
+
"value": [
|
|
80
|
+
"$CODEX_HOME/sessions",
|
|
81
|
+
"~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl",
|
|
82
|
+
"$CODEX_HOME/archived_sessions"
|
|
83
|
+
],
|
|
84
|
+
"status": "public-tool",
|
|
85
|
+
"source": "https://github.com/steipete/CodexBar"
|
|
86
|
+
},
|
|
87
|
+
"line_shape": {
|
|
88
|
+
"value": "{timestamp, type, payload}; types session_meta, turn_context, event_msg, response_item, compacted",
|
|
89
|
+
"status": "public-tool",
|
|
90
|
+
"source": "https://github.com/steipete/CodexBar"
|
|
91
|
+
},
|
|
92
|
+
"token_counts": {
|
|
93
|
+
"value": "event_msg/token_count: info.total_token_usage is cumulative, info.last_token_usage is per request; snapshots are re-emitted",
|
|
94
|
+
"status": "public-tool",
|
|
95
|
+
"source": "https://github.com/steipete/CodexBar"
|
|
96
|
+
},
|
|
97
|
+
"input_includes_cached": {
|
|
98
|
+
"value": "input_tokens includes cached_input_tokens (OpenAI usage semantics)",
|
|
99
|
+
"status": "public-tool",
|
|
100
|
+
"source": "https://github.com/ryoppippi/ccusage"
|
|
101
|
+
},
|
|
102
|
+
"fork_lineage": {
|
|
103
|
+
"value": "session_meta.forked_from_id; subagent source {subagent: ...} or \"subagent\"; copied parent prefix may embed ancestor session_meta and a zero-usage opening snapshot",
|
|
104
|
+
"status": "public-tool",
|
|
105
|
+
"source": "https://github.com/steipete/CodexBar"
|
|
106
|
+
},
|
|
107
|
+
"replay_end": {
|
|
108
|
+
"value": "copied ancestor history ends at the next turn_context",
|
|
109
|
+
"status": "assumed",
|
|
110
|
+
"source": ""
|
|
111
|
+
},
|
|
112
|
+
"compaction_event": {
|
|
113
|
+
"value": "type=compacted (payload.message) and/or event_msg context_compacted",
|
|
114
|
+
"status": "assumed",
|
|
115
|
+
"source": ""
|
|
116
|
+
},
|
|
117
|
+
"compact_setting": {
|
|
118
|
+
"value": "top-level model_auto_compact_token_limit (number) in config.toml; global, not per model",
|
|
119
|
+
"status": "documented",
|
|
120
|
+
"source": "https://learn.chatgpt.com/docs/config-file/config-reference"
|
|
121
|
+
},
|
|
122
|
+
"context_window_setting": {
|
|
123
|
+
"value": "model_context_window (number)",
|
|
124
|
+
"status": "documented",
|
|
125
|
+
"source": "https://learn.chatgpt.com/docs/config-file/config-reference"
|
|
126
|
+
},
|
|
127
|
+
"latency_proxy": {
|
|
128
|
+
"value": "a response runs from the last input before its first output item (user_message, function_call_output, custom_tool_call_output) to its last output item (reasoning, message, function_call, custom_tool_call); its token_count is written after the tool output, so token_count time is not used",
|
|
129
|
+
"status": "assumed",
|
|
130
|
+
"source": "record order checked on the maintainer's logs, 2026-11-23"
|
|
131
|
+
},
|
|
132
|
+
"tool_calls": {
|
|
133
|
+
"value": "function_call / function_call_output and, for freeform tools such as exec (most commands), custom_tool_call (input text) / custom_tool_call_output; an output is a string or a list of content blocks whose text blocks count",
|
|
134
|
+
"status": "assumed",
|
|
135
|
+
"source": "the maintainer's logs, 2026-11-23 (24,107 custom exec calls in 30 days)"
|
|
136
|
+
},
|
|
137
|
+
"default_limit": {
|
|
138
|
+
"value": "90% of the resolved context window; configured values clamped to it",
|
|
139
|
+
"status": "public-source",
|
|
140
|
+
"source": "https://github.com/openai/codex/blob/main/codex-rs/protocol/src/openai_models.rs"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"dsh": {
|
|
144
|
+
"log_roots": {
|
|
145
|
+
"value": [
|
|
146
|
+
"$DSH_HOME/sessions",
|
|
147
|
+
"~/.dsh/sessions/--<cwd>--/<session>/session[.vN].jsonl[.zstd]"
|
|
148
|
+
],
|
|
149
|
+
"status": "public-source",
|
|
150
|
+
"source": "https://github.com/deepseek-ai/deepseek-harness/blob/main/.agents/notes/archived/architecture/2026-07-24-project-session-directories.md"
|
|
151
|
+
},
|
|
152
|
+
"generations": {
|
|
153
|
+
"value": "one file per format generation; the highest vN (no suffix = 0) is current",
|
|
154
|
+
"status": "public-source",
|
|
155
|
+
"source": "https://github.com/deepseek-ai/deepseek-harness/blob/main/packages/session/session-persistence-jsonl/src/format.ts"
|
|
156
|
+
},
|
|
157
|
+
"compression": {
|
|
158
|
+
"value": ".jsonl.zstd = concatenated independent zstd frames (header frame, then one per append batch); plain .jsonl when persistenceCompression is 'none'; a torn last frame is truncated",
|
|
159
|
+
"status": "public-source",
|
|
160
|
+
"source": "https://github.com/deepseek-ai/deepseek-harness/blob/main/.agents/notes/archived/architecture/2026-07-19-zstandard-jsonl-session-logs.md"
|
|
161
|
+
},
|
|
162
|
+
"line_shape": {
|
|
163
|
+
"value": "header {type:'session', version, id, createdAt, cwd?, parentSession?, origin?:'subagent', isSeeded, delegationDepth}; events {type, seq, time (epoch ms), data}",
|
|
164
|
+
"status": "public-source",
|
|
165
|
+
"source": "https://github.com/deepseek-ai/deepseek-harness/blob/main/packages/core/session/src/types.ts"
|
|
166
|
+
},
|
|
167
|
+
"token_counts": {
|
|
168
|
+
"value": "assistant/message data.usage {inputTokens (uncached), cacheReadTokens, cacheWriteTokens, outputTokens, reasoningTokens?}; counts are disjoint, billed input = the sum of the first three",
|
|
169
|
+
"status": "documented",
|
|
170
|
+
"source": "https://github.com/deepseek-ai/deepseek-harness/blob/main/packages/llm/llm/src/types.ts (TokenUsage)"
|
|
171
|
+
},
|
|
172
|
+
"reasoning_in_output": {
|
|
173
|
+
"value": "reasoningTokens is assumed to be included in outputTokens (DeepSeek completion_tokens includes reasoning)",
|
|
174
|
+
"status": "assumed",
|
|
175
|
+
"source": ""
|
|
176
|
+
},
|
|
177
|
+
"compaction_event": {
|
|
178
|
+
"value": "compaction/start, compaction/summary {summary|rawOutput, shadowedTokenCount, usage}, compaction/end {error?}",
|
|
179
|
+
"status": "public-source",
|
|
180
|
+
"source": "https://github.com/deepseek-ai/deepseek-harness/blob/main/docs/subsystems/compaction.md"
|
|
181
|
+
},
|
|
182
|
+
"fork_lineage": {
|
|
183
|
+
"value": "seeded forks (isSeeded) copy parent events up to session/end-seed; subagents have origin 'subagent' and parentSession",
|
|
184
|
+
"status": "public-source",
|
|
185
|
+
"source": "https://github.com/deepseek-ai/deepseek-harness/blob/main/docs/subsystems/session.md"
|
|
186
|
+
},
|
|
187
|
+
"row_time": {
|
|
188
|
+
"value": "rows carry time (epoch ms); when absent, the latest provider-stream chunk time of an assistant/message is used",
|
|
189
|
+
"status": "assumed",
|
|
190
|
+
"source": ""
|
|
191
|
+
},
|
|
192
|
+
"compact_setting": {
|
|
193
|
+
"value": "dsh-compaction-basic: thresholdRatio (0.8), headroomTokens (65536), modelPolicies[]; trigger = min(window x ratio, window - reserved output - headroom)",
|
|
194
|
+
"status": "documented",
|
|
195
|
+
"source": "https://github.com/deepseek-ai/deepseek-harness/blob/main/docs/config-catalog.md#deepseek-aidsh-compaction-basic"
|
|
196
|
+
},
|
|
197
|
+
"config_location": {
|
|
198
|
+
"value": "where a user's plugin config lives (profile patch / cordis.yml under $DSH_HOME) is not verified; apply does not write it",
|
|
199
|
+
"status": "assumed",
|
|
200
|
+
"source": ""
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"opencode": {
|
|
204
|
+
"log_roots": {
|
|
205
|
+
"value": [
|
|
206
|
+
"$XDG_DATA_HOME/opencode/opencode.db (default ~/.local/share/opencode/opencode.db)",
|
|
207
|
+
"opencode-<channel>.db on non-release channels; OPENCODE_DB overrides"
|
|
208
|
+
],
|
|
209
|
+
"status": "public-source",
|
|
210
|
+
"source": "https://github.com/anomalyco/opencode/blob/v1.19.6/packages/core/src/database/database.ts (path); packages/core/src/global.ts (xdg-basedir)"
|
|
211
|
+
},
|
|
212
|
+
"storage": {
|
|
213
|
+
"value": "one SQLite database in WAL mode for every session: session (id, parent_id, time_updated ms), message (id, session_id, data JSON), part (id, message_id, session_id, time_created ms, data JSON); opened with mode=ro, never written",
|
|
214
|
+
"status": "public-source",
|
|
215
|
+
"source": "https://github.com/anomalyco/opencode/blob/v1.19.6/packages/opencode/src/session/session.ts; checked on a real 1.19.5 database on 2026-11-23"
|
|
216
|
+
},
|
|
217
|
+
"message_shape": {
|
|
218
|
+
"value": "user {role, time.created, agent, model{providerID, modelID}}; assistant {role, parentID, providerID, modelID, mode, agent, time.created/completed, finish, error?, summary?, tokens, cost}",
|
|
219
|
+
"status": "public-source",
|
|
220
|
+
"source": "https://github.com/anomalyco/opencode/blob/v1.19.6/packages/schema/src/v1/session.ts (User, Assistant)"
|
|
221
|
+
},
|
|
222
|
+
"part_types": {
|
|
223
|
+
"value": "text, reasoning, file, agent, compaction, subtask, retry, step-start, step-finish, tool, snapshot, patch",
|
|
224
|
+
"status": "public-source",
|
|
225
|
+
"source": "https://github.com/anomalyco/opencode/blob/v1.19.6/packages/schema/src/v1/session.ts (Part)"
|
|
226
|
+
},
|
|
227
|
+
"token_counts": {
|
|
228
|
+
"value": "one step-finish part per model request, tokens {input (uncached: provider input - cache read - cache write), output (reasoning excluded), reasoning, cache.read, cache.write, total?}; reasoning is billed at the output rate",
|
|
229
|
+
"status": "public-source",
|
|
230
|
+
"source": "https://github.com/anomalyco/opencode/blob/v1.19.6/packages/opencode/src/session/session.ts (getUsage). On real 1.19.5 history total = input + output + reasoning + cache.read + cache.write on every row, and the parsed sums equal the session table's own totals"
|
|
231
|
+
},
|
|
232
|
+
"compaction_event": {
|
|
233
|
+
"value": "a user message with a compaction part {auto, overflow?, tail_start_id?}, answered by an assistant message with summary: true (mode/agent 'compaction', parentID = that user message); completed when finish is set and error is absent. The summary call's usage is on that message, not a turn",
|
|
234
|
+
"status": "public-source",
|
|
235
|
+
"source": "https://github.com/anomalyco/opencode/blob/v1.19.6/packages/opencode/src/session/compaction.ts (create, process, completedCompactions)"
|
|
236
|
+
},
|
|
237
|
+
"trigger_check": {
|
|
238
|
+
"value": "checked after every step (processor finish-step) and before each loop iteration (prompt.ts), so a compaction can happen in the middle of a tool loop",
|
|
239
|
+
"status": "public-source",
|
|
240
|
+
"source": "https://github.com/anomalyco/opencode/blob/v1.19.6/packages/opencode/src/session/processor.ts; packages/opencode/src/session/prompt.ts"
|
|
241
|
+
},
|
|
242
|
+
"subagents": {
|
|
243
|
+
"value": "the task tool runs a child session whose session.parent_id is the caller",
|
|
244
|
+
"status": "public-source",
|
|
245
|
+
"source": "https://github.com/anomalyco/opencode/blob/v1.19.6/packages/opencode/src/session/session.ts (parentID)"
|
|
246
|
+
},
|
|
247
|
+
"v2_storage": {
|
|
248
|
+
"value": "OpenCode 2.x pre-releases store sessions in session_v2 / session_message / session_part; not parsed, counted by doctor",
|
|
249
|
+
"status": "public-source",
|
|
250
|
+
"source": "https://github.com/anomalyco/opencode/blob/dev/packages/core/src/session/sql.ts"
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"gemini-cli": {
|
|
254
|
+
"log_roots": {
|
|
255
|
+
"value": [
|
|
256
|
+
"$GEMINI_CLI_HOME/.gemini/tmp",
|
|
257
|
+
"~/.gemini/tmp/<project>/chats/session-<YYYY-MM-DDTHH-MM>-<id8>.jsonl",
|
|
258
|
+
"<project> is a slug from ~/.gemini/projects.json (older versions: a SHA-256 of the project root)"
|
|
259
|
+
],
|
|
260
|
+
"status": "public-source",
|
|
261
|
+
"source": "https://github.com/google-gemini/gemini-cli/blob/v0.70.0/packages/core/src/services/chatRecordingService.ts; packages/core/src/config/storage.ts; packages/core/src/utils/paths.ts (GEMINI_CLI_HOME)"
|
|
262
|
+
},
|
|
263
|
+
"line_shape": {
|
|
264
|
+
"value": "JSONL: a header {sessionId, projectHash, startTime, lastUpdated, kind?: main|subagent}, message lines {id, timestamp, type: user|gemini|info|error|warning, content, model?, tokens?, toolCalls?, thoughts?}, {$set: {...}}, {$rewindTo: id} and (0.70+) {$patch: {...}}. A message is re-written with the same id when tokens or tool calls are attached; the last line wins. Older versions wrote one .json document",
|
|
265
|
+
"status": "public-source",
|
|
266
|
+
"source": "https://github.com/google-gemini/gemini-cli/blob/v0.70.0/packages/core/src/services/chatRecordingTypes.ts; https://github.com/google-gemini/gemini-cli/blob/v0.46.0/packages/core/src/services/chatRecordingService.ts (loader)"
|
|
267
|
+
},
|
|
268
|
+
"token_counts": {
|
|
269
|
+
"value": "gemini message tokens {input = promptTokenCount (INCLUDES cached), output = candidatesTokenCount, cached = cachedContentTokenCount, thoughts, tool = toolUsePromptTokenCount, total}; one gemini message per API call, tool follow-ups included",
|
|
270
|
+
"status": "public-source",
|
|
271
|
+
"source": "https://github.com/google-gemini/gemini-cli/blob/v0.46.0/packages/core/src/services/chatRecordingService.ts (recordMessageTokens); packages/core/src/core/geminiChat.ts"
|
|
272
|
+
},
|
|
273
|
+
"tool_results": {
|
|
274
|
+
"value": "tool results are also written as type 'user' messages whose content is functionResponse parts",
|
|
275
|
+
"status": "public-source",
|
|
276
|
+
"source": "https://github.com/google-gemini/gemini-cli/blob/v0.46.0/packages/core/src/core/geminiChat.ts"
|
|
277
|
+
},
|
|
278
|
+
"compaction_event": {
|
|
279
|
+
"value": "no explicit record: 0.46 writes a {$set: {messages: [...]}} checkpoint whose first message is the <state_snapshot> summary; 0.70 appends the summary messages and a {$patch: {removeIds, orderIds}}. The summary call's usage is not written; /compress and automatic compression look the same",
|
|
280
|
+
"status": "public-source",
|
|
281
|
+
"source": "https://github.com/google-gemini/gemini-cli/blob/v0.70.0/packages/core/src/services/chatRecordingService.ts; packages/core/src/core/client.ts (tryCompressChat)"
|
|
282
|
+
},
|
|
283
|
+
"subagents": {
|
|
284
|
+
"value": "chats/<parent session id>/<subagent session id>.jsonl with kind: 'subagent' in the header",
|
|
285
|
+
"status": "public-source",
|
|
286
|
+
"source": "https://github.com/google-gemini/gemini-cli/blob/v0.70.0/packages/core/src/services/chatRecordingService.ts"
|
|
287
|
+
},
|
|
288
|
+
"token_limit": {
|
|
289
|
+
"value": "tokenLimit(model) = 1,048,576 for Gemini models (and any unknown name), 256,000 for Gemma 4",
|
|
290
|
+
"status": "public-source",
|
|
291
|
+
"source": "https://github.com/google-gemini/gemini-cli/blob/v0.70.0/packages/core/src/core/tokenLimits.ts"
|
|
292
|
+
},
|
|
293
|
+
"real_logs": {
|
|
294
|
+
"value": "not checked: no Gemini CLI chat logs were available; the adapter is experimental",
|
|
295
|
+
"status": "assumed",
|
|
296
|
+
"source": ""
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"currency": "USD",
|
|
4
|
+
"unit": "per million tokens",
|
|
5
|
+
"retrieved": "2026-11-23",
|
|
6
|
+
"source": "models.dev pricing snapshot as committed in ryoppippi/ccusage (rust/crates/ccusage-pricing-snapshots/src/models-dev-pricing.json); claude-fable-5-2 and the gpt-6 rows from https://models.dev/api.json (anthropic, openai) on 2026-11-23, checked against LiteLLM and OpenRouter; cache_write for GPT-5 rows = input price (no separate write charge), GPT-6 rows as models.dev lists them",
|
|
7
|
+
"source_url": "https://models.dev/api.json",
|
|
8
|
+
"note": "Snapshot of public list prices; may lag provider changes. Refresh with `compactlab pricing refresh` or override with --pricing.",
|
|
9
|
+
"default_ttl_seconds": 300,
|
|
10
|
+
"cache_write_1h_note": "Anthropic bills 1-hour cache writes at 2x the base input price (5-minute writes at 1.25x): https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing",
|
|
11
|
+
"models": {
|
|
12
|
+
"deepseek-v4-pro": {"match": ["deepseek-v4-pro", "deepseek-pro"], "input": 0.66, "output": 1.98, "cache_write": 0.66, "cache_read": 0.022, "max_window": 1048576, "note": "off-peak list price; peak hours bill 2x", "source_url": "https://api-docs.deepseek.com/quick_start/pricing"},
|
|
13
|
+
"deepseek-flash": {"match": ["deepseek-flash", "deepseek-v4-flash"], "input": 0.15, "output": 0.60, "cache_write": 0.15, "cache_read": 0.003, "max_window": 1048576, "note": "off-peak list price; peak hours bill 2x", "source_url": "https://api-docs.deepseek.com/quick_start/pricing"},
|
|
14
|
+
"claude-fable-5-2": {"match": ["fable-5.2"], "input": 8.0, "output": 40.0, "cache_write": 10.0, "cache_write_1h": 16, "cache_read": 0.2, "max_window": 1000000},
|
|
15
|
+
"claude-fable-5-1": {"match": ["fable-5-1", "fable-5.1"], "input": 10.0, "output": 50.0, "cache_write": 12.5, "cache_write_1h": 20, "cache_read": 0.25, "max_window": 1000000},
|
|
16
|
+
"claude-fable-5": {"match": ["fable-5"], "input": 10.0, "output": 50.0, "cache_write": 12.5, "cache_write_1h": 20, "cache_read": 1.0, "max_window": 1000000},
|
|
17
|
+
"claude-opus-5-5": {"match": ["opus-5-5", "opus-5.5"], "input": 4.0, "output": 20.0, "cache_write": 5.0, "cache_write_1h": 8, "cache_read": 0.2, "max_window": 1000000},
|
|
18
|
+
"claude-opus-5": {"match": ["opus-5"], "input": 5.0, "output": 25.0, "cache_write": 6.25, "cache_write_1h": 10, "cache_read": 0.5, "max_window": 1000000},
|
|
19
|
+
"claude-sonnet-5-5": {"match": ["sonnet-5-5", "sonnet-5.5"], "input": 2.0, "output": 10.0, "cache_write": 2.5, "cache_write_1h": 4, "cache_read": 0.1, "max_window": 1000000},
|
|
20
|
+
"claude-sonnet-5": {"match": ["sonnet-5"], "input": 2.0, "output": 10.0, "cache_write": 2.5, "cache_write_1h": 4, "cache_read": 0.2, "max_window": 1000000},
|
|
21
|
+
"claude-haiku-5-5": {
|
|
22
|
+
"match": ["haiku-5-5", "haiku-5.5", "haiku-5"], "input": 0.1, "output": 0.5, "cache_write": 0.125, "cache_write_1h": 0.2, "cache_read": 0.01, "max_window": 1000000,
|
|
23
|
+
"long_context": {"above_tokens": 100000, "input": 0.5, "output": 2.5, "cache_write": 0.625, "cache_write_1h": 1, "cache_read": 0.05}
|
|
24
|
+
},
|
|
25
|
+
"claude-opus-4-7": {"match": ["opus-4-7"], "input": 5.0, "output": 25.0, "cache_write": 6.25, "cache_write_1h": 10, "cache_read": 0.5, "max_window": 1000000},
|
|
26
|
+
"claude-opus-4-5": {"match": ["opus-4"], "input": 5.0, "output": 25.0, "cache_write": 6.25, "cache_write_1h": 10, "cache_read": 0.5, "max_window": 200000},
|
|
27
|
+
"claude-sonnet-4-5": {"match": ["sonnet-4"], "input": 3.0, "output": 15.0, "cache_write": 3.75, "cache_write_1h": 6, "cache_read": 0.3, "max_window": 200000},
|
|
28
|
+
"claude-haiku-4-5": {"match": ["haiku-4"], "input": 1.0, "output": 5.0, "cache_write": 1.25, "cache_write_1h": 2, "cache_read": 0.1, "max_window": 200000},
|
|
29
|
+
"gpt-5-codex": {"match": ["gpt-5-codex", "gpt-5.1-codex"], "input": 1.25, "output": 10.0, "cache_write": 1.25, "cache_read": 0.125, "max_window": 400000},
|
|
30
|
+
"gpt-5.3-codex": {"match": ["gpt-5.2-codex", "gpt-5.3-codex"], "input": 1.75, "output": 14.0, "cache_write": 1.75, "cache_read": 0.175, "max_window": 400000},
|
|
31
|
+
"gpt-5.5": {
|
|
32
|
+
"match": ["gpt-5.5"], "input": 5.0, "output": 30.0, "cache_write": 5.0, "cache_read": 0.5, "max_window": 1050000,
|
|
33
|
+
"long_context": {"above_tokens": 272000, "input": 10.0, "output": 45.0, "cache_write": 10.0, "cache_read": 1.0}
|
|
34
|
+
},
|
|
35
|
+
"gpt-6-astra": {"input": 10.0, "output": 50.0, "cache_write": 12.5, "cache_read": 1.0, "max_window": 1050000,
|
|
36
|
+
"long_context": {"above_tokens": 272000, "input": 20.0, "output": 75.0, "cache_write": 25.0, "cache_read": 2.0}},
|
|
37
|
+
"gpt-6.2-astra": {"input": 8.0, "output": 40.0, "cache_write": 10.0, "cache_read": 0.4, "max_window": 1050000,
|
|
38
|
+
"long_context": {"above_tokens": 272000, "input": 16.0, "output": 60.0, "cache_write": 20.0, "cache_read": 0.8}},
|
|
39
|
+
"gpt-6-sol": {"input": 2.0, "output": 10.0, "cache_write": 2.5, "cache_read": 0.2, "max_window": 1050000,
|
|
40
|
+
"long_context": {"above_tokens": 272000, "input": 4.0, "output": 15.0, "cache_write": 5.0, "cache_read": 0.4}},
|
|
41
|
+
"gpt-6.1-sol": {"input": 2.0, "output": 10.0, "cache_write": 2.5, "cache_read": 0.1, "max_window": 1050000,
|
|
42
|
+
"long_context": {"above_tokens": 272000, "input": 4.0, "output": 15.0, "cache_write": 5.0, "cache_read": 0.2}},
|
|
43
|
+
"gpt-6.2-sol": {"input": 2.0, "output": 10.0, "cache_write": 2.5, "cache_read": 0.1, "max_window": 1050000,
|
|
44
|
+
"long_context": {"above_tokens": 272000, "input": 4.0, "output": 15.0, "cache_write": 5.0, "cache_read": 0.2}},
|
|
45
|
+
"gpt-6.1-terra": {"input": 1.0, "output": 5.0, "cache_write": 1.25, "cache_read": 0.05, "max_window": 1050000,
|
|
46
|
+
"long_context": {"above_tokens": 272000, "input": 2.0, "output": 7.5, "cache_write": 2.5, "cache_read": 0.1}},
|
|
47
|
+
"gpt-6-luna": {"input": 0.1, "output": 0.5, "cache_write": 0.125, "cache_read": 0.01, "max_window": 1050000,
|
|
48
|
+
"long_context": {"above_tokens": 272000, "input": 0.2, "output": 0.75, "cache_write": 0.25, "cache_read": 0.02}}
|
|
49
|
+
},
|
|
50
|
+
"fallback": {"input": 3.0, "output": 15.0, "cache_write": 3.75, "cache_read": 0.3, "max_window": 200000}
|
|
51
|
+
}
|