Documentation
¶
Index ¶
- Variables
- func URL(path string, dmrHost string) string
- type Client
- func (c *Client) Chat(model, prompt string) error
- func (c *Client) Inspect(model string) (Model, error)
- func (c *Client) InspectOpenAI(model string) (OpenAIModel, error)
- func (c *Client) List() ([]Model, error)
- func (c *Client) ListOpenAI() (OpenAIModelList, error)
- func (c *Client) Pull(model string, progress func(string)) (string, bool, error)
- func (c *Client) Push(model string, progress func(string)) (string, bool, error)
- func (c *Client) Remove(models []string, force bool) (string, error)
- func (c *Client) Status() Status
- func (c *Client) Tag(source, targetRepo, targetTag string) (string, error)
- type Config
- type DockerHttpClient
- type Format
- type Model
- type OpenAIChatMessage
- type OpenAIChatRequest
- type OpenAIChatResponse
- type OpenAIModel
- type OpenAIModelList
- type ProgressMessage
- type Status
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("model not found") )
View Source
var Version = "dev"
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(dockerClient DockerHttpClient, dmrHost string) *Client
func (*Client) InspectOpenAI ¶
func (c *Client) InspectOpenAI(model string) (OpenAIModel, error)
func (*Client) ListOpenAI ¶
func (c *Client) ListOpenAI() (OpenAIModelList, error)
type DockerHttpClient ¶
type Format ¶
type Format string
TODO: To be replaced by the Model struct from pianta's common/pkg/inference/models/api.go. (https://github.com/docker/pinata/pull/33331)
type Model ¶
type Model struct {
// ID is the globally unique model identifier.
ID string `json:"id"`
// Tags are the list of tags associated with the model.
Tags []string `json:"tags"`
// Created is the Unix epoch timestamp corresponding to the model creation.
Created int64 `json:"created"`
// Config describes the model.
Config Config `json:"config"`
}
type OpenAIChatMessage ¶
type OpenAIChatRequest ¶
type OpenAIChatRequest struct {
Model string `json:"model"`
Messages []OpenAIChatMessage `json:"messages"`
Stream bool `json:"stream"`
}
type OpenAIChatResponse ¶
type OpenAIChatResponse struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
Model string `json:"model"`
Choices []struct {
Delta struct {
Content string `json:"content"`
Role string `json:"role,omitempty"`
} `json:"delta"`
Index int `json:"index"`
FinishReason string `json:"finish_reason"`
} `json:"choices"`
}
type OpenAIModel ¶
type OpenAIModelList ¶
type OpenAIModelList struct {
Object string `json:"object"`
Data []*OpenAIModel `json:"data"`
}
type ProgressMessage ¶
type ProgressMessage struct {
Type string `json:"type"` // "progress", "success", or "error"
Message string `json:"message"` // Human-readable message
}
ProgressMessage represents a message sent during model pull operations
Click to show internal directories.
Click to hide internal directories.