Repository navigation
feat(llm): add iFlytek Spark (Astron MaaS) provider - #1531
Merged
Merged
Conversation
Add `iflytek` to the LLM provider registry. iFlytek's Astron MaaS serves Spark X2.5 over OpenAI-compatible Chat Completions, so this is registry metadata only and reuses the `openai_compatible` adapter. The default base URL is the pay-as-you-go endpoint. Token Plan keys only work on the maas-token-api host, so the config example and the tips point Token Plan users at that base URL. Signed-off-by: FenjuFu <fufenjupku@gmail.com>
Owner
|
Thanks for adding iFlytek Spark support and the clear configuration instructions! Merged — appreciate your contribution. |
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.
What
Adds
iflytektoLLM_PROVIDER_REGISTRY: iFlytek Spark served by iFlytek's Astron MaaS platform, which exposes OpenAI-compatible Chat Completions. Registry metadata only,adapterstaysopenai_compatible, no new request path. It sits in the 主流模型原厂与云厂商 group right after Xiaomi MiMo, next to the other first-party Chinese model vendors.app/models/llm_provider.pymimo: default modelspark-x2.5, default base URLhttps://maas-api.cn-huabei-1.xf-yun.com/v2config.example.tomliflytek_api_key/iflytek_base_url/iflytek_model_namewebui/i18n/en.json,webui/i18n/zh.json{api_key_url}/{default_base_url}/{default_model}/{model_docs_url}placeholders; the label comes from the registry likemimoandminimaxtest/services/test_llm.py"iflytek"in the group-order test, and a client test for the default and a saved Token Plan base URLTwo endpoints, one provider
Astron MaaS has a pay-as-you-go endpoint (
maas-api…/v2, the default here) and a Token Plan endpoint (maas-token-api…/v2). Keys are tied to one of them, so a Token Plan key sent to the default endpoint gets iFlytek's 40311200 no valid authorization. Rather than add a second provider id, the tips and the config example tell Token Plan users to put the Token Plan URL in Base Url; the existing override handling keeps it as-is, which the new test covers.Spark X2.5 is a reasoning model. Its reasoning comes back in
reasoning_content, separate fromcontent, so the existing_extract_chat_completion_textpath already returns only the answer.Checked today (2026-10-03) with a real Token Plan key
llm.generate_script(video_subject="why the sky is blue", paragraph_number=1)through_generate_responsewithiflytek_base_urlset to the Token Plan URL: a clean one-paragraph script in about 45 s.llm.generate_terms(...)on that script:['Why sky blue', 'Blue sky cause', 'Sky blue scattering', 'Blue sky rayleigh', 'Blue sky atmosphere'].Locally (
uv sync --frozen --python 3.11, Windows):test/services/test_llm.pyandtest/services/test_webui_i18n.pypass (131 passed, 1 skipped),ruff check app cli.py main.py webui test docs/skillis clean. In the full suite 8 tests in the cache-manager, material, ElevenLabs music and Sonilo modules fail, and they fail the same way onmainwithout this change.Disclosure: I'm a member of the iFlytek Astron open-source community. No pricing or referral links are in the diff.