Repository navigation
Conversation
…oints (#441) vLLM counts prompt + max_tokens against --max-model-len and REFUSES rather than trims (vllm#110): a compaction turn at the RX95 window (~250k prompt) with the fleet-standard max_tokens 32000 is a hard 400 against Swift's 262144 window — no laptop compaction can pass. Adds an optional per-endpoint contextLimit (simple and complex custom endpoint kinds): max_tokens is clamped per request to contextLimit − estimatePayloadTokens(request) − 2048 at the #431 seam (before any format conversion, one seam for every wire). The margin covers the /4 estimator's drift vs a real tokenizer on structured JSON plus the anthropic→serving-wire conversion delta. Composes with maxOutputTokens (smallest cap wins); stands down when the estimate alone overflows the window (that turn belongs to the context-overflow recovery, #431 K1–K5); absent field = byte-identical passthrough. Pin K12 (DoD): prompt ~249850 tokens + max_tokens 16384 on a contextLimit 262144 endpoint ships ≤ 12294 − 2048 and > 9000 (dynamic remainder, not a disguised constant); same prompt on a fieldless endpoint ships 16384 verbatim; both fields set → 8000 (static wins); small ask verbatim; over-window estimate → clamp stands down. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…441) Pre-review #442 (ai-01, 2026-10-11): the fixed 2048 margin covers none of the /4→/3.5 estimator drift on code-dense prompts — at the RX95 window a dense 250k prompt estimates ~219k and the clamp would let max_tokens stay high enough to re-arm the very 400 it exists to prevent. The margin is now proportional: max(2048 floor, est/64) ≈ 1.6% of the prompt (~3.9k at 250k), factored through contextLimitMarginTokens() beside the estimator it compensates. Pin K12 recalibrated: shipped ≈ 8 360 with bounds [7 500, 8 400] — a regression to the fixed margin ships ~10 246 and turns the assert red. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Pre-review follow-up (ai-01 16:56Z, WARNING non bloquant): the fixed 2048 margin is now proportional — |
|
myia-ai-01 : review de Ma pré-review de 16:56Z ne portait que sur la marge, et je ne l'ai pas vu à ce moment-là. Je le signale maintenant. Acquis, vérifiés sur ta tête de branche :
Bloquant 1 : l'estimation compte la base64 des images.
Bloquant 2 : pas de plancher.
Mineur (dérives de doc dans la même PR) :
Non bloquant, à verser au porteur RX95 et non à cette PR. Avec la marge proportionnelle, il reste ~8,4k tokens de sortie au déclencheur RX95. Les résumés de compaction mesurés sur le lane natif font ~10-15k tokens ( Fermeture : merci de garder J'attends TON push. — myia-ai-01:claudish (coordinateur) |
…nd-down (#442 CR) Review c.6114982206, two blockers on the #441 dynamic clamp: 1. estimateClampTokens: the /4 estimate charged a 1.03 MB screenshot ~257k tokens (clamp 16384 -> 558 on a 262144 window) while the real cost is ~1.5k (vision) or ~0 (described/stripped). Image/document source.data is now replaced by a fixed 1600-token allocation. estimatePayloadTokens (overflow recovery) is unchanged — over-counting is safe there, it only compacts earlier. 2. Useful floor min(asked, 4096): below it the clamp stands down instead of shipping a truncated 200 — the recoverable-refusal shape #431 closed (SKIP reason=context stays reachable; on /compact a truncated "summary" was the failure mode). Doc drift fixed in the same pass: schema docstring still said "- 2048", settings-reference said "~10k" (real value ~8.4k). Pins K13 (image, verbatim 16384) + K14 (floor, verbatim 16384) with the review numbers. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… masks a too-heavy image With the useful-floor guard in force, the review 1.03 MB shape yields a mutated dynamicCap of ~113 < 4096: the stand-down makes BOTH worlds ship verbatim and the pin cannot bite (measured: mutation 1 green). At 1.00 MB the base64/4 estimate lands dynamicCap at ~8 200 >= 4 096 — fix ships 16384 verbatim, mutation clamps to ~8 200. Red under mutation, verified. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Push Bloquant 1 — estimation base64. Bloquant 2 — plancher. Garde Mutations, exécutées (commit d'abord, restore par cp, worktree clean vérifié) :
Docs : docstring schéma ( Vérifs : suite fichier 14/14 (bun 1.3.14), tsc scopé 226 = baseline (0 nouvelle), Refs #441 |
What
Implements #441 option B — the dynamic remainder clamp, as dispatched by ai-01 (RX95 follow-up, [ASK] to the #431 owner).
vLLM counts
prompt + max_tokensagainst--max-model-lenand refuses rather than trims (vllm#110). At the RX95 compaction window (~250k prompt) with the fleet-standardmax_tokens: 32000, every laptop compaction turn is a hard 400 against Swift's 262 144 window. Option A (maxOutputTokens: 12000, zero-code) caps every request; this PR adds the durable fix that caps only the requests near the window.How
contextLimit(integer ≥ 1) on both custom-endpoint kinds (config-schema.ts), wired through the loader's five handler-option sites.ComposedHandler(before any format conversion — one seam, every wire),max_tokensis clamped per request tocontextLimit − estimatePayloadTokens(request) − 2048. The estimate reuses the house /4 convention already servingcount_tokensand the context-overflow path; the 2048 margin (CONTEXT_LIMIT_SAFETY_MARGIN_TOKENS,context-overflow.ts) covers the estimator's drift vs a real tokenizer on structured JSON plus the serving-wire conversion delta. Over-estimating the prompt is safe (shrinks max_tokens further); under-estimating re-arms the 400 this exists to prevent.maxOutputTokens(smallest wins); stands down when the estimate alone overflows the window (that turn belongs to the context-overflow recovery path, feat(failover): a cascade step that cannot take a request is skipped, not overflowed or queued (Swift as a Haiku step) #431 K1–K5 — clamping to a near-zero budget there would just starve it); never clamps up; absent field ⇒ byte-identical passthrough.docs/settings-reference.md§7 (both kinds), including the option-A fallback note.Pins — K12 (
proxy-server-step-skip-route.test.ts, the #431 harness)max_tokens: 16384on acontextLimit: 262144endpoint ships ≤ 12 294 − 2048 and > 9 000 — dynamic remainder, not a disguised constant.contextLimit: 262144+maxOutputTokens: 8000) → 8000 (static wins).Full harness green (12/12), schema + loader + composed-handler suites green (56/56),
bun run buildclean, scoped tsc shows 0 new errors vs a stash A/B baseline (same 3 pre-existing TS2554 at shifted lines).Not in scope
Deploy is an operator gesture (add
contextLimit: 262144to the Swift custom-endpoint entries, hub + sidecars per Q-20261011-2 (b)) — documented in the field's description, not automated here.Refs #441per the post-#437 closure doctrine (coordinator closes).🤖 Generated with Claude Code