feat(models): add mainland-China vendor sections to the model catalog#259
Merged
Conversation
Extend the models.dev snapshot from the four native provider catalogs (105 models) to 13 sections (233 models), adding deepseek, zhipuai, moonshotai, minimax, stepfun, xiaomi, longcat, alibaba and tencent. These vendors have no app provider type of their own; their sections are consumed exclusively through findCatalogModelAcrossProviders, so models served via Anthropic/OpenAI-compatible relays under any provider type now resolve real context/output limits. - generate-model-catalog.mjs: replace the flat PROVIDERS list with SECTIONS. Each section unions one or more upstream keys (first source wins; CN endpoints preferred where both exist, e.g. alibaba-cn's qwen-max limits over the stale global entry). - Upstream contamination handled at generation time: Bailian (alibaba-cn) and tencent-coding-plan host third-party models (glm/kimi/MiniMax/deepseek) with platform-clamped limits. Ids are deduplicated case-insensitively across sections in declaration order — pure vendor-official catalogs first, contaminated platforms last — and aggregator-prefixed ids (siliconflow/…, kimi/…) are filtered out. Bailian-only historical deployments (deepseek-v3, deepseek-r1, distills) are kept intentionally: relays commonly serve those ids. - modelCatalog.ts (mirrored): the lookup index adds lowercase aliases so mixed-case catalog ids (MiniMax-M2.5, LongCat-2.0) match lowercase configs; generation-time lowercase dedup guarantees the aliases are unambiguous. - Tests: section keys/order and per-section quality gates locked to the generator's SECTIONS; global uniqueness upgraded to lowercase-uniqueness; cross-provider and settings-defaults cases for the new vendors. models.dev does not list Baidu ERNIE or ByteDance Doubao; those can be picked up by a snapshot refresh once upstream adds them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目标
在 #258 的跨供应商限额回查基础上,把国内主流厂商的模型元数据纳入目录:快照从 4 家 105 个模型扩展到 13 个分区 233 个模型。国内厂商没有对应的应用供应商类型,这些分区只经
findCatalogModelAcrossProviders消费——deepseek/glm/qwen/kimi 等模型经 Anthropic/OpenAI 兼容中转配在任一供应商类型下,都能解析出真实的上下文窗口与输出上限,应用侧无需新增供应商类型。新增分区
上游(models.dev)未收录百度文心与字节豆包,待上游补充后刷新快照即可获得。
关键设计
generate-model-catalog.mjs:PROVIDERS 平铺列表 → SECTIONS。每分区可并集多个上游 key(同厂商国内/国际站合并,首源优先;qwen-max 等两站限额不一致的以国内站为准)。siliconflow/…、kimi/…等聚合前缀 id 直接过滤。百炼独有且无冲突的 deepseek-v3/deepseek-r1 等历史部署 id 有意保留(中转常用这些 id,扩大命中面)。modelCatalog.ts,两端镜像):MiniMax-M2.5、LongCat-2.0 等混合大小写目录 id,小写配置也能命中;别名无歧义由生成期小写去重保证。测试
--check幂等通过;GUItest:frontend1222 通过、Webnpm test413 通过、两端tsc --noEmit与 biome 干净、check-mirror.mjs104 个文件一致。🤖 Generated with Claude Code