Skip to content

fix: system config model provider issues#187

Merged
csunny merged 8 commits intomainfrom
feature/fix_system_config
Mar 30, 2026
Merged

fix: system config model provider issues#187
csunny merged 8 commits intomainfrom
feature/fix_system_config

Conversation

@yhjun1026
Copy link
Copy Markdown
Collaborator

Summary

修复系统配置管理模块中的模型提供商配置相关问题

Changes

  • 修复默认模型配置保存问题: 保存后刷新页面配置丢失,优化了 deriveDefaultProviderName 函数逻辑
  • 移除 max_tokens 上限限制: 允许用户根据实际模型规格自由设置,不再强制限制为128000
  • 优化 provider 下拉选项: 仅显示内置provider(openai/alibaba/anthropic)和已配置的自定义provider
  • 修复配置后模型不显示问题: 在 /api/v2/serve/model/model-types API中添加读取配置文件的逻辑,使配置的模型能立即在Agent和首页显示
  • 支持灵活的provider配置: 将 ModelConfig.provider 从 Enum 类型改为 str 类型,支持任意provider名称

Files Changed

  • packages/derisk-core/src/derisk_core/config/schema.py
  • packages/derisk-serve/src/derisk_serve/model/api/endpoints.py
  • web/src/components/config/LLMSettingsSection.tsx

Test Plan

  1. 在系统配置页面配置模型提供商和默认模型
  2. 保存配置后刷新页面,验证配置是否正确保留
  3. 在Agent或首页的模型选择器中,验证配置的模型是否显示
  4. 设置超过128000的max_tokens值,验证是否正常保存

- Fix default model config not saved correctly after refresh
- Remove max_tokens upper limit to allow flexible model specs
- Fix provider dropdown showing too many options
- Fix configured models not appearing in Agent/homepage after save
- Change ModelConfig.provider from Enum to str for flexibility
@github-actions github-actions bot added the fix label Mar 30, 2026
- Fix model list not showing configured models in Agent/app model selector
- Read models from both worker manager and system_app.config
- Support both old worker-based and new config-based models
Breaking Changes:
- Remove separate default_model config section
- Add is_default field to model configuration
- Simplify UI: set default model directly in model list
- Each provider can have one default model

Changes:
- Backend: Add is_default to LLMProviderModelConfig schema
- Frontend: Rewrite LLMSettingsSection with new design
- Add model helper functions for finding default model
- Update type definitions

Benefits:
- Single source of truth: no sync issues
- Better UX: set default directly in model list
- Simpler code: no complex derivation logic
…fter save

- Clear old cache before registering new models
- Reload model list after saving configuration
- Fix models not showing until restart
…odels from showing

- Change API logic to only use config models when available
- Fall back to worker models only if no config models found
- Prevents deleted models from persisting in model list
- Affects /api/v1/model/types and /api/v2/serve/model/model-types
Copy link
Copy Markdown
Contributor

@csunny csunny left a comment

Choose a reason for hiding this comment

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

LGTM~

@csunny csunny merged commit bb28212 into main Mar 30, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants