Skip to content

feat: add iFlytek MaaS provider - #7057

Open
dongjiang1989 wants to merge 1 commit into
anomalyco:devfrom
dongjiang1989:add-iflytek-provider
Open

feat: add iFlytek MaaS provider#7057
dongjiang1989 wants to merge 1 commit into
anomalyco:devfrom
dongjiang1989:add-iflytek-provider

Conversation

@dongjiang1989

Copy link
Copy Markdown

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 endpoint https://maas-api.cn-huabei-1.xf-yun.com/v2, env IFLYTEK_API_KEY
  • providers/iflytek/logo.svg — square currentColor glyph
  • models/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 context
  • models/iflytek/spark-x2.5-4b — 4B edge Dense, native 1M context, open-weight. Hybrid attention (1 full + 3 sliding window layers). Released 2026-09-01
  • models/iflytek/spark-x2.5-1.7b — 1.7B ultra-light edge, native 1M context, open-weight. Released 2026-09-01
  • deepseek-v4-pro / deepseek-v4-flash / deepseek-v3.2base_model = "deepseek/..."
  • glm-5.2 / glm-5.1 / glm-5 / glm-4-7-flashbase_model = "zhipuai/..."
  • kimi-k2.6 / kimi-k2.5base_model = "moonshotai/..."
  • minimax-m2.5base_model = "minimax/MiniMax-M2.5"
  • qwen3.5-397b-a17b / qwen3.6-35b-a3b / qwen3.5-35b-a3b / qwen3-coder-nextbase_model = "alibaba/..."

Data sources (accessed 2026-09-14):

  • https://www.xfyun.cn/doc/spark/%E6%8E%A8%E7%90%86%E6%9C%8D%E5%8A%A1-http.html — Inference API HTTP protocol; OpenAI-compatible chat completions at /v2/chat/completions
  • https://www.xfyun.cn/doc/spark/TokenPlan.html — model IDs and Token Plan point pricing
  • https://maas.xfyun.cn/modelSquare — per-model pay-as-you-go listing
  • Reasoning: all models return message.reasoning_content (interleaved). Spark-X2.5 / Spark-X2-Flash use enable_thinking (bool) + effort high/max; DeepSeek V3.2/V4 use effort none|low|medium|high; GLM-5.x uses effort high|max
  • Tool calling: per host docs, only DeepSeek V3.2 and GLM-4.7 series support tools on this host
  • Pricing: USD per million tokens, converted from CNY at 7.25 CNY/USD. Spark-X2.5 at CNY 3.2/0.48/12 (limited-time 50% off: 1.6/0.24/6); Spark-X2.5-4B/1.7B currently limited-time free (cost = 0); others derived from Token Plan points at ~0.01 CNY/point

Schema: added "spark" to the ModelFamily enum in packages/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 as iflytek-token-plan / iflytek-coding-plan later. Spark-X2 and Spark-X2-Agent are decommissioned per Token Plan docs (已下线).

