Skip to content

feat: add Chinese mainland LLM providers (DeepSeek, GLM, Kimi, Qwen)#154

Merged
asdek merged 1 commit intovxcontrol:feature/next_releasefrom
niuqun2003:feature/cn-llm-providers
Mar 4, 2026
Merged

feat: add Chinese mainland LLM providers (DeepSeek, GLM, Kimi, Qwen)#154
asdek merged 1 commit intovxcontrol:feature/next_releasefrom
niuqun2003:feature/cn-llm-providers

Conversation

@niuqun2003
Copy link
Contributor

Summary

This PR integrates four popular Chinese mainland LLM providers into PentAGI, making the platform more accessible to users in China who rely on domestically available AI services.

New Providers

Provider Company API Endpoint
DeepSeek DeepSeek AI https://api.deepseek.com/v1
GLM (智谱AI) Zhipu AI https://open.bigmodel.cn/api/paas/v4
Kimi (月之暗面) Moonshot AI https://api.moonshot.cn/v1
Qwen (通义千问) Alibaba Cloud https://dashscope.aliyuncs.com/compatible-mode/v1

All four providers use the OpenAI-compatible API format and are implemented following the same pattern as the existing custom provider.

Changes

Backend

  • backend/pkg/providers/deepseek/ — DeepSeek provider implementation
  • backend/pkg/providers/glm/ — GLM provider implementation
  • backend/pkg/providers/kimi/ — Kimi provider implementation
  • backend/pkg/providers/qwen/ — Qwen provider implementation
  • backend/pkg/providers/provider/provider.go — register new ProviderType / ProviderName constants
  • backend/pkg/providers/providers.go — register providers in controller
  • backend/pkg/config/config.go — add env vars: DEEPSEEK_API_KEY, GLM_API_KEY, KIMI_API_KEY, QWEN_API_KEY (+ *_SERVER_URL overrides)
  • backend/pkg/server/models/providers.go — add new types to ProviderType.Valid() whitelist
  • backend/pkg/graph/schema.graphqls — add new types to ProviderType enum and config fields
  • backend/pkg/graph/model/models_gen.go — regenerated via gqlgen
  • backend/migrations/sql/20260227_120000_add_cn_providers.sql — add new enum values to PROVIDER_TYPE

Frontend

  • frontend/src/components/icons/deepseek.tsx — DeepSeek icon
  • frontend/src/components/icons/glm.tsx — GLM icon
  • frontend/src/components/icons/kimi.tsx — Kimi icon
  • frontend/src/components/icons/qwen.tsx — Qwen icon
  • frontend/src/components/icons/provider-icon.tsx — register new icons
  • frontend/graphql-schema.graphql — add new provider fields to settingsProviders query
  • frontend/src/graphql/types.ts — regenerated via graphql-codegen
  • frontend/src/pages/settings/settings-providers.tsx — UI support for new provider types

Docker

  • docker-compose.yml — expose new env vars to container

Configuration

To enable a provider, set the corresponding environment variable in .env:

# DeepSeek
DEEPSEEK_API_KEY=sk-...
DEEPSEEK_SERVER_URL=https://api.deepseek.com/v1  # optional override

# GLM (Zhipu AI)
GLM_API_KEY=...
GLM_SERVER_URL=https://open.bigmodel.cn/api/paas/v4  # optional override

# Kimi (Moonshot AI)
KIMI_API_KEY=...
KIMI_SERVER_URL=https://api.moonshot.cn/v1  # optional override

# Qwen (Alibaba Cloud)
QWEN_API_KEY=...
QWEN_SERVER_URL=https://dashscope.aliyuncs.com/compatible-mode/v1  # optional override

Test Plan

  • Provider creation via Settings UI works for all four new types
  • Agent configuration test passes when API key is set
  • Clear error message shown when API key is missing (instead of misleading "missing OpenAI API key")
  • Docker Compose correctly injects API keys into the container
  • DB migration runs cleanly on fresh and existing databases

🤖 Generated with Claude Code

- Add DeepSeek, GLM (智谱), Kimi (月之暗面), Qwen (通义千问) provider implementations
- Add DB migration for new PROVIDER_TYPE enum values
- Register new providers in config, providers controller, and type constants

Bug fixes:
- fix(server/models): add deepseek/glm/kimi/qwen to ProviderType.Valid() whitelist
- fix(gqlgen): regenerate models_gen.go so IsValid() includes new enum values
- fix(frontend): add deepseek/glm/kimi/qwen fields to settingsProviders query
  (enabled/default/models blocks) so form loads correct default agent configs
- fix(providers): add explicit API key validation with clear error messages
  instead of misleading "missing OpenAI API key" from langchaingo fallback
- fix(docker-compose): declare DEEPSEEK/GLM/KIMI/QWEN API key and server URL
  env vars so they are actually injected into the container
- docs: add CLAUDE.md with architecture guide and new provider checklist

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@niuqun2003 niuqun2003 force-pushed the feature/cn-llm-providers branch from 5bfe2a0 to 539f6c2 Compare February 28, 2026 00:30
@asdek asdek changed the base branch from master to feature/next_release March 4, 2026 18:08
@asdek asdek merged commit 5d6facf into vxcontrol:feature/next_release Mar 4, 2026
@asdek
Copy link
Contributor

asdek commented Mar 4, 2026

hey @niuqun2003

thank you for the PR!

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.

2 participants