Skip to content

feat: update all_models.json to content_length + max_output - #17839

Merged
JinHai-CN merged 15 commits into
infiniflow:mainfrom
jay77721:update-all-models-json
Aug 5, 2026
Merged

JinHai-CN merged 15 commits into
infiniflow:mainfrom
jay77721:update-all-models-json

Conversation

@jay77721

@jay77721 jay77721 commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Update conf/all_models.json: replace legacy max_tokens with content_length + max_output for all 2,178 chat/vision models, with values verified against official vendor documentation.

Changes

Config

  • Field migration: max_tokens → content_length + max_output (2,178 entries)
  • Data alignment: Sync with PR feat: populate content_length and max_output from official docs #17836 provider configs (352 models match exactly)
  • Official values: Correct MiniMax M2 series (mo=128000) and GLM-5.1 (cl=200000, mo=128000) per vendor docs
  • DeepSeek V4: Fix max_output from 1048576 → 393216 (official spec: 384K)
  • New entries: Add 129 models from provider configs that were missing

Documentation

  • New file: conf/model.md — comprehensive configuration reference
    • JSON field documentation with examples
    • Decimal vs. binary conventions per vendor (with sources)
    • Aggregator platforms list (inherit from upstream)
    • Quick reference (model_types, token rules, validation)
    • Troubleshooting guide

Tests

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

Vendor Convention Reference

Convention Vendors
Binary (powers of 2) OpenAI, Google, Meta, NVIDIA, DeepSeek, Qwen, Kimi, Mistral
Decimal (powers of 10) Anthropic, xAI, GLM/Zhipu, MiniMax, Cohere, Baichuan, Amazon

See conf/model.md for full details and source links.

Replace max_tokens with content_length + max_output (2178 entries).
Fix deepseek v4 max_output: 1048576 → 393216 (official spec: 384K).

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

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added conf/model.md as a reference for model fields, capacity limits, vendor conventions, aggregator handling, catalog maintenance, validation, and troubleshooting. Updated the Gitee model test to require MaxOutput value 393216 for the DeepSeek V4 Pro alias.

Changes

Model configuration

Layer / File(s) Summary
Model fields and capacity limits
conf/model.md
Documents model JSON fields and distinguishes content_length from max_output, including migration from max_tokens.
Limit conventions and catalog maintenance
conf/model.md
Documents numeric conventions, vendor sources, aggregator limits, catalog procedures, validation checks, and troubleshooting steps.
Gitee output limit assertion
internal/entity/models/gitee_test.go
Requires the DeepSeek V4 Pro alias to have a non-nil MaxOutput value of 393216.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Poem

