feat: add iFlytek MaaS provider - #7057
Open
dongjiang1989 wants to merge 1 commit into
Open
Conversation
Add iFlytek MaaS Inference API as a new provider, exposing both first-party Spark models and third-party models (DeepSeek, GLM, Kimi, MiniMax, Qwen) through an OpenAI-compatible endpoint. Provider: providers/iflytek/ - API: https://maas-api.cn-huabei-1.xf-yun.com/v2 - env: IFLYTEK_API_KEY - npm: @ai-sdk/openai-compatible Lab models (models/iflytek/): - spark-x2.5: 293B-A30B MoE flagship, 256K context - spark-x2-flash: lightweight fast model, 256K context - spark-x2.5-4b: 4B edge Dense, 1M context, open-weight - spark-x2.5-1.7b: 1.7B ultra-light edge, 1M context, open-weight Provider models (18 total): - iFlytek Spark: spark-x2.5, spark-x2-flash, spark-x2.5-4b, spark-x2.5-1.7b - DeepSeek: v4-pro, v4-flash, v3.2 - GLM/Zhipu: 5.2, 5.1, 5, 4.7-flash - Kimi/Moonshot: k2.6, k2.5 - MiniMax: m2.5 - Qwen/Alibaba: 3.5-397b-a17b, 3.6-35b-a3b, 3.5-35b-a3b, 3-coder-next Schema: add 'spark' to ModelFamily enum. Pricing converted from CNY at 7.25 CNY/USD with sources in TOML comments. Spark-X2.5-4B and Spark-X2.5-1.7B are limited-time free (cost = 0). Ref: PR anomalyco#5787 (SenseNova), https://www.xfyun.cn/doc/spark/推理服务-http.html Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Contributor
Action items
|
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.
Adds the iFlytek MaaS Inference API provider (讯飞星辰MaaS推理服务, https://maas.xfyun.cn) with 18 models — 4 first-party Spark and 14 third-party (DeepSeek, GLM, Kimi, MiniMax, Qwen).
providers/iflytek/provider.toml— OpenAI-compatible endpointhttps://maas-api.cn-huabei-1.xf-yun.com/v2, envIFLYTEK_API_KEYproviders/iflytek/logo.svg— squarecurrentColorglyphmodels/iflytek/spark-x2.5— 293B-A30B MoE flagship, 256K context, 200+ languages, code/agentic focus. Released 2026-09-07 (full inline definition; first-party lab)models/iflytek/spark-x2-flash— lightweight fast model, 256K contextmodels/iflytek/spark-x2.5-4b— 4B edge Dense, native 1M context, open-weight. Hybrid attention (1 full + 3 sliding window layers). Released 2026-09-01models/iflytek/spark-x2.5-1.7b— 1.7B ultra-light edge, native 1M context, open-weight. Released 2026-09-01deepseek-v4-pro/deepseek-v4-flash/deepseek-v3.2→base_model = "deepseek/..."glm-5.2/glm-5.1/glm-5/glm-4-7-flash→base_model = "zhipuai/..."kimi-k2.6/kimi-k2.5→base_model = "moonshotai/..."minimax-m2.5→base_model = "minimax/MiniMax-M2.5"qwen3.5-397b-a17b/qwen3.6-35b-a3b/qwen3.5-35b-a3b/qwen3-coder-next→base_model = "alibaba/..."Data sources (accessed 2026-09-14):
/v2/chat/completionsmessage.reasoning_content(interleaved). Spark-X2.5 / Spark-X2-Flash useenable_thinking(bool) + efforthigh/max; DeepSeek V3.2/V4 use effortnone|low|medium|high; GLM-5.x uses efforthigh|maxtoolson this hostSchema: added
"spark"to theModelFamilyenum inpackages/core/src/family.ts.Excluded: Token Plan API (
maas-token-api.../v2) and Coding Plan API (maas-coding-api.../v2) — separate subscription billing surfaces with distinct API keys and base URLs, could be added asiflytek-token-plan/iflytek-coding-planlater. Spark-X2 and Spark-X2-Agent are decommissioned per Token Plan docs (已下线).bun validatepasses locally (validated against currentdev).