Cap the hint prompt at 120 tokens: a full 223-token prompt garbles small models

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas WintherandClaude Opus 5.5 committed 2026-10-29 23:51:47 +01:00
1 parent 28201bcd17
commit edb9b332b9
7 files changed
+31 -23

No files matched your search

+3 -3
View File
@@ -52,9 +52,9 @@ SAMPLE_RATE = 16000
# "Names and terms" vocabulary hint (D-WS2a). Twins of normalizeHint /
# fitHintToBudget in src/lib/hint.ts — change both together; parity is tested
# in tests/hint-parity.test.ts. Whisper's prompt budget is half of its 448
# decoder positions minus one (<|startofprev|>).
PROMPT_TOKEN_BUDGET = 223
# in tests/hint-parity.test.ts. Whisper would allow 223 tokens; 120 is the
# measured cap at which small models are not garbled (D-WS2a).
PROMPT_TOKEN_BUDGET = 120
_CONTROL_CHARS = re.compile("[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]")