fix(llm): register official 200k context windows for o1, o1-pro and o3 - #7411
fix(llm): register official 200k context windows for o1, o1-pro and o3#7411Lubaoshuai wants to merge 1 commit into
Conversation
o1, o1-pro and o3 were missing from the context window tables, so lookups fell through to the 8k default and triggered false LLMContextLengthExceededError or premature truncation (crewAIInc#7303). Register 200k for the three models in the shared LLM_CONTEXT_WINDOW_SIZES table and in the native OpenAI and Azure provider tables, keeping the 128k windows for o1-preview and o1-mini. Prefix ordering follows each lookup's own semantics (last-match-wins in llm.py, first-match-wins in the provider tables) so the longer 128k prefixes keep precedence.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change registers 200000-token context windows for ChangesO-series context windows
Suggested reviewers: Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The requested context-window mappings are implemented consistently across providers, with tests covering the important model variants and no unresolved merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #7303
o1,o1-proando3were missing from the context window tables, so lookups fell through to the 8k default (LLMContextLengthExceededErrorfalse positives, premature truncation).Registers 200k for the three models in
LLM_CONTEXT_WINDOW_SIZES(llm.py) and in the native OpenAI and Azure provider tables, while keeping the 128k windows foro1-previewando1-mini. Prefix ordering follows each lookup's own semantics: llm.py iterates the whole table with last-match-wins, so the shortero1entry goes before the longer prefixes; the provider tables return on the first startswith match, so the new entries go after them.Tests: parametrized regression cases for o1 / o1-pro / o3 / dated snapshots (200k) and o1-preview / o1-mini (still 128k) at all three layers (
tests/test_llm.py,tests/llms/openai/test_openai.py,tests/llms/azure/test_azure.py).