bun validate passes locally (validated against current dev).

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>
@dongjiang1989 dongjiang1989 changed the title feat: add iFlytek (讯飞星辰 MaaS) provider feat: add iFlytek MaaS provider Sep 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/iflytek/models/deepseek-v4-pro.toml:14 - Check: Relay reasoning_options must follow the lab/same-surface baseline for that model (DeepSeek V4: toggle + high/max, not invented L/M/H). Why: First-party providers/deepseek/models/deepseek-v4-pro.toml and established relays (e.g. alibaba-cn, scnet-token-plan, SenseNova) use toggle + high/max. This file authors effort = none|low|medium|high, which invents graded L/M/H the lab maps away and drops the native on/off control. The same shape is repeated on deepseek-v4-flash.toml. Action: Re-author both V4 entries to the host-real intersection with the lab baseline (typically toggle + high/max, or none+high+max only if this host’s sole off switch is reasoning_effort=none); document the exact wire path in a leading comment; do not list low/medium if they collapse to high.
  • [high] [violation] providers/iflytek/models/kimi-k2.6.toml:8 - Check: Kimi reasoning controls must match lab/peer baseline (toggle), not a generic GPT-style effort enum. Why: Lab Moonshot and peers (OpenRouter, Cortecs, Alibaba CN) expose a thinking toggle only. These files invent none|low|medium|high on both kimi-k2.6 and kimi-k2.5, contradicting AGENTS.md baseline rules for relays. Action: Replace with host-verified Kimi controls (almost certainly { type = "toggle" } plus a leading # Toggle: … wire comment), or prove this API uniquely grades Kimi effort.
  • [high] [violation] providers/iflytek/models/minimax-m2.5.toml:8 - Check: Do not invent caller reasoning controls when the lab/peers document none. Why: providers/minimax/models/MiniMax-M2.5.toml and peer relays use reasoning_options = [] (always-on / no control). iFlytek invents none|low|medium|high. Action: Use [] unless this host’s docs/API show a real MiniMax reasoning knob; if they do, cite the wire field and match only real values.
  • [high] [violation] providers/iflytek/models/qwen3.5-397b-a17b.toml:8 - Check: Qwen reasoning_options must follow lab/same-surface controls (toggle + often budget_tokens), not invented L/M/H. Why: First-party Alibaba entries for qwen3.5-397b-a17b, qwen3.6-35b-a3b, and qwen3.5-35b-a3b use toggle + budget_tokens. These three iFlytek files invent none|low|medium|high and omit toggle/budget. Action: Align each Qwen entry to what this host actually forwards (lab-like enable_thinking / thinking_budget, or a documented host-only surface); stop publishing an unsupported L/M/H enum.
  • [high] [violation] providers/iflytek/models/deepseek-v4-pro.toml:13 - Check: Provider capabilities must reflect this host, including tool_call overrides when the host disables tools. Why: PR body, design note, and model comments state tools work only for DeepSeek V3.2 and GLM-4.7 series, but every other third-party entry inherits tool_call = true from lab metadata (DeepSeek V4, GLM-5.x, Kimi, MiniMax, Qwen). Catalog consumers would wrongly assume tool use works. Action: Set tool_call = false on every iFlytek model the host does not support tools for; keep true only where host docs confirm it.
  • [medium] [possible mistake] providers/iflytek/models/glm-5.1.toml:8 - Check: GLM-5.1 / GLM-5 effort set vs lab baseline. Why: First-party Zhipu entries use toggle only for GLM-5.1 and GLM-5; only GLM-5.2 is high/max. iFlytek copies high/max onto 5.1 and 5 without a clear host-vs-lab delta. Action: Verify iFlytek’s wire controls per model ID; use toggle (with leading wire comment) if that is what the API exposes, or keep high/max only with host evidence that those models accept graded effort here.
  • [medium] [possible mistake] providers/iflytek/models/glm-4-7-flash.toml:9 - Check: GLM-4.7-Flash reasoning_options baseline. Why: Lab marks reasoning = true; solid peers use [] (no caller control). This file invents none|low|medium|high while the design note says “none.” Action: Confirm host behavior and set [], toggle-only, or a proven effort list—do not ship an unverified L/M/H enum.
  • [medium] [possible mistake] providers/iflytek/models/deepseek-v3.2.toml:10 - Check: DeepSeek V3.2 options should match this host and peers, not a default L/M/H dump. Why: File comments say reasoning_effort = low|medium|high, but values also include none; common peers use toggle only or L/M/H without none. Action: Author the exact host surface (toggle vs effort, and whether none is valid) and drop values the API does not honor.
  • [medium] [possible mistake] providers/iflytek/models/kimi-k2.5.toml:3 - Check: Host context limits must override inherited lab limits when they differ. Why: Leading comments claim smaller contexts than lab metadata (e.g. Kimi K2.5 128K vs lab 262K; MiniMax 128K vs 204.8K; Qwen 35B variants 128K vs 262K; GLM-4.7-Flash 128K vs 200K) but no [limit] overrides are written, so merge keeps the larger lab contexts. Action: Either add accurate host [limit] overrides or correct the comments if the lab limits apply on this API.
  • [low] [possible mistake] providers/iflytek/models/deepseek-v3.2.toml:6 - Check: Material costs should be tied to direct pay-as-you-go evidence, not only Token Plan point estimates. Why: Several third-party prices are labeled “estimated” / Token Plan ratio conversions; Spark-X2-Flash is also estimated. That weakens review of USD/MTok figures even with the 7.25 CNY rate noted. Action: Prefer model-square or published CNY/MTok list prices per model in the PR body/TOML header (what each URL supports), and mark remaining estimates explicitly if no list price exists.

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.

1 participant