Repository navigation
feat: populate content_length and max_output from official docs - #17836
Conversation
Verify and populate content_length (context window) and max_output (max generation tokens) for all 478 chat/vision models across 47 provider configs, sourced from official API documentation. Key corrections vs initial guesswork: - Claude 4.6+ gen (opus 4.6/4.7/4.8, sonnet 4.6): 1M context + 128K output - DeepSeek V4: 1M context + 384K output (not 8K) - GPT-5 series: max_output = 128K (not 65K) - Llama 4 Scout: 10M context - Mistral: max_output equals context (not fixed 8K) - Gemini 1.5 Pro: 2M context - Nova series: max_output = 5K Data collected via 12 parallel agents scraping official docs (OpenAI, Anthropic, Google, Bedrock, Cohere, xAI, Meta, DeepSeek, Qwen, Mistral, GLM, Kimi, etc.) plus targeted web verification. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe pull request replaces provider model ChangesModel capacity metadata
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
conf/models/groq.json (2)
93-105: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winRemove the discontinued Groq models.
Groq shut down
meta-llama/llama-4-scout-17b-16e-instructandqwen/qwen3-32bon July 17, 2026. This configuration still publishes both IDs. Requests can select unavailable models. Delete these records or replace them with Groq-supported IDs and limits. (console.groq.com)As per coding guidelines, “Treat legacy code as a liability rather than a compatibility target” and remove deprecated code.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@conf/models/groq.json` around lines 93 - 105, Remove the model records for meta-llama/llama-4-scout-17b-16e-instruct and qwen/qwen3-32b from the Groq model configuration so unavailable IDs are no longer published; do not retain compatibility entries for these discontinued models.Source: Coding guidelines
38-50: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winCorrect the GPT-OSS output limits.
Groq sets
max_outputto 65,536 foropenai/gpt-oss-120bandopenai/gpt-oss-20b. These records declare 131,072. This lets callers request output that Groq cannot serve. Setmax_outputto65536for all three records. (console.groq.com)Proposed fix
- "max_output": 131072, + "max_output": 65536,Also applies to: 82-83
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@conf/models/groq.json` around lines 38 - 50, Update the max_output field for all three GPT-OSS model records in the models configuration, including openai/gpt-oss-120b and openai/gpt-oss-20b, from 131072 to 65536. Leave their content_length and other model settings unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@conf/models/302ai.json`:
- Around line 20-21: Update the provider model resolver that populates
LLMBundle.max_length to recognize content_length from provider model
configurations such as conf/models/302ai.json, copying it into the existing
max_tokens/max_length path before LLMBundle.max_length is read. Preserve the
current max_tokens behavior when content_length is absent.
In `@conf/models/longcat.json`:
- Around line 14-15: Normalize model configuration so max_output is mapped to
max_tokens in both the Go provider/model parsing path and the Python
resolve_model_config() path. Ensure this value takes precedence or is reused
consistently when constructing LLMBundle, allowing LongCat-2.0 to retain
max_length 131072 instead of the default.
In `@conf/models/minimax.json`:
- Around line 30-31: Update the content_length values for the MiniMax M2, M2.1,
M2.5, and M2.7 entries to 204800, unless these entries explicitly target a
separate 1M-context endpoint; keep max_output unchanged.
In `@conf/models/mistral.json`:
- Around line 18-19: Clamp Mistral chat output tokens before requests by
computing the allowed value as the minimum of configured max output and
content_length minus prompt tokens. Update the request-building logic in
internal/entity/models/mistral.go and apply the equivalent per-call clamp in the
Python LLM path, including all chat configurations where content_length equals
max_output.
In `@conf/models/replicate.json`:
- Around line 15-24: Update the max_output setting for both Replicate Llama 4
model entries, including meta/llama-4-scout-instruct, from 8192 to the
provider-supported limit of 131072 so requests can use the documented max_tokens
range. Preserve any change only if the Replicate adapter explicitly enforces a
separate lower cap.
---
Outside diff comments:
In `@conf/models/groq.json`:
- Around line 93-105: Remove the model records for
meta-llama/llama-4-scout-17b-16e-instruct and qwen/qwen3-32b from the Groq model
configuration so unavailable IDs are no longer published; do not retain
compatibility entries for these discontinued models.
- Around line 38-50: Update the max_output field for all three GPT-OSS model
records in the models configuration, including openai/gpt-oss-120b and
openai/gpt-oss-20b, from 131072 to 65536. Leave their content_length and other
model settings unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1aff7bd9-b4fa-4b0b-9cdf-acf2ffb40d28
📒 Files selected for processing (48)
conf/models/302ai.jsonconf/models/aliyun.jsonconf/models/anthropic.jsonconf/models/astraflow.jsonconf/models/avian.jsonconf/models/baichuan.jsonconf/models/baidu.jsonconf/models/bedrock.jsonconf/models/cohere.jsonconf/models/cometapi.jsonconf/models/deepinfra.jsonconf/models/deepseek.jsonconf/models/futurmix.jsonconf/models/gitee.jsonconf/models/google.jsonconf/models/greenpt.jsonconf/models/groq.jsonconf/models/huaweicloud.jsonconf/models/huggingface.jsonconf/models/hunyuan.jsonconf/models/jiekouai.jsonconf/models/jina.jsonconf/models/longcat.jsonconf/models/minimax.jsonconf/models/mistral.jsonconf/models/moonshot.jsonconf/models/n1n.jsonconf/models/novita.jsonconf/models/nvidia.jsonconf/models/openai.jsonconf/models/openrouter.jsonconf/models/orcarouter.jsonconf/models/perplexity.jsonconf/models/ppio.jsonconf/models/qiniu.jsonconf/models/replicate.jsonconf/models/siliconflow.jsonconf/models/stepfun.jsonconf/models/togetherai.jsonconf/models/tokenhub.jsonconf/models/tokenpony.jsonconf/models/upstage.jsonconf/models/volcengine.jsonconf/models/xai.jsonconf/models/xiaomi.jsonconf/models/xunfei.jsonconf/models/zhipu-ai.jsoninternal/entity/models/model_test.go
- Remove meta-llama/llama-4-scout-17b-16e-instruct and qwen/qwen3-32b from groq.json (deprecated by Groq on 2026-07-17) - Fix Replicate Llama 4 max_output: 8192 → 131072 (provider supports max_tokens up to 131072) Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
MiniMax official API docs confirm all M2 series (M2/M2.1/M2.5/M2.7) have a context window of 204,800 tokens, not 1,000,000. Source: https://platform.minimax.io/docs/guides/text-generation Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
For models with conflicting values across provider files, use the most common value. 352 of 359 provider models match exactly; remaining 7 have conflicts within PR infiniflow#17836 itself. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Per official vendor documentation: - MiniMax M2/M2.1/M2.5/M2.7: max_output=128000 (not 131072/131100) - GLM-5.1: context_length=200000, max_output=128000 (not 204800/131072) Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The previous commit corrected conf/models/siliconflow.json GLM-5.1 to context_length=200000 / max_output=128000, but the test assertion still expected the old 204800/131072, breaking the Go unit-test CI jobs. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ow#17836 CI was failing because conf/all_models.json contained 53 case-insensitive duplicate entries (e.g. Qwen/Qwen3-Max vs qwen/qwen3-max) added during the provider-config alignment, which made InitProviderManager reject the catalog. - Remove the 53 duplicate entries; surviving canonical entries already cover them via case-insensitive alias lookup. - Align content_length/max_output of 32 kept entries with the official values verified in PR infiniflow#17836 (provider configs). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Summary
content_length(context window) andmax_output(max generation tokens) for all 478 chat/vision models across 47 provider configsWhy
PR #17807 introduced the
content_length/max_outputfields but many values were initial guesses. This PR replaces them with values verified against official docs.Key Corrections
Data Collection
Test
internal/entity/models/model_test.goassertions updatedgo test ./internal/entity/models/...passes