Documentation
¶
Overview ¶
ollama implements an API client for the Ollama provider. https://github.com/ollama/ollama/tree/main/docs/api
Index ¶
- type Client
- func (ollama *Client) DeleteModel(ctx context.Context, model schema.Model) error
- func (ollama *Client) DownloadModel(ctx context.Context, name string, opts ...opt.Opt) (*schema.Model, error)
- func (ollama *Client) GetModel(ctx context.Context, name string, opts ...opt.Opt) (*schema.Model, error)
- func (ollama *Client) ListModels(ctx context.Context, opts ...opt.Opt) ([]schema.Model, error)
- func (ollama *Client) ListRunningModels(ctx context.Context) ([]schema.Model, error)
- func (ollama *Client) LoadModel(ctx context.Context, model schema.Model) error
- func (c *Client) Name() string
- func (ollama *Client) UnloadModel(ctx context.Context, model schema.Model) error
- type ModelDetails
- type ModelInfo
- type PullStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
*client.Client
*modelcache.ModelCache
// contains filtered or unexported fields
}
func New ¶
Create a new client, with an ollama endpoint, which should be something like "http://localhost:11434/api" - you can specify a different provider name in the fragment, ie, "http://localhost:11434/api#myprovider"
func (*Client) DeleteModel ¶
Delete a model by name
func (*Client) DownloadModel ¶
func (ollama *Client) DownloadModel(ctx context.Context, name string, opts ...opt.Opt) (*schema.Model, error)
Download (pull) a model by name
func (*Client) GetModel ¶
func (ollama *Client) GetModel(ctx context.Context, name string, opts ...opt.Opt) (*schema.Model, error)
GetModel returns the model with the given name
func (*Client) ListModels ¶
List all models in the Ollama registry
func (*Client) ListRunningModels ¶
List running models
type ModelDetails ¶
type ModelDetails struct {
ParentModel string `json:"parent_model,omitempty"`
Format string `json:"format"`
Family string `json:"family"`
Families []string `json:"families"`
ParameterSize string `json:"parameter_size"`
QuantizationLevel string `json:"quantization_level"`
}
ModelDetails are the details of the model
Click to show internal directories.
Click to hide internal directories.