Versions in this module Expand all Collapse all v0 v0.32.1 Jun 17, 2026 v0.32.0 Jun 17, 2026 Changes in this version + var ErrNotSupported = errors.New("operation not supported") + var ErrRefused = errors.New("model refused the request") + func CanonicalBackendType(backendType string) string + func ClampMaxOutputTokens(requested, ceiling int) (int, bool) + func ClampMaxOutputTokensPtr(tokens *int, ceiling int) *int + func RegisterCatalogProvider(backendType string, constructor CatalogProviderConstructor) + func RegisterShutdownHook(fn func() error) + func SetupVLLMLocalInstance(ctx context.Context, model string, tag string, toolParser string) (string, testcontainers.Container, func(), error) + func Shutdown() error + type BackendSpec struct + APIKey string + BaseURL string + Type string + type CapabilityConfig struct + CanChat bool + CanEmbed bool + CanPrompt bool + CanStream bool + CanThink bool + ContextLength int + MaxOutputTokens int + type CatalogFactory interface + NewCatalogProvider func(spec BackendSpec, opts ...CatalogOption) (CatalogProvider, error) + func DefaultCatalogFactory() CatalogFactory + type CatalogOption func(*CatalogOptions) + func WithCatalogHTTPClient(client *http.Client) CatalogOption + func WithCatalogTracker(tracker libtracker.ActivityTracker) CatalogOption + type CatalogOptions struct + HTTPClient *http.Client + Tracker libtracker.ActivityTracker + type CatalogProvider interface + ListModels func(ctx context.Context) ([]ObservedModel, error) + ProviderFor func(model ObservedModel) Provider + Type func() string + func NewCatalogProvider(spec BackendSpec, opts ...CatalogOption) (CatalogProvider, error) + type CatalogProviderConstructor func(spec BackendSpec, opts CatalogOptions) (CatalogProvider, error) + type ChatArgument interface + Apply func(config *ChatConfig) + func WithMaxTokens(tokens int) ChatArgument + func WithSeed(seed int) ChatArgument + func WithTemperature(temp float64) ChatArgument + func WithTool(tool Tool) ChatArgument + func WithTools(tools ...Tool) ChatArgument + func WithTopP(p float64) ChatArgument + type ChatConfig struct + MaxTokens *int + Seed *int + Shift *bool + Temperature *float64 + Think *string + Tools []Tool + TopP *float64 + Truncate *bool + type ChatResult struct + Message Message + ToolCalls []ToolCall + type Daemon struct + func Default() *Daemon + func NewDaemon(opts ...DaemonOption) *Daemon + func (d *Daemon) ListBackends() []string + func (d *Daemon) ListModels(ctx context.Context, id string) ([]ObservedModel, error) + func (d *Daemon) ProviderFor(id string, model ObservedModel) (Provider, error) + func (d *Daemon) RegisterBackend(id string, spec BackendSpec, opts ...CatalogOption) error + func (d *Daemon) RemoveBackend(id string) + func (d *Daemon) Stop() error + type DaemonOption func(*Daemon) + func WithCatalogFactory(f CatalogFactory) DaemonOption + type FunctionTool struct + Description string + Name string + Parameters interface{} + type LLMChatClient interface + Chat func(ctx context.Context, messages []Message, args ...ChatArgument) (ChatResult, error) + type LLMEmbedClient interface + Embed func(ctx context.Context, prompt string) ([]float64, error) + type LLMPromptExecClient interface + Prompt func(ctx context.Context, systemInstruction string, temperature float32, ...) (string, error) + type LLMStreamClient interface + Stream func(ctx context.Context, messages []Message, args ...ChatArgument) (<-chan *StreamParcel, error) + type Message struct + Content string + Role string + Thinking string + ToolCallID string + ToolCalls []ToolCall + type MockChatClient struct + func (m *MockChatClient) Chat(ctx context.Context, messages []Message, opts ...ChatArgument) (ChatResult, error) + func (m *MockChatClient) Close() error + type MockEmbedClient struct + func (m *MockEmbedClient) Close() error + func (m *MockEmbedClient) Embed(ctx context.Context, prompt string) ([]float64, error) + type MockPromptClient struct + func (m *MockPromptClient) Close() error + func (m *MockPromptClient) Prompt(ctx context.Context, systemInstruction string, temperature float32, ...) (string, error) + type MockProvider struct + Backends []string + CanChatFlag bool + CanEmbedFlag bool + CanPromptFlag bool + CanStreamFlag bool + ContextLength int + ID string + MaxOutputTokens int + Name string + func (m *MockProvider) CanChat() bool + func (m *MockProvider) CanEmbed() bool + func (m *MockProvider) CanPrompt() bool + func (m *MockProvider) CanStream() bool + func (m *MockProvider) CanThink() bool + func (m *MockProvider) GetBackendIDs() []string + func (m *MockProvider) GetChatConnection(ctx context.Context, backendID string) (LLMChatClient, error) + func (m *MockProvider) GetContextLength() int + func (m *MockProvider) GetEmbedConnection(ctx context.Context, backendID string) (LLMEmbedClient, error) + func (m *MockProvider) GetID() string + func (m *MockProvider) GetMaxOutputTokens() int + func (m *MockProvider) GetPromptConnection(ctx context.Context, backendID string) (LLMPromptExecClient, error) + func (m *MockProvider) GetStreamConnection(ctx context.Context, backendID string) (LLMStreamClient, error) + func (m *MockProvider) GetType() string + func (m *MockProvider) ModelName() string + type MockStreamClient struct + func (m *MockStreamClient) Close() error + func (m *MockStreamClient) Stream(ctx context.Context, messages []Message, args ...ChatArgument) (<-chan *StreamParcel, error) + type ObservedModel struct + ContextLength int + Digest string + Meta map[string]string + ModifiedAt time.Time + Name string + Size int64 + type Provider interface + CanChat func() bool + CanEmbed func() bool + CanPrompt func() bool + CanStream func() bool + CanThink func() bool + GetBackendIDs func() []string + GetChatConnection func(ctx context.Context, backendID string) (LLMChatClient, error) + GetContextLength func() int + GetEmbedConnection func(ctx context.Context, backendID string) (LLMEmbedClient, error) + GetID func() string + GetMaxOutputTokens func() int + GetPromptConnection func(ctx context.Context, backendID string) (LLMPromptExecClient, error) + GetStreamConnection func(ctx context.Context, backendID string) (LLMStreamClient, error) + GetType func() string + ModelName func() string + type StreamParcel struct + Data string + Error error + Thinking string + type Tool struct + Function *FunctionTool + Type string + type ToolCall struct + Function struct{ ... } + ID string + ProviderMeta map[string]string + Type string + type WithShift struct + func (WithShift) Apply(cfg *ChatConfig) + type WithThink string + func (w WithThink) Apply(cfg *ChatConfig)