Skip to content

feat: bridge content_length/max_output to max_tokens paths - #17838

Closed
jay77721 wants to merge 4 commits into
infiniflow:mainfrom
jay77721:model-config-bridge-max-output
Closed

jay77721 wants to merge 4 commits into
infiniflow:mainfrom
jay77721:model-config-bridge-max-output

Conversation

@jay77721

@jay77721 jay77721 commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

Bridge the new content_length / max_output fields to existing max_tokens / max_length read paths in both Go and Python.

Changes

Config files

  • conf/all_models.json: max_tokens → content_length + max_output (2178 entries)
  • conf/llm_factories.json: max_tokens → content_length + max_output (940 entries)
  • Fix deepseek v4 max_output: 1048576 → 393216 (official spec: 384K)

Python

  • resolve_model_config(): reads max_output from factory info when max_tokens absent
  • LLMBundle.__init__(): falls back to max_output if max_tokens absent

Tests

  • Restore gitee_test.go assertion for deepseek-v4-pro max_output (393216)

Why

PR #17807 split max_tokens into content_length + max_output but didn't update the read paths. This caused:

  • 302ai LLMBundle.max_length to fall back to 8192
  • Python resolve_model_config() to miss the new fields

🤖 Generated with Claude Code

jay77721 and others added 3 commits August 5, 2026 11:54
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]>
- 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]>
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c3260d0a-9bdf-4812-93ff-42d63955fbfb

📥 Commits

Reviewing files that changed from the base of the PR and between f057544 and 82ebcd1.

📒 Files selected for processing (49)
  • conf/all_models.json
  • conf/models/302ai.json
  • conf/models/aliyun.json
  • conf/models/anthropic.json
  • conf/models/astraflow.json
  • conf/models/avian.json
  • conf/models/baichuan.json
  • conf/models/baidu.json
  • conf/models/bedrock.json
  • conf/models/cohere.json
  • conf/models/cometapi.json
  • conf/models/deepinfra.json
  • conf/models/deepseek.json
  • conf/models/futurmix.json
  • conf/models/gitee.json
  • conf/models/google.json
  • conf/models/greenpt.json
  • conf/models/groq.json
  • conf/models/huaweicloud.json
  • conf/models/huggingface.json
  • conf/models/hunyuan.json
  • conf/models/jiekouai.json
  • conf/models/jina.json
  • conf/models/longcat.json
  • conf/models/minimax.json
  • conf/models/mistral.json
  • conf/models/moonshot.json
  • conf/models/n1n.json
  • conf/models/novita.json
  • conf/models/nvidia.json
  • conf/models/openai.json
  • conf/models/openrouter.json
  • conf/models/orcarouter.json
  • conf/models/perplexity.json
  • conf/models/ppio.json
  • conf/models/qiniu.json
  • conf/models/replicate.json
  • conf/models/siliconflow.json
  • conf/models/stepfun.json
  • conf/models/togetherai.json
  • conf/models/tokenhub.json
  • conf/models/tokenpony.json
  • conf/models/upstage.json
  • conf/models/volcengine.json
  • conf/models/xai.json
  • conf/models/xiaomi.json
  • conf/models/xunfei.json
  • conf/models/zhipu-ai.json
  • internal/entity/models/model_test.go
🔥 Files not summarized due to errors (1)
  • conf/all_models.json: Server error: no LLM provider could handle the message

📝 Walkthrough

Walkthrough

This PR updates model metadata across provider configuration files. It replaces max_tokens with content_length and max_output, adds missing limits, adjusts model capabilities, and updates PPIO and SiliconFlow validation tests.

Changes

Model limit metadata

Layer / File(s) Summary
Provider model limit metadata
conf/models/*.json
Provider catalogs now define separate content_length and max_output values. Limits vary by model and provider.
Catalog validation tests
internal/entity/models/model_test.go
PPIO and SiliconFlow tests now validate both content length and maximum output values.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: ☯️ refactor

Suggested reviewers: haruko386, jinhai-cn

Poem

I hop through catalogs, tidy and bright,
Splitting one limit into two just right.
Context grows wide, outputs stay clear,
Tests check the numbers we hold dear.
— A rabbit reviews with a twitching ear 🐇


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Replace max_tokens with content_length + max_output (2178 entries).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@jay77721
jay77721 force-pushed the model-config-bridge-max-output branch from 7a04db8 to 82ebcd1 Compare August 5, 2026 04:54
@jay77721 jay77721 added the ci Continue Integration label Aug 5, 2026
@jay77721

jay77721 commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

Superseded by new PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant