[Feature] Add iFLYTEK Astron MaaS (Spark X2.5) as a named LLM provider

Author: FenjuFuCreated Sep 29, 2026Updated Sep 29, 2026

Before filing

What problem does this solve?

When I want to use iFLYTEK's Spark models for Cinematic/Autofit translation, I can't pick them in Settings → LLM Providers. The only route today is the Custom provider, where I have to find the right base URL on my own.

That URL is easy to get wrong. iFLYTEK has several endpoints that look alike but don't share keys:

  • https://maas-api.cn-huabei-1.xf-yun.com/v2: Astron MaaS inference service (pay as you go), OpenAI-compatible, Bearer key
  • https://maas-token-api.cn-huabei-1.xf-yun.com/v2: Astron MaaS Token Plan, which needs its own key
  • https://spark-api-open.xf-yun.com/v1: the older Spark HTTP API, which uses a per-model APIPassword and returns AppIdNoAuthError for a MaaS key

Mixing them up gives a 401 or AppIdNoAuthError with no hint about the cause.

The registry already lists other CJK-strong providers (Qwen, Moonshot, MiniMax, Z.AI, SiliconFlow), but iFLYTEK isn't one of them. Spark X2.5 supports 200+ languages, which suits dubbing translation.

Proposed solution

  1. Add a named iflytek provider (iFLYTEK Astron MaaS) to backend/services/llm_providers.py. It would work like moonshot / minimax / zai:
    • default base URL: https://maas-api.cn-huabei-1.xf-yun.com/v2
    • env: IFLYTEK_API_KEY, IFLYTEK_BASE_URL, IFLYTEK_MODEL
    • no built-in default model. MaaS model IDs are taken from each service's model card, and some deployments use their own IDs. Model listing or a manual entry covers this, the same way it does for Moonshot/MiniMax/Z.AI.
    • the notes would point Token Plan users to the maas-token-api base URL, because the two keys aren't interchangeable.
  2. Update the docs in docs/dubbing/translation-engines.md, and mention the fully offline route. The open-weight Spark-X2.5 4B / 1.7B models are published on Ollama (SparkLLM/Spark-X2.5-4B) and LM Studio. They work with the existing Ollama / LM Studio providers and need no code change here. Its template prefills <think>, which the translation paths don't strip yet; that is tracked separately in #2420.
  3. Add a registry test and a contract test, a Settings search keyword, and a CHANGELOG line.

This change only adds configuration, following the OrcaRouter pattern (#1499). It uses the existing OpenAI-compatible transport and adds no dependency. Nothing is sent to iFLYTEK unless the user picks this provider and adds a key, so the local-first default stays the same.

Alternatives considered

  • Keep using Custom. This works, but users have to find the endpoint themselves, and it's the setup that leads to the key/endpoint mix-ups above.
  • Legacy Spark HTTP API (spark-api-open.xf-yun.com) as the default. Not a good fit: it needs a separate APIPassword for each model version, and the newer Spark X2.5 models are served through Astron MaaS.

Area

Video dubbing

I contribute to the iFLYTEK Astron open-source community and can open the PR for this.

Source: debpalash/OmniVoice-Studio