Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Copy(ctx context.Context, req *CopyRequest) error
- func (c *Client) Create(ctx context.Context, req *CreateRequest, fn CreateProgressFunc) error
- func (c *Client) Delete(ctx context.Context, req *DeleteRequest) error
- func (c *Client) ExecutePlugin(ctx context.Context, req *ExecutePluginRequest) (map[string]interface{}, error)
- func (c *Client) Generate(ctx context.Context, req *GenerateRequest, fn GenerateResponseFunc) error
- func (c *Client) Heartbeat(ctx context.Context) error
- func (c *Client) List(ctx context.Context) (*ListResponse, error)
- func (c *Client) LoadPlugin(ctx context.Context, req *LoadPluginRequest) error
- func (c *Client) Pull(ctx context.Context, req *PullRequest, fn PullProgressFunc) error
- func (c *Client) Push(ctx context.Context, req *PushRequest, fn PushProgressFunc) error
- func (c *Client) Show(ctx context.Context, req *ShowRequest) (*ShowResponse, error)
- func (c *Client) UnloadPlugin(ctx context.Context, req *UnloadPluginRequest) error
- type CopyRequest
- type CreateProgressFunc
- type CreateRequest
- type DeleteRequest
- type Duration
- type EmbeddingRequest
- type EmbeddingResponse
- type ExecutePluginRequest
- type ExecutePluginResponse
- type GenerateRequest
- type GenerateResponse
- type GenerateResponseFunc
- type ListResponse
- type LoadPluginRequest
- type ModelResponse
- type Options
- type ProgressResponse
- type PullProgressFunc
- type PullRequest
- type PushProgressFunc
- type PushRequest
- type Runner
- type ShowRequest
- type ShowResponse
- type StatusError
- type TokenResponse
- type UnloadPluginRequest
Constants ¶
View Source
const DefaultHost = "0.0.0.0:11434"
Variables ¶
View Source
var ErrInvalidOpts = fmt.Errorf("invalid options")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func ClientFromEnvironment ¶
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, req *CreateRequest, fn CreateProgressFunc) error
func (*Client) ExecutePlugin ¶
func (c *Client) ExecutePlugin(ctx context.Context, req *ExecutePluginRequest) (map[string]interface{}, error)
ExecutePlugin executes a plugin and returns the results.
func (*Client) Generate ¶
func (c *Client) Generate(ctx context.Context, req *GenerateRequest, fn GenerateResponseFunc) error
func (*Client) LoadPlugin ¶
func (c *Client) LoadPlugin(ctx context.Context, req *LoadPluginRequest) error
LoadPlugin loads a plugin into the system.
func (*Client) Pull ¶
func (c *Client) Pull(ctx context.Context, req *PullRequest, fn PullProgressFunc) error
func (*Client) Push ¶
func (c *Client) Push(ctx context.Context, req *PushRequest, fn PushProgressFunc) error
func (*Client) Show ¶
func (c *Client) Show(ctx context.Context, req *ShowRequest) (*ShowResponse, error)
func (*Client) UnloadPlugin ¶
func (c *Client) UnloadPlugin(ctx context.Context, req *UnloadPluginRequest) error
UnloadPlugin unloads a plugin from the system.
type CopyRequest ¶
type CreateProgressFunc ¶
type CreateProgressFunc func(ProgressResponse) error
type CreateRequest ¶
type DeleteRequest ¶
type DeleteRequest struct {
Name string `json:"name"`
}
type Duration ¶
func (*Duration) UnmarshalJSON ¶
type EmbeddingRequest ¶
type EmbeddingResponse ¶
type EmbeddingResponse struct {
Embedding []float64 `json:"embedding"`
}
type ExecutePluginRequest ¶
type ExecutePluginResponse ¶
type GenerateRequest ¶
type GenerateResponse ¶
type GenerateResponse struct { Model string `json:"model"` CreatedAt time.Time `json:"created_at"` Response string `json:"response"` Done bool `json:"done"` Context []int `json:"context,omitempty"` TotalDuration time.Duration `json:"total_duration,omitempty"` LoadDuration time.Duration `json:"load_duration,omitempty"` PromptEvalCount int `json:"prompt_eval_count,omitempty"` PromptEvalDuration time.Duration `json:"prompt_eval_duration,omitempty"` EvalCount int `json:"eval_count,omitempty"` EvalDuration time.Duration `json:"eval_duration,omitempty"` }
func (*GenerateResponse) Summary ¶
func (r *GenerateResponse) Summary()
type GenerateResponseFunc ¶
type GenerateResponseFunc func(GenerateResponse) error
type ListResponse ¶
type ListResponse struct {
Models []ModelResponse `json:"models"`
}
type LoadPluginRequest ¶
type ModelResponse ¶
type Options ¶
type Options struct { Runner // Predict options used at runtime NumKeep int `json:"num_keep,omitempty"` Seed int `json:"seed,omitempty"` NumPredict int `json:"num_predict,omitempty"` TopK int `json:"top_k,omitempty"` TopP float32 `json:"top_p,omitempty"` TFSZ float32 `json:"tfs_z,omitempty"` TypicalP float32 `json:"typical_p,omitempty"` RepeatLastN int `json:"repeat_last_n,omitempty"` Temperature float32 `json:"temperature,omitempty"` RepeatPenalty float32 `json:"repeat_penalty,omitempty"` PresencePenalty float32 `json:"presence_penalty,omitempty"` FrequencyPenalty float32 `json:"frequency_penalty,omitempty"` Mirostat int `json:"mirostat,omitempty"` MirostatTau float32 `json:"mirostat_tau,omitempty"` MirostatEta float32 `json:"mirostat_eta,omitempty"` PenalizeNewline bool `json:"penalize_newline,omitempty"` Stop []string `json:"stop,omitempty"` }
func DefaultOptions ¶
func DefaultOptions() Options
type ProgressResponse ¶
type PullProgressFunc ¶
type PullProgressFunc func(ProgressResponse) error
type PullRequest ¶
type PushProgressFunc ¶
type PushProgressFunc func(ProgressResponse) error
type PushRequest ¶
type Runner ¶
type Runner struct { UseNUMA bool `json:"numa,omitempty"` NumCtx int `json:"num_ctx,omitempty"` NumBatch int `json:"num_batch,omitempty"` NumGQA int `json:"num_gqa,omitempty"` NumGPU int `json:"num_gpu,omitempty"` MainGPU int `json:"main_gpu,omitempty"` LowVRAM bool `json:"low_vram,omitempty"` F16KV bool `json:"f16_kv,omitempty"` LogitsAll bool `json:"logits_all,omitempty"` VocabOnly bool `json:"vocab_only,omitempty"` UseMMap bool `json:"use_mmap,omitempty"` UseMLock bool `json:"use_mlock,omitempty"` EmbeddingOnly bool `json:"embedding_only,omitempty"` RopeFrequencyBase float32 `json:"rope_frequency_base,omitempty"` RopeFrequencyScale float32 `json:"rope_frequency_scale,omitempty"` NumThread int `json:"num_thread,omitempty"` }
Runner options which must be set when the model is loaded into memory
type ShowRequest ¶
type ShowRequest struct {
Name string `json:"name"`
}
type ShowResponse ¶
type StatusError ¶
func (StatusError) Error ¶
func (e StatusError) Error() string
type TokenResponse ¶
type TokenResponse struct {
Token string `json:"token"`
}
type UnloadPluginRequest ¶
type UnloadPluginRequest struct {
PluginName string `json:"plugin_name"`
}
Click to show internal directories.
Click to hide internal directories.