Skip to content

update model categories' match rules - #2239

Merged
seefs001 merged 1 commit into
QuantumNous:mainfrom
QAbot-zh:modelCategories-update
Nov 17, 2025
Merged

update model categories' match rules#2239
seefs001 merged 1 commit into
QuantumNous:mainfrom
QAbot-zh:modelCategories-update

Conversation

@QAbot-zh

@QAbot-zh QAbot-zh commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

更新部分模型的供应商匹配规则,减少误匹配情况,如下图:

Image_2025-11-17_15-01-23_jdf41omb t5a

Summary by CodeRabbit

  • Improvements
    • Enhanced model categorization and filtering across multiple AI providers (OpenAI, Gemini, Moonshot, Zhipu, MiniMax, Cohere, Mistral, and others).
    • Expanded support for additional model types and variants, improving model discovery and organization.
    • Restored and refined categorization for select model families, ensuring accurate organization and accessibility.

@coderabbitai

coderabbitai Bot commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The changes expand and refine model category filtering logic across multiple AI vendors to classify additional model variants, new model series, and broader prefix patterns. This includes updated classifications for OpenAI, Gemini, Moonshot, Zhipu, MiniMax, Cohere, Mistral, and restored support for Yi category filtering.

Changes

Cohort / File(s) Summary
Model Category Filtering
web/src/helpers/render.jsx
Expanded vendor-specific model classification filters: OpenAI (tts-1, text-embedding-3, text-moderation); Gemini (gemma, learnlm, embedding, imagen-4, veo, aqa); Moonshot (kimi); Zhipu (cogview, cogvideo); MiniMax (minimax); Cohere (c4ai-, embed-); Mistral (codestral, pixtral, voxtral, magistral); Yi category support added/restored.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Areas requiring extra attention:

  • Verify each vendor's new model prefix classifications align with current model naming conventions
  • Ensure Yi category filtering logic doesn't conflict with existing categories
  • Test that expanded prefix matching (e.g., startsWith('embedding-')) doesn't incorrectly classify models
  • Check for any unintended overlaps between vendor-specific filters

Poem

🐰 More models hop into view,
With filters refined, all shiny and new!
From Yi to Mistral, they all find their place,
Classification magic at lightning pace! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'update model categories' match rules' directly describes the main change in the changeset, which involves expanding and refining model category filtering logic across multiple AI vendors.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@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: 0

🧹 Nitpick comments (2)
web/src/helpers/render.jsx (2)

164-176: Gemini filter: confirm embedding- prefix won’t match non‑Gemini models

The expanded conditions (gemini/gemma/learnlm/text-embedding-004/imagen-4/veo-/aqa) look aligned with Google’s current model families. The one potential risk is startsWith('embedding-'), which will classify any model named like embedding-* as Gemini; this is fine only if your catalog guarantees that prefix is unique to Gemini embeddings.

If you do have non‑Gemini models whose names start with embedding-, consider tightening this to a more vendor-specific pattern (e.g. a known full prefix) or switching to an explicit allowlist of Gemini embedding model IDs.


278-282: Yi category: includes('yi') may be too broad; consider tightening

Introducing a dedicated Yi category is useful, but model.model_name.toLowerCase().includes('yi') is very short and may accidentally match unrelated models if any happen to contain yi in the middle of their IDs (e.g., custom names or future vendors).

If your catalog allows, consider tightening this match—e.g. restricting to a prefix like name.startsWith('yi-') or another known Yi-specific pattern—so you don’t reintroduce vendor misclassification issues.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7598753 and 8b8511b.

📒 Files selected for processing (1)
  • web/src/helpers/render.jsx (6 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-27T02:15:25.448Z
Learnt from: AAEE86
Repo: QuantumNous/new-api PR: 1658
File: web/src/components/table/channels/modals/EditChannelModal.jsx:555-569
Timestamp: 2025-08-27T02:15:25.448Z
Learning: In EditChannelModal.jsx, the applyModelMapping function transforms the models list by replacing original model names (mapping values) with display names (mapping keys). The database stores this transformed list containing mapped keys. On channel load, data.models contains these mapped display names, making the initialization filter if (data.models.includes(key)) correct.

Applied to files:

  • web/src/helpers/render.jsx
🔇 Additional comments (6)
web/src/helpers/render.jsx (6)

141-158: OpenAI filter: narrower match patterns look correct

Switching from generic tts / text- style checks to specific tts-1, text-embedding-3, and text-moderation strings is consistent with current OpenAI model naming and should significantly reduce false OpenAI matches. No issues spotted with this logic.


177-183: Moonshot filter: Kimi inclusion is reasonable

Including both moonshot and kimi in the same filter matches how Moonshot brands its Kimi models and should help surface them under the expected category. Logic and syntax look fine.


184-192: Zhipu filter: extended coverage for GLM / CogView / CogVideo

Adding matches for glm-, cogview, and cogvideo alongside chatglm appropriately expands Zhipu coverage to their newer chat and multimodal series. The conditions remain specific enough that they’re unlikely to capture unrelated vendors.


203-209: MiniMax filter: explicit minimax match improves robustness

Combining the existing abab check with an explicit minimax substring is a sensible way to catch both legacy and clearly branded MiniMax models. No obvious risk of over-matching here.


230-237: Cohere filter: expanded patterns align with Cohere model naming

The added checks for c4ai- (Cohere for AI / Aya) and embed- align with Cohere’s public model IDs (e.g. embed-english-*, embed-multilingual-*). Given OpenAI and others don’t typically use an embed- prefix, this looks like a safe and accurate broadening.


253-262: Mistral filter: future‑proofing for new series

Covering mistral, codestral, pixtral, voxtral, and magistral gives good forward compatibility with Mistral’s current and announced series, and the substrings are niche enough that accidental matches should be rare. Implementation looks correct.

@seefs001
seefs001 merged commit ff839df into QuantumNous:main Nov 17, 2025
1 check passed
ennnnny pushed a commit to ennnnny/new-api that referenced this pull request Mar 17, 2026
salem-2007 added a commit to salem-2007/new-api that referenced this pull request Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants