feat(provider): add plugin system for service-specific model discovery
Model discovery currently assumes every provider exposes all models via
GET {baseURL}/models. Providers like Alibaba Cloud Bailian serve video,
3D and some image models through dedicated endpoints, so 21 models across
5 families (HappyHorse / Wan / Kling / PixVerse / Vidu / Tripo) are never
discoverable - a functional blocker for a video creation workbench.
This introduces a ModelDiscovery plugin interface with a registry that
matches vendor plugins by base URL and falls back to the standard OpenAI
implementation, keeping core discovery logic vendor-agnostic.
- add provider.ModelDiscovery interface and plugin registry
- add openai plugin (standard behaviour, default fallback)
- add bailian plugin (standard + 21 extended multimodal models)
- gate behind ENABLE_PROVIDER_PLUGINS, default false
- register plugins lazily from service layer to avoid import cycle
Verified locally: flag off -> 238 models (unchanged); flag on -> 257
models (238 + 19 net new after dedup). OpenAI and Gemini channels
unaffected in both modes.
This commit is contained in:
@@ -8,6 +8,9 @@ CANVAS_ALLOWED_PRIVATE_UPSTREAM_HOSTS=
|
||||
CANVAS_DESKTOP_LOCAL_CHANNELS_ENABLED=false
|
||||
# 桌面本机渠道启用时必须显式使用:CANVAS_BACKEND_ADDR=127.0.0.1:8080
|
||||
CANVAS_CORS_ORIGINS=http://localhost:3000
|
||||
# 启用服务商插件系统以支持特定服务的模型发现(如阿里云百炼的视频生成模型)
|
||||
# 设置为 true 启用插件机制,false 使用传统方式(默认:false)
|
||||
ENABLE_PROVIDER_PLUGINS=false
|
||||
CANVAS_DATA_PATH=./data
|
||||
CANVAS_WORKER_CONCURRENCY=3
|
||||
CANVAS_CHANNEL_CONCURRENCY=3
|
||||
|
||||
Reference in New Issue
Block a user