Revert "server: add model capabilities to the list endpoint (#10174)" (#11004)

This reverts commit 0943001193.
This commit is contained in:
Jeffrey Morgan
2025-06-06 23:29:14 -04:00
committed by GitHub
parent a8ed68bd93
commit 09d308d6b6
3 changed files with 19 additions and 37 deletions

View File

@@ -462,7 +462,6 @@ type ListModelResponse struct {
ModifiedAt time.Time `json:"modified_at"` ModifiedAt time.Time `json:"modified_at"`
Size int64 `json:"size"` Size int64 `json:"size"`
Digest string `json:"digest"` Digest string `json:"digest"`
Capabilities []model.Capability `json:"capabilities,omitempty"`
Details ModelDetails `json:"details,omitempty"` Details ModelDetails `json:"details,omitempty"`
} }

View File

@@ -1157,15 +1157,11 @@ A single JSON object will be returned.
{ {
"models": [ "models": [
{ {
"name": "deepseek-r1:latest",
"model": "codellama:13b", "model": "deepseek-r1:latest",
"modified_at": "2023-11-04T14:56:49.277302595-07:00", "modified_at": "2025-05-10T08:06:48.639712648-07:00",
"size": 7365960935, "size": 4683075271,
"digest": "9f438cb9cd581fc025612d27f7c1a6669ff83a8bb0ed86c94fcf4c5440555697", "digest": "0a8c266910232fd3291e71e5ba1e058cc5af9d411192cf88b6d30e92b6e73163",
"capabilities": [
"completion"
],
"details": { "details": {
"parent_model": "", "parent_model": "",
"format": "gguf", "format": "gguf",
@@ -1178,16 +1174,11 @@ A single JSON object will be returned.
} }
}, },
{ {
"name": "llama3.2:latest",
"model": "llama4:latest", "model": "llama3.2:latest",
"modified_at": "2023-12-07T09:32:18.757212583-08:00", "modified_at": "2025-05-04T17:37:44.706015396-07:00",
"size": 3825819519, "size": 2019393189,
"digest": "fe938a131f40e6f6d40083c9f0f430a515233eb2edaa6d72eb85c50d64f2300e", "digest": "a80c4f17acd55265feec403c7aef86be0c25983ab279d83f3bcd3abbcb5b8b72",
"capabilities": [
"completion",
"vision"
],
"details": { "details": {
"parent_model": "", "parent_model": "",
"format": "gguf", "format": "gguf",

View File

@@ -929,7 +929,8 @@ func (s *Server) ListHandler(c *gin.Context) {
} }
} }
r := api.ListModelResponse{ // tag should never be masked
models = append(models, api.ListModelResponse{
Model: n.DisplayShortest(), Model: n.DisplayShortest(),
Name: n.DisplayShortest(), Name: n.DisplayShortest(),
Size: m.Size(), Size: m.Size(),
@@ -942,16 +943,7 @@ func (s *Server) ListHandler(c *gin.Context) {
ParameterSize: cf.ModelType, ParameterSize: cf.ModelType,
QuantizationLevel: cf.FileType, QuantizationLevel: cf.FileType,
}, },
} })
model, err := GetModel(n.String())
if err != nil {
slog.Warn("bad model details", "name", n, "error", err)
} else {
r.Capabilities = model.Capabilities()
}
models = append(models, r)
} }
slices.SortStableFunc(models, func(i, j api.ListModelResponse) int { slices.SortStableFunc(models, func(i, j api.ListModelResponse) int {