Ollama ps command for showing currently loaded models (#4327)

This commit is contained in:
Patrick Devine 2024-05-13 17:17:36 -07:00 committed by GitHub
parent 9eed4a90ce
commit 6845988807
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 193 additions and 50 deletions

View file

@ -354,6 +354,15 @@ func (c *Client) List(ctx context.Context) (*ListResponse, error) {
return &lr, nil
}
// List running models.
func (c *Client) ListRunning(ctx context.Context) (*ListResponse, error) {
var lr ListResponse
if err := c.do(ctx, http.MethodGet, "/api/ps", nil, &lr); err != nil {
return nil, err
}
return &lr, nil
}
// Copy copies a model - creating a model with another name from an existing
// model.
func (c *Client) Copy(ctx context.Context, req *CopyRequest) error {