A rabbit checks the model guide,
With exact limits side by side.
DeepSeek’s output value is clear,
The catalog test confirms it here.
Clean fields hop from ear to ear.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main configuration migration to content_length and max_output in all_models.json.
Description check ✅ Passed The description includes the required Summary section and provides clear context, changes, documentation, tests, and vendor conventions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@jay77721 jay77721 added the ci Continue Integration label Aug 5, 2026
@jay77721
jay77721 marked this pull request as draft August 5, 2026 05:02
@jay77721
jay77721 marked this pull request as ready for review August 5, 2026 05:02
jay77721 and others added 2 commits August 5, 2026 13:05
Sync max_output values to match verified provider configs from
model-config-content-length branch. Fixes 311 field mismatches.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Explain JSON field conventions (content_length, max_output, etc.),
document decimal vs. binary conventions per vendor, and provide
guidance for contributors adding or updating model configs.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Aug 5, 2026
Add Tencent Hunyuan, Xiaomi MiMo, HuggingFace, and full Bedrock
coverage. Add 'Aggregators & Platforms' section listing 27 platforms
that inherit values from upstream model creators.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 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/model.md`:
- Around line 55-57: Update the Decimal (base-10) row in the convention table to
describe the examples as base-10 or vendor-defined rounded values, rather than
claiming they are powers of 10. Preserve the existing examples unless needed for
accuracy.
- Line 60: Update the power-of-two test in the quick test description to state
that n must be a positive integer, and parenthesize the bitwise expression so
the condition explicitly requires n > 0 alongside n & (n-1) == 0.
- Line 23: Update the fenced diagram block in model.md to specify the text
language identifier, changing the opening fence to use text and preserving the
diagram content unchanged.
- Around line 64-90: Update the vendor convention table in the documentation to
avoid asserting uniform binary or decimal rules where catalogs contain
exceptions, including OpenAI’s 1,050,000 and xAI’s 500K limits. Replace the
convention columns with model-specific examples that reflect each documented
value, or remove unsupported vendor-wide convention claims while preserving the
exact-number guidance.
🪄 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: 6d60bc51-cd2c-46ba-8ee8-b7bdf31fee8b

📥 Commits

Reviewing files that changed from the base of the PR and between f057544 and 8edb39f.

📒 Files selected for processing (2)
  • conf/all_models.json
  • conf/model.md

Comment thread conf/model.md Resolved
Comment thread conf/model.md Resolved
Comment thread conf/model.md Resolved
Comment thread conf/model.md Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
conf/model.md (1)

81-84: 🗄️ Data Integrity & Integration | 🟠 Major

Keep vendor limits model-specific.

These rows still describe platforms or model families as if each has one limit convention. This can mislead updates to conf/all_models.json, which stores content_length and max_output independently.

  • Line 81: Amazon Nova documents different limits for Premier, Pro, Lite, and Micro. Current specifications include 1M, 300K, and 128K context windows, with a 10K maximum output. The 128K, 300K and 5K values are not a complete model mapping. (docs.aws.amazon.com)
  • Line 82: Perplexity exposes Sonar and third-party OpenAI, Anthropic, Google, and xAI models. A single Perplexity convention cannot describe all of these models. (docs.perplexity.ai)
  • Lines 83-84: Map Tencent Hunyuan and Xiaomi MiMo values to named models. Xiaomi's official model cards already show different limits, including 262,144 for MiMo-V2-Flash and 1M for MiMo-V2.5. (huggingface.co)

Replace these rows with model-specific examples or Varies, and link each exact model specification.

Proposed direction
-| **Amazon (Bedrock / Nova)** | Decimal (128K, 300K) | Decimal (5K) | ...
-| **Perplexity** | Decimal (128K, 200K) | Binary (128K) | ...
-| **Tencent (Hunyuan)** | Decimal (32K, 131K, 262K) | Decimal (8K, 64K) | ...
-| **Xiaomi (MiMo)** | Binary (1M) | Binary (8K) | ...
+| **Amazon (Nova)** | Model-specific | Model-specific | ...
+| **Perplexity** | Model-specific | Model-specific | ...
+| **Tencent (Hunyuan)** | Model-specific | Model-specific | ...
+| **Xiaomi (MiMo)** | Model-specific | Model-specific | ...
🤖 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/model.md` around lines 81 - 84, Update the Amazon (Bedrock / Nova),
Perplexity, Tencent (Hunyuan), and Xiaomi (MiMo) rows in the model-limits table
to use named model-specific entries or “Varies” rather than aggregated
vendor-level limits. Ensure each listed content_length and max_output value maps
to the corresponding model in conf/all_models.json, and link every exact
specification to its authoritative model documentation.
🤖 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.

Duplicate comments:
In `@conf/model.md`:
- Around line 81-84: Update the Amazon (Bedrock / Nova), Perplexity, Tencent
(Hunyuan), and Xiaomi (MiMo) rows in the model-limits table to use named
model-specific entries or “Varies” rather than aggregated vendor-level limits.
Ensure each listed content_length and max_output value maps to the corresponding
model in conf/all_models.json, and link every exact specification to its
authoritative model documentation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 01165ac1-9cc5-4303-83a1-f7000aa93a4f

📥 Commits

Reviewing files that changed from the base of the PR and between 8edb39f and 7a65b73.

📒 Files selected for processing (1)
  • conf/model.md

jay77721 and others added 3 commits August 5, 2026 13:18
- Kimi: max_output is dynamic (context - input_tokens), not fixed 128K
- DeepSeek: note 'varies by model' instead of implying uniformity
- GLM: use exact integers (128000, 204800) instead of ambiguous '128K'
- Add dynamic max_output explanation to field description

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Fix minimax m2 series, grok-4, z-ai/glm-5.1 to match provider configs
- Add 129 models from provider configs that were missing from
  all_models.json
