feat(models): add max concurrency setting for background tasks

Introduce a new `max_concurrency` parameter to the model configuration, allowing control over the maximum number of concurrent background tasks (ingestion/enrichment) per model. This feature is applicable to chat, embedding, and VLM models, with a value of 0 or undefined falling back to the global default. Update UI components and localization files to support this new setting, ensuring a seamless user experience.
This commit is contained in:
wizardchen
2026-07-09 19:56:43 +08:00
committed by lyingbug
parent 200c344065
commit 20256287ec
17 changed files with 173 additions and 55 deletions
+6
View File
@@ -75,6 +75,12 @@ type ModelParameters struct {
// 保留字段(Authorization、api-key、Content-Type、Accept 等)会在运行期被忽略以避免破坏签名/鉴权流程。
CustomHeaders map[string]string `yaml:"custom_headers,omitempty" json:"custom_headers,omitempty"`
SupportsVision bool `yaml:"supports_vision" json:"supports_vision"` // Whether the model accepts image/multimodal input
// MaxConcurrency caps concurrent in-flight BACKGROUND (ingestion /
// enrichment) calls to THIS specific model, keyed by model ID and shared
// across all replicas. 0 (the default) means "fall back to the
// process-wide model.max_concurrency". Interactive user-facing calls are
// never gated. Only chat / vlm / embedding honour this (see limiter.Gate).
MaxConcurrency int `yaml:"max_concurrency,omitempty" json:"max_concurrency,omitempty"`
// WeKnoraCloud 厂商专用凭证
AppID string `yaml:"app_id,omitempty" json:"app_id,omitempty"`
AppSecret string `yaml:"app_secret,omitempty" json:"app_secret,omitempty"` // AES-256 加密存储,实际承载上游 API Key