diff --git a/CONFIGURATION.md b/CONFIGURATION.md index e91e6d2da7..d4367b606f 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -1246,7 +1246,26 @@ For each request, the proxy resolves the settings by longest-URL-prefix match (t - **Type:** `number` - **Default:** `50000` - **Status:** ACTIVE -- **Description:** Token-growth step for soft compression nudges. A nudge fires roughly every time this many tokens become compressible. Lower values produce more frequent nudges. Maps to the kernel fields `nudge.growthFloor` and `nudge.growthCap` (it flattens the engine's adaptive band to this fixed step). **Keep this proportional to your smallest model window:** the T1 mass trigger needs one full step of compressible content, so a step larger than the window (e.g. `1500000` against a ~1M window) makes the mass trigger unreachable for that entire window — usage-percentage pressure bands and preflight remain as backstops, but incremental folding goes silent and an over-window request (typical after a mid-session fork onto a smaller-window model) falls straight into the multi-round preflight summarization marathon instead of folding early. +- **Description:** Token-growth step for soft compression nudges. A nudge fires roughly every time this many tokens become compressible. Lower values produce more frequent nudges. Maps to the kernel fields `nudge.growthFloor` and `nudge.growthCap` (it flattens the engine's adaptive band to this fixed step). **Keep this proportional to your smallest model window:** the T1 mass trigger needs one full step of compressible content, so a step larger than the window (e.g. `1500000` against a ~1M window) makes the mass trigger unreachable for that entire window — usage-percentage pressure bands and preflight remain as backstops, but incremental folding goes silent and an over-window request (typical after a mid-session fork onto a smaller-window model) falls straight into the multi-round preflight summarization marathon instead of folding early. **What moves together:** the growth gate is `max(20000, 0.45 × step)` (kernel `minGrowthFloor` / `minGrowthRatio`), the T1 token-mass trigger defaults to one full step, and T2/T3 derive at step × 1.5 unless pinned via [`tierNudgeTokens`](#tiernudgetokens) — so raising the step (e.g. `50000` → `100000`) moves the gate to `45000`, the T1 mass trigger to `100000`, and the derived T2/T3 to `150000` in a single change, and each fold then covers a larger span. To shift only the T1 mass trigger while keeping the cadence, set `tierNudgeTokens.t1` instead. **Per-model override:** when one expensive-summary model (long thinking plus long summaries on every compress call) shares a route with cheaper models, scope the step to that model by its EXACT wire model id (the `model` value in the request body — no substring matching) instead of moving the route-wide value; unmatched models keep the route/global settings untouched: + +```jsonc +{ + "providers": { + "https:///v1": { + "models": { + // key = the exact model string the client sends upstream + "deepseek-v4.1-flash": { + "compress": { + "nudgeGrowthTokens": 100000 // candidate value — validate on YOUR workload before adopting + } + } + } + } + } +} +``` + +Confirm the resolved value live: each request's nudge decision log line prints the effective `interval=` (this step) and `reason=`, so you can verify which settings a given request actually ran with. #### `minPressureBenefitTokens` diff --git a/CONFIGURATION.zh-CN.md b/CONFIGURATION.zh-CN.md index f45422c0ca..087e3db910 100644 --- a/CONFIGURATION.zh-CN.md +++ b/CONFIGURATION.zh-CN.md @@ -1249,7 +1249,26 @@ ACP 原生 agent(当前为 `pi` 扩展)会在每个进程内向代理上报 - **类型:** `number` - **默认值:** `50000` - **状态:** ACTIVE -- **说明:** 软压缩 nudge 的 token 增长步长。每当有这么多 token 变为可压缩时,大约就会触发一次 nudge。值越小,nudge 越频繁。映射到内核字段 `nudge.growthFloor` 和 `nudge.growthCap`(它将引擎的自适应区间扁平化为这个固定步长)。**保持该值与最小模型窗口成比例:** T1 质量触发需要整整一个步长的可压缩内容,因此步长大于窗口(例如对 ~1M 窗口设 `1500000`)会让质量触发在整个窗口内都不可达——usage 百分比压力带和 preflight 仍兜底,但增量折叠会静默失效,超窗请求(会话中途 fork 到更小窗口模型的典型场景)不再提前折叠,而是直接坠入多轮 preflight 总结马拉松。 +- **说明:** 软压缩 nudge 的 token 增长步长。每当有这么多 token 变为可压缩时,大约就会触发一次 nudge。值越小,nudge 越频繁。映射到内核字段 `nudge.growthFloor` 和 `nudge.growthCap`(它将引擎的自适应区间扁平化为这个固定步长)。**保持该值与最小模型窗口成比例:** T1 质量触发需要整整一个步长的可压缩内容,因此步长大于窗口(例如对 ~1M 窗口设 `1500000`)会让质量触发在整个窗口内都不可达——usage 百分比压力带和 preflight 仍兜底,但增量折叠会静默失效,超窗请求(会话中途 fork 到更小窗口模型的典型场景)不再提前折叠,而是直接坠入多轮 preflight 总结马拉松。**联动效应:** 增长门为 `max(20000, 0.45 × 步长)`(内核 `minGrowthFloor` / `minGrowthRatio`),T1 token 质量触发默认取整整一个步长,T2/T3 按步长 × 1.5 派生(除非用 [`tierNudgeTokens`](#tiernudgetokens) 钉死)——因此把步长调大(例如 `50000` → `100000`)会一次性把门移到 `45000`、T1 质量触发移到 `100000`、派生 T2/T3 移到 `150000`,且每次折叠覆盖的跨度也随之变大。只想移动 T1 质量触发而不动节奏,改用 `tierNudgeTokens.t1`。**按模型覆盖:** 当某个高成本摘要模型(每次压缩调用都带长思考 + 长摘要)与更便宜的模型共用同一条路由时,用**精确的 wire 模型 id**(请求体里的 `model` 值——不做子串匹配)把步长限定到该模型,而不是改整条路由的值;未匹配的模型保持路由/全局设置不变: + +```jsonc +{ + "providers": { + "https:///v1": { + "models": { + // key = the exact model string the client sends upstream + "deepseek-v4.1-flash": { + "compress": { + "nudgeGrowthTokens": 100000 // candidate value — validate on YOUR workload before adopting + } + } + } + } + } +} +``` + +在日志中确认生效值:每个请求的 nudge 决策行会打印实际生效的 `interval=`(即本步长)和 `reason=`,可以核对某个请求到底用了哪套配置。 #### `minPressureBenefitTokens`