feat: expose model groups in /v1/models endpoint
Add Groups() method to Router so handleListModels can append model group IDs (e.g. 'deepseek-auto', 'openai-auto') to the model list, marked with owned_by: 'gophergate'. This lets clients discover and use groups via the standard OpenAI /v1/models endpoint.
This commit is contained in:
@@ -36,6 +36,15 @@ func New(groups []db.ModelGroup, classify ClassifierFunc) *Router {
|
||||
return r
|
||||
}
|
||||
|
||||
// Groups returns all registered model group IDs.
|
||||
func (r *Router) Groups() []string {
|
||||
ids := make([]string, 0, len(r.groups))
|
||||
for id := range r.groups {
|
||||
ids = append(ids, id)
|
||||
}
|
||||
return ids
|
||||
}
|
||||
|
||||
// IsGroup returns true if the model name is a group ID.
|
||||
func (r *Router) IsGroup(modelID string) bool {
|
||||
_, ok := r.groups[modelID]
|
||||
|
||||
Reference in New Issue
Block a user