rename /api/tags
to /api/list
This commit is contained in:
parent
d77dde126b
commit
7396030d60
@ -262,7 +262,7 @@ func (c *Client) Create(ctx context.Context, req *CreateRequest, fn CreateProgre
|
|||||||
|
|
||||||
func (c *Client) List(ctx context.Context) (*ListResponse, error) {
|
func (c *Client) List(ctx context.Context) (*ListResponse, error) {
|
||||||
var lr ListResponse
|
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 nil, err
|
||||||
}
|
}
|
||||||
return &lr, nil
|
return &lr, nil
|
||||||
|
@ -157,7 +157,7 @@ def push(model_name, insecure=False, callback=None):
|
|||||||
# List models that are available locally.
|
# List models that are available locally.
|
||||||
def list():
|
def list():
|
||||||
try:
|
try:
|
||||||
response = requests.get(f"{BASE_URL}/api/tags")
|
response = requests.get(f"{BASE_URL}/api/list")
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
data = response.json()
|
data = response.json()
|
||||||
models = data.get('models', [])
|
models = data.get('models', [])
|
||||||
|
@ -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.
|
Return 201 Created if the blob was successfully created.
|
||||||
|
|
||||||
## List Local Models
|
## List Models
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
GET /api/tags
|
GET /api/list
|
||||||
```
|
```
|
||||||
|
|
||||||
List models that are available locally.
|
List models that are available locally.
|
||||||
@ -385,7 +385,7 @@ List models that are available locally.
|
|||||||
#### Request
|
#### Request
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
curl http://localhost:11434/api/tags
|
curl http://localhost:11434/api/list
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Response
|
#### Response
|
||||||
|
@ -771,6 +771,7 @@ func Serve(ln net.Listener, allowOrigins []string) error {
|
|||||||
c.String(http.StatusOK, "Ollama is running")
|
c.String(http.StatusOK, "Ollama is running")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
r.Handle(method, "/api/list", ListModelsHandler)
|
||||||
r.Handle(method, "/api/tags", ListModelsHandler)
|
r.Handle(method, "/api/tags", ListModelsHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user