- 352 of 359 provider models now match exactly (98%)

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]>
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.65%. Comparing base (bdcd8aa) to head (d9933ff).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17839   +/-   ##
=======================================
  Coverage   90.65%   90.65%           
=======================================
  Files          10       10           
  Lines         717      717           
  Branches      118      118           
=======================================
  Hits          650      650           
  Misses         39       39           
  Partials       28       28           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

jay77721 and others added 4 commits August 5, 2026 13:51
x-ai/grok-4.3 had stale aliases claiming to be grok-3/grok-3-fast/
grok-3-mini, causing incorrect model matching. Remove those aliases
so grok-3 maps to its own entry (cl=131072).

Remaining 4 mismatches are MiniMax/Zhipu values that cannot be
verified (official docs network unreachable).

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 16384/196608)
- GLM-5.1: context_length=200000, max_output=128000

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Uncomment the assertion for deepseek-v4-pro max_output (393216).
Note: Test reveals a pre-existing duplicate alias issue for
Qwen/Qwen3-Max that needs separate fixing.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Add table of contents for navigation
- Add concrete JSON example for a complete model entry
- Add Thinking and Tools object structure documentation
- Add dynamic max_output explanation to relationship diagram
- Add Quick Reference section (model_types, token rules, validation cmd)
- Add Troubleshooting section (duplicate alias, not found, mismatch)
- Fix MiniMax values in vendor table (204800, 128000)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
conf/model.md (1)

22-35: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Document the embedding-specific fields.

The runtime Model schema also exposes max_dimension and dimensions for embedding models. The table says entries support the listed fields, but it omits both fields. Add them, or state that this table is intentionally partial.

Proposed fix
 | `class` | string | No | Provider-specific model class used to select the correct driver (e.g. `glm`, `kimi`). |
+| `max_dimension` | integer | No | Maximum supported embedding dimension. |
+| `dimensions` | integer[] | No | Supported embedding dimensions. |
 | `alias` | string[] | No | Alternative names for the same model. Used for model lookup when a tenant refers to the model by an alias. **Must be unique across all models.** |
🤖 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/model.md` around lines 22 - 35, Update the model-entry field table in
the surrounding documentation to include the embedding-specific max_dimension
and dimensions fields exposed by the runtime Model schema, including their
types, optionality, and purpose; keep the existing field descriptions 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/model.md`:
- Around line 56-60: Update the JSON examples containing inline // comments
under the thinking and tools sections to use jsonc fences, preserving the
existing example content and explanations.
- Line 28: Update the max_output description in the model configuration
documentation so the statement about fixed vendor limits or dynamic calculation
is a complete sentence, while preserving its existing meaning and references.
- Around line 102-108: Update the Migration Note for the split `max_tokens`
fields to explicitly require every migrated model to define both
`content_length` and `max_output`. State that each value must come from the
official vendor model specification, preserving the existing mapping and
distinction between context window and generation cap.

---

Outside diff comments:
In `@conf/model.md`:
- Around line 22-35: Update the model-entry field table in the surrounding
documentation to include the embedding-specific max_dimension and dimensions
fields exposed by the runtime Model schema, including their types, optionality,
and purpose; keep the existing field descriptions 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: 36b9570f-28fb-48b8-b4ec-ee4b91d02cf9

📥 Commits

Reviewing files that changed from the base of the PR and between daf4061 and f16e6ee.

📒 Files selected for processing (3)
  • conf/all_models.json
  • conf/model.md
  • internal/entity/models/gitee_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/entity/models/gitee_test.go

