Changeset 0.9.1 (#51)
This commit is contained in:
@@ -42,8 +42,11 @@ func (h *ModelHandler) ListEnabledModels(c *gin.Context) {
|
||||
// Priority chain:
|
||||
// 1. model_catalog DB — exact match (model_id + provider_config_id)
|
||||
// 2. model_catalog DB — any provider (same model, different config)
|
||||
// 3. Known model table (static, curated)
|
||||
// 4. Heuristic inference (name-based fallback)
|
||||
// 3. Heuristic inference (name-based fallback)
|
||||
//
|
||||
// No hardcoded model table — the same model can have different capabilities
|
||||
// depending on the provider hosting it. The catalog is populated by provider
|
||||
// API sync (auto-fetch on create, manual refresh).
|
||||
func ResolveModelCaps(c *gin.Context, modelID, configID string) models.ModelCapabilities {
|
||||
// 1. Exact match: model_id + provider_config_id
|
||||
if configID != "" {
|
||||
@@ -61,14 +64,7 @@ func ResolveModelCaps(c *gin.Context, modelID, configID string) models.ModelCapa
|
||||
return caps
|
||||
}
|
||||
|
||||
// 3. Known model table (static, curated)
|
||||
caps, found := capspkg.LookupKnownModel(modelID)
|
||||
if found {
|
||||
caps.MaxOutputTokens = capspkg.ResolveMaxOutput(modelID, caps)
|
||||
return caps
|
||||
}
|
||||
|
||||
// 4. Heuristic inference
|
||||
// 3. Heuristic inference
|
||||
caps = capspkg.InferCapabilities(modelID)
|
||||
caps.MaxOutputTokens = capspkg.ResolveMaxOutput(modelID, caps)
|
||||
return caps
|
||||
|
||||
Reference in New Issue
Block a user