[PR #154] [MERGED] feat: add Chinese mainland LLM providers (DeepSeek, GLM, Kimi, Qwen) #196

Closed
opened 2026-06-06 22:09:39 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/vxcontrol/pentagi/pull/154
Author: @niuqun2003
Created: 2/27/2026
Status: Merged
Merged: 3/4/2026
Merged by: @asdek

Base: feature/next_releaseHead: feature/cn-llm-providers


📝 Commits (1)

  • 539f6c2 feat: add CN LLM providers (DeepSeek, GLM, Kimi, Qwen) with bug fixes

📊 Changes

33 files changed (+2647 additions, -8 deletions)

View changed files

📝 .env.example (+16 -0)
CLAUDE.md (+150 -0)
📝 Dockerfile (+3 -2)
backend/migrations/sql/20260227_120000_add_cn_providers.sql (+12 -0)
📝 backend/pkg/config/config.go (+16 -0)
📝 backend/pkg/graph/generated.go (+768 -4)
📝 backend/pkg/graph/model/models_gen.go (+21 -1)
📝 backend/pkg/graph/schema.graphqls (+16 -0)
📝 backend/pkg/graph/schema.resolvers.go (+32 -0)
backend/pkg/providers/deepseek/config.yml (+127 -0)
backend/pkg/providers/deepseek/deepseek.go (+171 -0)
backend/pkg/providers/deepseek/models.yml (+15 -0)
backend/pkg/providers/glm/config.yml (+114 -0)
backend/pkg/providers/glm/glm.go (+171 -0)
backend/pkg/providers/glm/models.yml (+41 -0)
backend/pkg/providers/kimi/config.yml (+114 -0)
backend/pkg/providers/kimi/kimi.go (+171 -0)
backend/pkg/providers/kimi/models.yml (+34 -0)
📝 backend/pkg/providers/provider/provider.go (+8 -0)
📝 backend/pkg/providers/providers.go (+104 -0)

...and 13 more files

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/vxcontrol/pentagi/pull/154 **Author:** [@niuqun2003](https://github.com/niuqun2003) **Created:** 2/27/2026 **Status:** ✅ Merged **Merged:** 3/4/2026 **Merged by:** [@asdek](https://github.com/asdek) **Base:** `feature/next_release` ← **Head:** `feature/cn-llm-providers` --- ### 📝 Commits (1) - [`539f6c2`](https://github.com/vxcontrol/pentagi/commit/539f6c2cda0f08802ef82fc8ac05c2739cf7b41b) feat: add CN LLM providers (DeepSeek, GLM, Kimi, Qwen) with bug fixes ### 📊 Changes **33 files changed** (+2647 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+16 -0) ➕ `CLAUDE.md` (+150 -0) 📝 `Dockerfile` (+3 -2) ➕ `backend/migrations/sql/20260227_120000_add_cn_providers.sql` (+12 -0) 📝 `backend/pkg/config/config.go` (+16 -0) 📝 `backend/pkg/graph/generated.go` (+768 -4) 📝 `backend/pkg/graph/model/models_gen.go` (+21 -1) 📝 `backend/pkg/graph/schema.graphqls` (+16 -0) 📝 `backend/pkg/graph/schema.resolvers.go` (+32 -0) ➕ `backend/pkg/providers/deepseek/config.yml` (+127 -0) ➕ `backend/pkg/providers/deepseek/deepseek.go` (+171 -0) ➕ `backend/pkg/providers/deepseek/models.yml` (+15 -0) ➕ `backend/pkg/providers/glm/config.yml` (+114 -0) ➕ `backend/pkg/providers/glm/glm.go` (+171 -0) ➕ `backend/pkg/providers/glm/models.yml` (+41 -0) ➕ `backend/pkg/providers/kimi/config.yml` (+114 -0) ➕ `backend/pkg/providers/kimi/kimi.go` (+171 -0) ➕ `backend/pkg/providers/kimi/models.yml` (+34 -0) 📝 `backend/pkg/providers/provider/provider.go` (+8 -0) 📝 `backend/pkg/providers/providers.go` (+104 -0) _...and 13 more files_ </details> ### 📄 Description ## 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`: ```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 - [x] Provider creation via Settings UI works for all four new types - [x] Agent configuration test passes when API key is set - [x] Clear error message shown when API key is missing (instead of misleading "missing OpenAI API key") - [x] Docker Compose correctly injects API keys into the container - [x] DB migration runs cleanly on fresh and existing databases 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-06 22:09:39 -04:00
yindo closed this issue 2026-06-06 22:09:39 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vxcontrol/pentagi#196