Skip to content

feat(llm): add iFlytek Spark as a built-in provider#485

Merged
lizhengfeng101 merged 1 commit into
alibaba:mainfrom
FenjuFu:feat/iflytek-spark-provider
Jul 24, 2026
Merged

feat(llm): add iFlytek Spark as a built-in provider#485
lizhengfeng101 merged 1 commit into
alibaba:mainfrom
FenjuFu:feat/iflytek-spark-provider

Conversation

@FenjuFu

@FenjuFu FenjuFu commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What

Adds iFlytek Spark as a built-in LLM provider.

The provider list already covers most major Chinese vendors — DashScope/Qwen, Volcano Engine, DeepSeek, Tencent Hunyuan, Kimi, Z.AI, Xiaomi MiMo, MiniMax, Baidu Qianfan — but iFlytek Spark was missing. Its official endpoint is OpenAI-compatible, so it slots in exactly like the other openai-protocol providers.

Changes

  • internal/llm/providers.go — new registry entry:
    • BaseURL: https://spark-api-open.xf-yun.com/v1 (Spark's OpenAI-compatible HTTP endpoint; the API password is sent as a bearer token)
    • EnvVar: SPARK_API_KEY
    • Models are the exact domain values that endpoint accepts: 4.0Ultra, generalv3.5, max-32k, generalv3, pro-128k, lite
  • internal/llm/providers_test.go — added iflytek to the expected provider-order list (ListProviders() sorts by name, so it sits between hy-tokenplan and kimi)
  • pages/src/content/docs/{en,zh,ja}/configuration.md — added the provider to the config table in all three locales

Notes

  • No new protocol or client code is needed — Spark rides the existing ProtocolOpenAIChatCompletions path, same as deepseek/kimi.
  • I don't have a funded Spark API password, so there's no live end-to-end call in this PR. I verified statically that the sorted registry names match the updated TestListProviders_Order expectation exactly (18 providers, no duplicates) and that the three doc tables each gained one row. make test should confirm on CI.
  • Endpoint and model ids are from iFlytek's official HTTP API docs (spark-api-open.xf-yun.com/v1); the WebSocket host spark-api.xf-yun.com uses HMAC-signed auth and is deliberately not used here.

@CLAassistant

CLAassistant commented Jul 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown
Contributor

OpenCodeReview: No comments generated. Looks good to me.

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lizhengfeng101

Copy link
Copy Markdown
Collaborator

Hello, you need to sign the CLA license before the merge

@FenjuFu

FenjuFu commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Hello, you need to sign the CLA license before the merge

I've signed the CLA. Thanks!

@lizhengfeng101
lizhengfeng101 force-pushed the feat/iflytek-spark-provider branch 2 times, most recently from 33995bf to daa27fc Compare July 24, 2026 15:23
Spark's official endpoint (https://spark-api-open.xf-yun.com/v1) is
OpenAI-compatible, so it registers like the other OpenAI-protocol
providers (deepseek, kimi, …). Adds the registry entry, the matching
name in the provider-order test, and the provider table in the en/zh/ja
configuration docs. Model ids are the domain values the HTTP endpoint
accepts (4.0Ultra, generalv3.5, max-32k, generalv3, pro-128k, lite).

Signed-off-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com>
@lizhengfeng101
lizhengfeng101 force-pushed the feat/iflytek-spark-provider branch from daa27fc to b172642 Compare July 24, 2026 15:29
@lizhengfeng101
lizhengfeng101 merged commit a0b49d5 into alibaba:main Jul 24, 2026
9 checks passed
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.

3 participants