feat: add Kimi (moonshot) and full provider support in model configs

- backend: expand valid_providers from 4 to full frontend provider list
  (module-level VALID_PROVIDERS constant, used by create + update)
- backend: test endpoint gains generic OpenAI-compatible branch
  (moonshot/qwen/zhipu/siliconflow etc. via AsyncOpenAI direct call)
- frontend: Kimi preset models add kimi-k2-0905/0711/turbo + kimi-latest
  alongside legacy moonshot-v1 series

Verified: moonshot config create 201 (was 400), test endpoint reaches
api.moonshot.cn and returns provider auth error with dummy key.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-26 18:33:51 +08:00
parent 495eafcd78
commit 769dcc828e
2 changed files with 40 additions and 5 deletions

View File

@@ -376,6 +376,10 @@ function createModelGroups(): ProviderGroup[] {
{
provider: 'moonshot', label: '月之暗面 Kimi', defaultBaseUrl: 'https://api.moonshot.cn/v1',
models: [
{ name: 'kimi-k2-0905-preview', desc: 'K2 增强版', price: '¥4/16', checked: false },
{ name: 'kimi-k2-0711-preview', desc: 'K2 旗舰', price: '¥4/16', checked: false },
{ name: 'kimi-k2-turbo-preview', desc: 'K2 高速版', price: '¥8/32', checked: false },
{ name: 'kimi-latest', desc: '自动指向最新', price: '¥4/16', checked: false },
{ name: 'moonshot-v1-8k', desc: '标准长度', price: '¥0.15/0.15', checked: false },
{ name: 'moonshot-v1-32k', desc: '中长文本', price: '¥0.3/0.3', checked: false },
{ name: 'moonshot-v1-128k', desc: '超长文本', price: '¥0.6/0.6', checked: false },