diff --git a/api/client.go b/api/client.go index 44af222c..a2944716 100644 --- a/api/client.go +++ b/api/client.go @@ -262,7 +262,7 @@ func (c *Client) Create(ctx context.Context, req *CreateRequest, fn CreateProgre func (c *Client) List(ctx context.Context) (*ListResponse, error) { var lr ListResponse - if err := c.do(ctx, http.MethodGet, "/api/tags", nil, &lr); err != nil { + if err := c.do(ctx, http.MethodGet, "/api/list", nil, &lr); err != nil { return nil, err } return &lr, nil diff --git a/api/client.py b/api/client.py index c5fbc9c2..cf3a23ab 100644 --- a/api/client.py +++ b/api/client.py @@ -157,7 +157,7 @@ def push(model_name, insecure=False, callback=None): # List models that are available locally. def list(): try: - response = requests.get(f"{BASE_URL}/api/tags") + response = requests.get(f"{BASE_URL}/api/list") response.raise_for_status() data = response.json() models = data.get('models', []) diff --git a/docs/api.md b/docs/api.md index 0595fadd..77e1a1dd 100644 --- a/docs/api.md +++ b/docs/api.md @@ -372,10 +372,10 @@ curl -T model.bin -X POST http://localhost:11434/api/blobs/sha256:29fdb92e57cf08 Return 201 Created if the blob was successfully created. -## List Local Models +## List Models ```shell -GET /api/tags +GET /api/list ``` List models that are available locally. @@ -385,7 +385,7 @@ List models that are available locally. #### Request ```shell -curl http://localhost:11434/api/tags +curl http://localhost:11434/api/list ``` #### Response diff --git a/server/routes.go b/server/routes.go index 8b248234..b49da804 100644 --- a/server/routes.go +++ b/server/routes.go @@ -771,6 +771,7 @@ func Serve(ln net.Listener, allowOrigins []string) error { c.String(http.StatusOK, "Ollama is running") }) + r.Handle(method, "/api/list", ListModelsHandler) r.Handle(method, "/api/tags", ListModelsHandler) }