feat: add Spark MaaS AI model provider support #1893
Conversation
|
cc @EItanya PTAL |
There was a problem hiding this comment.
Pull request overview
Adds Spark MaaS AI as a first-class model provider, wiring it through the platform’s OpenAI-compatible interface so Spark MaaS-hosted model families can be configured and used like existing providers across the Go API/ADK, Python ADK, CRDs/Helm, and UI.
Changes:
- Introduces a new provider enum/type (
SparkMaaSAI/spark_maas_ai) and associated config (baseUrl/base_url) across API schemas, Go/Python ADKs, and UI types. - Adds backend support for listing Spark MaaS models/providers, translating Spark MaaS configs into ADK configs, and instantiating an OpenAI-compatible LLM client.
- Updates CRDs/Helm and UI flows (provider selection, model creation/editing, provider icon) to support Spark MaaS.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/types/index.ts | Adds Spark MaaS provider config payload typing. |
| ui/src/lib/providers.ts | Registers Spark MaaS provider metadata (links/help) for UI. |
| ui/src/components/ProviderCombobox.tsx | Adds Spark MaaS icon mapping for provider picker. |
| ui/src/components/models/ModelsListSection.tsx | Ensures Spark MaaS provider params are shown/handled in model list. |
| ui/src/components/ModelProviderCombobox.tsx | Adds Spark MaaS icon mapping for model/provider combobox. |
| ui/src/components/icons/SparkMaaSAI.tsx | Introduces Spark MaaS provider SVG icon component. |
| ui/src/app/models/new/page.tsx | Enables Spark MaaS in the model creation/edit payload flow. |
| python/packages/kagent-adk/src/kagent/adk/types.py | Adds SparkMaaSAI model type and routes it through the OpenAI-compatible client. |
| helm/kagent-crds/templates/kagent.dev_modelproviderconfigs.yaml | Extends provider enum in Helm-rendered CRD template. |
| helm/kagent-crds/templates/kagent.dev_modelconfigs.yaml | Extends model config schema with Spark MaaS provider + config + validations. |
| go/core/internal/httpserver/handlers/models.go | Adds supported-model listings for Spark MaaS provider. |
| go/core/internal/httpserver/handlers/modelproviderconfig.go | Adds Spark MaaS provider config type to supported providers listing. |
| go/core/internal/controller/translator/agent/adk_api_translator.go | Translates Spark MaaS ModelConfig into ADK model config + env vars. |
| go/core/internal/controller/translator/agent/adk_api_translator_test.go | Adds translator tests for Spark MaaS (secret-based + passthrough). |
| go/api/v1alpha2/zz_generated.deepcopy.go | Adds deepcopy support for SparkMaaSAIConfig. |
| go/api/v1alpha2/modelconfig_types.go | Adds Spark MaaS provider enum and SparkMaaSAIConfig schema to API types. |
| go/api/config/crd/bases/kagent.dev_modelproviderconfigs.yaml | Extends provider enum in generated base CRD. |
| go/api/config/crd/bases/kagent.dev_modelconfigs.yaml | Extends generated base CRD with Spark MaaS config schema + validations. |
| go/api/adk/types.go | Adds SparkMaaSAI ADK model type + parsing + embedding conversion mapping. |
| go/api/adk/types_test.go | Adds Spark MaaS marshal/unmarshal/type tests. |
| go/adk/pkg/agent/agent.go | Instantiates Spark MaaS LLM using OpenAI-compatible model implementation. |
Files not reviewed (1)
- go/api/v1alpha2/zz_generated.deepcopy.go: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
95b50ad to
cf09f12
Compare
| Model: m.Model, | ||
| BaseUrl: m.BaseUrl, | ||
| } | ||
| return models.NewOpenAIModelWithLogger(cfg, log) |
There was a problem hiding this comment.
Since this is completely OpenAI compatible, wouldn't you be able to use this already with Kagent's BYO OpenAI by just setting the baseUrl, something like this? Could you explain why would we need to add explicit support in the API?
apiVersion: kagent.dev/v1alpha2
kind: ModelConfig
metadata:
name: my-spark-model
namespace: kagent
spec:
apiKeySecret: kagent-my-provider
apiKeySecretKey: ${PROVIDER_API_KEY}
model: Spark5.0-Pro
provider: OpenAI
openAI:
baseUrl: "https://maas-api.cn-huabei-1.xf-yun.com.cn"There was a problem hiding this comment.
Thanks @supreme-gg-gg
The iFlytek Spark-x model supports the standard WebSocket protocol for model invocation, which is a universal and standard model interaction protocol. I plan to implement access support for it via type configuration, and this is exactly the core motivation and original intention behind submitting this PR.
Signed-off-by: dongjiang <dongjiang1989@126.com>
cf09f12 to
3ef9f38
Compare
Summary
Introduce Spark MaaS AI as a new model provider that routes through the Spark MaaS platform's OpenAI-compatible interface, providing unified access to multiple model families (Spark, DeepSeek, GLM, miniMax, Qwen, etc.) via a single endpoint.
Changes
Go ADK & API
Python ADK
UI
Test