Comment thread conf/model.md Resolved
Comment thread conf/model.md Resolved
Comment thread conf/model.md Resolved
jay77721 and others added 2 commits August 5, 2026 14:38
- Add `text` fence to field relationship diagram (MD040)
- Complete max_output description as a full sentence
- Use `jsonc` fences for JSON examples with inline comments
- Require both content_length and max_output in migration note

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]>
@jay77721
jay77721 marked this pull request as draft August 5, 2026 07:09
@jay77721
jay77721 marked this pull request as ready for review August 5, 2026 07:09
@jay77721 jay77721 added ci Continue Integration and removed ci Continue Integration labels Aug 5, 2026
jay77721 and others added 2 commits August 5, 2026 15:27
validateEmbeddingDimension (model_service.go) accepts any requested
dimension up to max_dimension when the dimensions array is empty;
a non-empty array requires an exact match. Update the field table to
match the actual runtime behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@JinHai-CN
JinHai-CN merged commit 40ff1c9 into infiniflow:main Aug 5, 2026
3 checks passed
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Aug 5, 2026
After the all_models.json migration (PR infiniflow#17839) a chat model has both
content_length (context window) and max_output (generation cap). The
knowledge_compiler prompt-budget helpers (wikiMapMaxTokens,
deriveWikiPlanBudget, buildClusterContent) need the context window, but
the wiring fed them max_output, which collapsed the per-chunk input
quotas (e.g. raptor's (max_output - max_token) / n ~= 0).

- Add ModelProviderService.ResolveModelContextLength to read the model's
  content_length from the factory catalog (accepts a tenant model UUID or
  a model@instance@provider composite name; unknown -> 0 so callers fall
  back to the default window).
- Wire the compiler's deps.ModelContextLen from content_length instead of
  ResolveModelConfig's max_output.
- Rename the budget parameter/field to modelContextLen / ModelContextLen
  across wiki, raptor and deps for a consistent naming style.
- Add service tests covering the UUID and composite resolution paths plus
  the unknown-model fallback.
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Aug 5, 2026
After the all_models.json migration (PR infiniflow#17839) a chat model has both
content_length (context window) and max_output (generation cap). The
knowledge_compiler prompt-budget helpers (wikiMapMaxTokens,
deriveWikiPlanBudget, buildClusterContent) need the context window, but
the wiring fed them max_output, which collapsed the per-chunk input
quotas (e.g. raptor's (max_output - max_token) / n ~= 0).

- Add ModelProviderService.ResolveModelContextLength to read the model's
  content_length from the factory catalog (accepts a tenant model UUID or
  a model@instance@provider composite name; unknown -> 0 so callers fall
  back to the default window).
- Wire the compiler's deps.ModelContextLen from content_length instead of
  ResolveModelConfig's max_output.
- Rename the budget parameter/field to modelContextLen / ModelContextLen
  across wiki, raptor and deps for a consistent naming style.
- Add service tests covering the UUID and composite resolution paths plus
  the unknown-model fallback.
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Aug 5, 2026
After the all_models.json migration (PR infiniflow#17839) a chat model has both
content_length (context window) and max_output (generation cap). The
knowledge_compiler prompt-budget helpers (wikiMapMaxTokens,
deriveWikiPlanBudget, buildClusterContent) need the context window, but
the wiring fed them max_output, which collapsed the per-chunk input
quotas (e.g. raptor's (max_output - max_token) / n ~= 0).

- Add ModelProviderService.ResolveModelContextLength to read the model's
  content_length from the factory catalog (accepts a tenant model UUID or
  a model@instance@provider composite name; unknown -> 0 so callers fall
  back to the default window).
- Wire the compiler's deps.ModelContextLen from content_length instead of
  ResolveModelConfig's max_output.
- Rename the budget parameter/field to modelContextLen / ModelContextLen
  across wiki, raptor and deps for a consistent naming style.
- Add service tests covering the UUID and composite resolution paths plus
  the unknown-model fallback.
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Aug 5, 2026
After the all_models.json migration (PR infiniflow#17839) a chat model has both
content_length (context window) and max_output (generation cap). The
knowledge_compiler prompt-budget helpers (wikiMapMaxTokens,
deriveWikiPlanBudget, buildClusterContent) need the context window, but
the wiring fed them max_output, which collapsed the per-chunk input
quotas (e.g. raptor's (max_output - max_token) / n ~= 0).

- Add ModelProviderService.ResolveModelContextLength to read the model's
  content_length from the factory catalog (accepts a tenant model UUID or
  a model@instance@provider composite name; unknown -> 0 so callers fall
  back to the default window).
- Wire the compiler's deps.ModelContextLen from content_length instead of
  ResolveModelConfig's max_output.
- Rename the budget parameter/field to modelContextLen / ModelContextLen
  across wiki, raptor and deps for a consistent naming style.
- Add service tests covering the UUID and composite resolution paths plus
  the unknown-model fallback.
@jay77721
jay77721 deleted the update-all-models-json branch August 6, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants