api

package
v0.9.29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const KeepAliveForever = time.Duration(-1)

Variables

This section is empty.

Functions

func ParseKeepAlive

func ParseKeepAlive(raw string) (time.Duration, bool, error)

ParseKeepAlive parses the API/CLI keep-alive string. Empty input means "use the server default".

Types

type AIAppActionRequest

type AIAppActionRequest struct {
	AppID         string              `json:"app_id"`
	ModelID       string              `json:"model_id,omitempty"`
	Source        string              `json:"source,omitempty"`
	ProviderMode  string              `json:"provider_mode,omitempty"`
	ModelBindings []AIAppModelBinding `json:"model_bindings,omitempty"`
	WorkDir       string              `json:"work_dir,omitempty"`
}

type AIAppInfo

type AIAppInfo struct {
	ID                      string              `json:"id"`
	Installed               bool                `json:"installed"`
	Managed                 bool                `json:"managed"`
	Supported               bool                `json:"supported"`
	Disabled                bool                `json:"disabled"`
	Status                  string              `json:"status"`
	Phase                   string              `json:"phase,omitempty"`
	ProgressMode            string              `json:"progress_mode"`
	Progress                int                 `json:"progress,omitempty"`
	InstallPath             string              `json:"install_path,omitempty"`
	Version                 string              `json:"version,omitempty"`
	LatestVersion           string              `json:"latest_version,omitempty"`
	UpdateAvailable         bool                `json:"update_available,omitempty"`
	ModelID                 string              `json:"model_id,omitempty"`
	ProviderMode            string              `json:"provider_mode,omitempty"`
	ProviderGroup           string              `json:"provider_group,omitempty"`
	ProviderSwitchSupported bool                `json:"provider_switch_supported,omitempty"`
	ProviderDrifted         bool                `json:"provider_drifted,omitempty"`
	ModelBindings           []AIAppModelBinding `json:"model_bindings,omitempty"`
	ModelSlots              []AIAppModelSlot    `json:"model_slots,omitempty"`
	RuntimeSupported        bool                `json:"runtime_supported"`
	RuntimeRunning          bool                `json:"runtime_running"`
	RuntimeStatus           string              `json:"runtime_status,omitempty"`
	LogPath                 string              `json:"log_path,omitempty"`
	LastError               string              `json:"last_error,omitempty"`
	DisabledReason          string              `json:"disabled_reason,omitempty"`
	UpdatedAt               time.Time           `json:"updated_at"`
}

type AIAppInstallRequest

type AIAppInstallRequest = AIAppActionRequest

type AIAppModelBinding added in v0.9.20

type AIAppModelBinding struct {
	Task    string `json:"task"`
	ModelID string `json:"model_id"`
	Source  string `json:"source"`
}

AIAppModelBinding selects one model, including its source when model IDs are shared by multiple sources, for a task exposed by an AI app.

type AIAppModelSlot added in v0.9.20

type AIAppModelSlot struct {
	Task     string             `json:"task"`
	Required bool               `json:"required"`
	Binding  *AIAppModelBinding `json:"binding,omitempty"`
}

AIAppModelSlot describes a model task supported by an AI app and its current saved or recommended binding.

type AIAppOpenRequest

type AIAppOpenRequest = AIAppActionRequest

type AIAppOpenResponse

type AIAppOpenResponse struct {
	URL  string `json:"url,omitempty"`
	Mode string `json:"mode,omitempty"`
}

type AIAppPathRequest added in v0.9.16

type AIAppPathRequest struct {
	AppID string `json:"app_id"`
	Path  string `json:"path"`
}

AIAppPathRequest sets a manual install location for an AI app whose automatic detection missed the user's custom install path.

type AIAppProviderRequest added in v0.9.25

type AIAppProviderRequest = AIAppActionRequest

type AIAppUninstallRequest

type AIAppUninstallRequest = AIAppActionRequest

type AIAppsResponse

type AIAppsResponse struct {
	Apps []AIAppInfo `json:"apps"`
}

type APIKeyCreateRequest

type APIKeyCreateRequest struct {
	Name string `json:"name,omitempty"`
}

type APIKeyCreateResponse

type APIKeyCreateResponse struct {
	Key    APIKeyInfo `json:"key"`
	APIKey string     `json:"api_key"`
}

type APIKeyInfo

type APIKeyInfo struct {
	ID         string     `json:"id"`
	Name       string     `json:"name"`
	Prefix     string     `json:"prefix"`
	CreatedAt  time.Time  `json:"created_at"`
	LastUsedAt *time.Time `json:"last_used_at,omitempty"`
}

type APIKeySettingsUpdateRequest

type APIKeySettingsUpdateRequest struct {
	AuthEnabled bool `json:"auth_enabled"`
}

type APIKeysResponse

type APIKeysResponse struct {
	AuthEnabled bool         `json:"auth_enabled"`
	Keys        []APIKeyInfo `json:"keys"`
}

type APIUsageResponse

type APIUsageResponse struct {
	Period       string                `json:"period"`
	From         *time.Time            `json:"from,omitempty"`
	Totals       APIUsageTotals        `json:"totals"`
	TotalHistory int64                 `json:"total_history"`
	TotalSummary APIUsageTotalSummary  `json:"total_summary"`
	SourceTotals []APIUsageSourceTotal `json:"source_totals"`
	Rows         []APIUsageRow         `json:"rows"`
}

type APIUsageRow

type APIUsageRow struct {
	APIKeyID     string    `json:"api_key_id"`
	APIKeyName   string    `json:"api_key_name"`
	Model        string    `json:"model"`
	Source       string    `json:"source"`
	SourceType   string    `json:"source_type"`
	SourceName   string    `json:"source_name,omitempty"`
	Requests     int64     `json:"requests"`
	InputTokens  int64     `json:"input_tokens"`
	OutputTokens int64     `json:"output_tokens"`
	TotalTokens  int64     `json:"total_tokens"`
	LastUsedAt   time.Time `json:"last_used_at"`
}

type APIUsageSourceTotal

type APIUsageSourceTotal struct {
	Source       string `json:"source"`
	SourceType   string `json:"source_type"`
	SourceName   string `json:"source_name,omitempty"`
	Requests     int64  `json:"requests"`
	InputTokens  int64  `json:"input_tokens"`
	OutputTokens int64  `json:"output_tokens"`
	TotalTokens  int64  `json:"total_tokens"`
}

type APIUsageSummarySeries

type APIUsageSummarySeries struct {
	Name string  `json:"name"`
	Type string  `json:"type"`
	Data []int64 `json:"data"`
}

type APIUsageTotalSummary

type APIUsageTotalSummary struct {
	XAxis  []string                `json:"xAxis"`
	Series []APIUsageSummarySeries `json:"series"`
}

type APIUsageTotals

type APIUsageTotals struct {
	Requests     int64 `json:"requests"`
	InputTokens  int64 `json:"input_tokens"`
	OutputTokens int64 `json:"output_tokens"`
	TotalTokens  int64 `json:"total_tokens"`
	LocalTokens  int64 `json:"local_tokens"`
	CloudTokens  int64 `json:"cloud_tokens"`
}

type ASRRuntimeInstallRequest

type ASRRuntimeInstallRequest struct {
	UpgradePackages bool `json:"upgrade_packages,omitempty"`
}

type AnthropicCapabilitySupport

type AnthropicCapabilitySupport struct {
	Supported bool `json:"supported"`
}

type AnthropicContentBlock

type AnthropicContentBlock struct {
	Type      string      `json:"type"`
	Text      string      `json:"text,omitempty"`
	ID        string      `json:"id,omitempty"`
	Name      string      `json:"name,omitempty"`
	Input     interface{} `json:"input,omitempty"`
	Content   interface{} `json:"content,omitempty"`
	ToolUseID string      `json:"tool_use_id,omitempty"`
	IsError   bool        `json:"is_error,omitempty"`
	Thinking  string      `json:"thinking,omitempty"`
	Signature string      `json:"signature,omitempty"`
}

type AnthropicContextManagementCapability

type AnthropicContextManagementCapability struct {
	Supported bool `json:"supported"`
}

type AnthropicCountTokensResponse

type AnthropicCountTokensResponse struct {
	InputTokens int `json:"input_tokens"`
}

type AnthropicMessage

type AnthropicMessage struct {
	Role    string      `json:"role"`
	Content interface{} `json:"content"`
}

type AnthropicMessageRequest

type AnthropicMessageRequest struct {
	Model         string             `json:"model"`
	Messages      []AnthropicMessage `json:"messages"`
	System        interface{}        `json:"system,omitempty"`
	Tools         []AnthropicTool    `json:"tools,omitempty"`
	ToolChoice    interface{}        `json:"tool_choice,omitempty"`
	MaxTokens     int                `json:"max_tokens,omitempty"`
	Stream        bool               `json:"stream,omitempty"`
	Temperature   *float64           `json:"temperature,omitempty"`
	TopP          *float64           `json:"top_p,omitempty"`
	StopSequences []string           `json:"stop_sequences,omitempty"`
}

type AnthropicMessageResponse

type AnthropicMessageResponse struct {
	ID           string                  `json:"id"`
	Type         string                  `json:"type"`
	Role         string                  `json:"role"`
	Content      []AnthropicContentBlock `json:"content"`
	Model        string                  `json:"model"`
	StopReason   string                  `json:"stop_reason"`
	StopSequence *string                 `json:"stop_sequence"`
	Usage        AnthropicUsage          `json:"usage"`
}

type AnthropicModelCapabilities

type AnthropicModelCapabilities struct {
	Batch             AnthropicCapabilitySupport           `json:"batch"`
	Citations         AnthropicCapabilitySupport           `json:"citations"`
	CodeExecution     AnthropicCapabilitySupport           `json:"code_execution"`
	ContextManagement AnthropicContextManagementCapability `json:"context_management"`
	ImageInput        AnthropicCapabilitySupport           `json:"image_input"`
	PDFInput          AnthropicCapabilitySupport           `json:"pdf_input"`
	StructuredOutputs AnthropicCapabilitySupport           `json:"structured_outputs"`
	Thinking          AnthropicThinkingCapability          `json:"thinking"`
}

type AnthropicModelInfo

type AnthropicModelInfo struct {
	ID             string                     `json:"id"`
	Type           string                     `json:"type"`
	DisplayName    string                     `json:"display_name"`
	CreatedAt      string                     `json:"created_at"`
	MaxInputTokens int                        `json:"max_input_tokens"`
	MaxTokens      int                        `json:"max_tokens"`
	Capabilities   AnthropicModelCapabilities `json:"capabilities"`
}

type AnthropicModelListResponse

type AnthropicModelListResponse struct {
	Data    []AnthropicModelInfo `json:"data"`
	FirstID string               `json:"first_id,omitempty"`
	HasMore bool                 `json:"has_more"`
	LastID  string               `json:"last_id,omitempty"`
}

type AnthropicThinkingCapability

type AnthropicThinkingCapability struct {
	Supported bool                   `json:"supported"`
	Types     AnthropicThinkingTypes `json:"types"`
}

type AnthropicThinkingTypes

type AnthropicThinkingTypes struct {
	Adaptive AnthropicCapabilitySupport `json:"adaptive"`
	Enabled  AnthropicCapabilitySupport `json:"enabled"`
}

type AnthropicTool

type AnthropicTool struct {
	Name                string      `json:"name"`
	Description         string      `json:"description,omitempty"`
	InputSchema         interface{} `json:"input_schema,omitempty"`
	CacheControl        interface{} `json:"cache_control,omitempty"`
	EagerInputStreaming bool        `json:"eager_input_streaming,omitempty"`
}

type AnthropicUsage

type AnthropicUsage struct {
	InputTokens  int `json:"input_tokens"`
	OutputTokens int `json:"output_tokens"`
}

type ChatRequest

type ChatRequest struct {
	Model     string            `json:"model"`
	Source    string            `json:"source,omitempty"`
	Messages  []Message         `json:"messages"`
	Tools     []Tool            `json:"tools,omitempty"`
	Stream    *bool             `json:"stream,omitempty"`
	Options   *ModelOptions     `json:"options,omitempty"`
	WebSearch *WebSearchOptions `json:"web_search,omitempty"`
}

type ChatResponse

type ChatResponse struct {
	Model     string    `json:"model"`
	Message   *Message  `json:"message,omitempty"`
	Done      bool      `json:"done"`
	CreatedAt time.Time `json:"created_at"`
}

type Conversation

type Conversation struct {
	ID        string                `json:"id"`
	Title     string                `json:"title"`
	Model     string                `json:"model,omitempty"`
	CreatedAt time.Time             `json:"created_at"`
	UpdatedAt time.Time             `json:"updated_at"`
	Messages  []Message             `json:"messages"`
	Settings  *ConversationSettings `json:"settings,omitempty"`
}

type ConversationMeta

type ConversationMeta struct {
	ID        string    `json:"id"`
	Title     string    `json:"title"`
	Model     string    `json:"model,omitempty"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	MsgCount  int       `json:"msg_count"`
}

type ConversationSettings

type ConversationSettings struct {
	NumCtx      int `json:"num_ctx,omitempty"`
	NumParallel int `json:"num_parallel,omitempty"`
}

type ConversationsListResponse

type ConversationsListResponse struct {
	Conversations []ConversationMeta `json:"conversations"`
}

type DatasetDeleteRequest

type DatasetDeleteRequest struct {
	Dataset string `json:"dataset"`
}

type DatasetDownloadFile

type DatasetDownloadFile struct {
	Path        string `json:"path"`
	Size        int64  `json:"size"`
	SHA256      string `json:"sha256,omitempty"`
	LFS         bool   `json:"lfs,omitempty"`
	DownloadURL string `json:"download_url"`
}

type DatasetFileEntry

type DatasetFileEntry struct {
	Name       string    `json:"name"`
	Size       int64     `json:"size"`
	IsDir      bool      `json:"is_dir"`
	ModifiedAt time.Time `json:"modified_at"`
}

type DatasetFilesRequest

type DatasetFilesRequest struct {
	Dataset string `json:"dataset"`
	Path    string `json:"path"`
}

type DatasetFilesResponse

type DatasetFilesResponse struct {
	Dataset string             `json:"dataset"`
	Path    string             `json:"path"`
	Entries []DatasetFileEntry `json:"entries"`
}

type DatasetInfo

type DatasetInfo struct {
	Name        string    `json:"name"`
	Dataset     string    `json:"dataset"`
	Size        int64     `json:"size"`
	Files       int       `json:"files"`
	ModifiedAt  time.Time `json:"modified_at"`
	Origin      string    `json:"origin,omitempty"`
	Description string    `json:"description,omitempty"`
	License     string    `json:"license,omitempty"`
}

type DatasetManifestResponse

type DatasetManifestResponse struct {
	Details DatasetInfo           `json:"details"`
	Files   []DatasetDownloadFile `json:"files"`
}

type DatasetPullRequest

type DatasetPullRequest struct {
	Dataset string `json:"dataset"`
}

type DatasetPullResponse

type DatasetPullResponse struct {
	Status    string `json:"status"`
	Digest    string `json:"digest,omitempty"`
	Total     int64  `json:"total,omitempty"`
	Completed int64  `json:"completed,omitempty"`
}

type DatasetSearchResponse

type DatasetSearchResponse struct {
	Query    string        `json:"query"`
	Limit    int           `json:"limit"`
	Offset   int           `json:"offset"`
	Total    int           `json:"total"`
	HasMore  bool          `json:"has_more"`
	Datasets []DatasetInfo `json:"datasets"`
}

type DatasetShowRequest

type DatasetShowRequest struct {
	Dataset string `json:"dataset"`
}

type DatasetShowResponse

type DatasetShowResponse struct {
	Details DatasetInfo `json:"details"`
	Files   []string    `json:"files,omitempty"`
}

type DatasetTagsResponse

type DatasetTagsResponse struct {
	Datasets []DatasetInfo `json:"datasets"`
}

type DeleteRequest

type DeleteRequest struct {
	Model string `json:"model"`
}

type DirectoryBrowseRequest

type DirectoryBrowseRequest struct {
	Path string `json:"path,omitempty"`
}

type DirectoryBrowseResponse

type DirectoryBrowseResponse struct {
	CurrentPath string           `json:"current_path"`
	ParentPath  string           `json:"parent_path,omitempty"`
	HomePath    string           `json:"home_path,omitempty"`
	Roots       []string         `json:"roots"`
	Entries     []DirectoryEntry `json:"entries"`
}

type DirectoryEntry

type DirectoryEntry struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

type GenerateRequest

type GenerateRequest struct {
	Model   string        `json:"model"`
	Prompt  string        `json:"prompt"`
	Stream  *bool         `json:"stream,omitempty"`
	Options *ModelOptions `json:"options,omitempty"`
}

type GenerateResponse

type GenerateResponse struct {
	Model     string    `json:"model"`
	Response  string    `json:"response"`
	Done      bool      `json:"done"`
	CreatedAt time.Time `json:"created_at"`
}

type ImageGenerationJobListResponse

type ImageGenerationJobListResponse struct {
	Jobs []ImageGenerationJobResponse `json:"jobs"`
}

type ImageGenerationJobResponse

type ImageGenerationJobResponse struct {
	ID          string                          `json:"id"`
	Status      string                          `json:"status"`
	CreatedAt   time.Time                       `json:"created_at"`
	UpdatedAt   time.Time                       `json:"updated_at"`
	CompletedAt *time.Time                      `json:"completed_at,omitempty"`
	Request     OpenAIImagesGenerationRequest   `json:"request"`
	Result      *OpenAIImagesGenerationResponse `json:"result,omitempty"`
	Error       string                          `json:"error,omitempty"`
}

type ImageRuntimeInstallRequest

type ImageRuntimeInstallRequest struct {
	UpgradePackages bool `json:"upgrade_packages,omitempty"`
}

type LoadRequest

type LoadRequest struct {
	Model       string `json:"model"`
	Stream      *bool  `json:"stream,omitempty"`
	KeepAlive   string `json:"keep_alive,omitempty"`
	NumCtx      int    `json:"num_ctx,omitempty"`
	NumParallel int    `json:"num_parallel,omitempty"`
	NGPULayers  *int   `json:"n_gpu_layers,omitempty"`
	CacheTypeK  string `json:"cache_type_k,omitempty"`
	CacheTypeV  string `json:"cache_type_v,omitempty"`
	DType       string `json:"dtype,omitempty"`
}

type LoadResponse

type LoadResponse struct {
	Status  string `json:"status"`
	Step    string `json:"step,omitempty"`
	Current int    `json:"current,omitempty"`
	Total   int    `json:"total,omitempty"`
}

type LocalInferenceSupport

type LocalInferenceSupport struct {
	Supported           bool   `json:"supported"`
	Runtime             string `json:"runtime,omitempty"`
	Mode                string `json:"mode"`
	Architecture        string `json:"architecture,omitempty"`
	RuntimeArchitecture string `json:"runtime_architecture,omitempty"`
}

type LocalModelSearchResponse

type LocalModelSearchResponse struct {
	Query       string      `json:"query,omitempty"`
	Format      string      `json:"format,omitempty"`
	PipelineTag string      `json:"pipeline_tag,omitempty"`
	Limit       int         `json:"limit"`
	Offset      int         `json:"offset"`
	Total       int         `json:"total"`
	HasMore     bool        `json:"has_more"`
	Models      []ModelInfo `json:"models"`
}

type Message

type Message struct {
	Role             string       `json:"role"`
	Content          interface{}  `json:"content"`
	Thinking         string       `json:"thinking,omitempty"`
	ReasoningContent string       `json:"reasoning_content,omitempty"`
	ToolCalls        []ToolCall   `json:"tool_calls,omitempty"`
	ToolName         string       `json:"tool_name,omitempty"`
	ToolCallID       string       `json:"tool_call_id,omitempty"`
	Meta             *MessageMeta `json:"meta,omitempty"`
}

type MessageMeta

type MessageMeta struct {
	Tokens     int               `json:"tokens,omitempty"`
	Speed      float64           `json:"speed,omitempty"`
	DurationMS int64             `json:"duration_ms,omitempty"`
	Estimated  bool              `json:"estimated,omitempty"`
	Sources    []WebSearchResult `json:"sources,omitempty"`
}

type ModelFileEntry

type ModelFileEntry struct {
	Path        string `json:"path"`
	Size        int64  `json:"size"`
	SHA256      string `json:"sha256,omitempty"`
	LFS         bool   `json:"lfs,omitempty"`
	DownloadURL string `json:"download_url"`
}

type ModelInfo

type ModelInfo struct {
	Name             string        `json:"name"`
	Model            string        `json:"model"`
	Size             int64         `json:"size"`
	Format           string        `json:"format"`
	ModifiedAt       time.Time     `json:"modified_at"`
	Label            string        `json:"label,omitempty"`
	DisplayName      string        `json:"display_name,omitempty"`
	Source           string        `json:"source,omitempty"`
	Origin           string        `json:"origin,omitempty"`
	Provider         string        `json:"provider,omitempty"`
	Category         string        `json:"category,omitempty"`
	PipelineTag      string        `json:"pipeline_tag,omitempty"`
	InputModalities  []string      `json:"input_modalities,omitempty"`
	OutputModalities []string      `json:"output_modalities,omitempty"`
	HasMMProj        bool          `json:"has_mmproj,omitempty"`
	ContextWindow    int64         `json:"context_window,omitempty"`
	Description      string        `json:"description,omitempty"`
	License          string        `json:"license,omitempty"`
	LLMType          string        `json:"llm_type,omitempty"`
	OwnedBy          string        `json:"owned_by,omitempty"`
	Pricing          *ModelPricing `json:"pricing,omitempty"`
}

type ModelManifestResponse

type ModelManifestResponse struct {
	Details        ModelInfo             `json:"details"`
	Files          []ModelFileEntry      `json:"files"`
	LocalInference LocalInferenceSupport `json:"local_inference"`
}

type ModelOptions

type ModelOptions struct {
	Temperature float64 `json:"temperature,omitempty"`
	TopP        float64 `json:"top_p,omitempty"`
	TopK        int     `json:"top_k,omitempty"`
	MaxTokens   int     `json:"max_tokens,omitempty"`
	Seed        int     `json:"seed,omitempty"`
	NumCtx      int     `json:"num_ctx,omitempty"`
	NumParallel int     `json:"num_parallel,omitempty"`
	NGPULayers  *int    `json:"n_gpu_layers,omitempty"`
	CacheTypeK  string  `json:"cache_type_k,omitempty"`
	CacheTypeV  string  `json:"cache_type_v,omitempty"`
	DType       string  `json:"dtype,omitempty"`
}

type ModelPricing

type ModelPricing struct {
	InputTokenPrice  *ModelTokenPrice `json:"input_token_price,omitempty"`
	OutputTokenPrice *ModelTokenPrice `json:"output_token_price,omitempty"`
}

type ModelProvidersResponse

type ModelProvidersResponse struct {
	Providers []ProviderInfo `json:"providers"`
}

type ModelTokenPrice

type ModelTokenPrice struct {
	Currency        string  `json:"currency,omitempty"`
	PricePerMillion float64 `json:"price_per_million"`
}

type ModelUploadResponse

type ModelUploadResponse struct {
	Status  string           `json:"status"`
	Model   string           `json:"model"`
	Details ModelInfo        `json:"details"`
	Files   []ModelFileEntry `json:"files"`
}

type ModelUploadStartRequest

type ModelUploadStartRequest struct {
	Model     string `json:"model,omitempty"`
	Mode      string `json:"mode,omitempty"`
	Overwrite bool   `json:"overwrite,omitempty"`
}

type ModelUploadStartResponse

type ModelUploadStartResponse struct {
	UploadID string `json:"upload_id"`
}

type OpenAIAudioSegment

type OpenAIAudioSegment struct {
	ID    int     `json:"id,omitempty"`
	Start float64 `json:"start,omitempty"`
	End   float64 `json:"end,omitempty"`
	Text  string  `json:"text"`
}

type OpenAIAudioTranscriptionRequest

type OpenAIAudioTranscriptionRequest struct {
	Model          string   `json:"model"`
	FilePath       string   `json:"file_path"`
	Source         string   `json:"source,omitempty"`
	Language       string   `json:"language,omitempty"`
	Prompt         string   `json:"prompt,omitempty"`
	ResponseFormat string   `json:"response_format,omitempty"`
	Stream         bool     `json:"stream,omitempty"`
	Temperature    *float64 `json:"temperature,omitempty"`
	Hotwords       []string `json:"hotwords,omitempty"`
	ITN            *bool    `json:"itn,omitempty"`
}

type OpenAIAudioTranscriptionResponse

type OpenAIAudioTranscriptionResponse struct {
	Text     string                 `json:"text"`
	Task     string                 `json:"task,omitempty"`
	Language string                 `json:"language,omitempty"`
	Duration *float64               `json:"duration,omitempty"`
	Segments []OpenAIAudioSegment   `json:"segments,omitempty"`
	Backend  string                 `json:"backend,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

type OpenAIChatRequest

type OpenAIChatRequest struct {
	Model              string                 `json:"model"`
	Source             string                 `json:"source,omitempty"`
	Messages           []Message              `json:"messages"`
	Tools              []Tool                 `json:"tools,omitempty"`
	ToolChoice         interface{}            `json:"tool_choice,omitempty"`
	ParallelToolCalls  *bool                  `json:"parallel_tool_calls,omitempty"`
	ChatTemplateKwargs map[string]interface{} `json:"chat_template_kwargs,omitempty"`
	Stream             *bool                  `json:"stream,omitempty"`
	Temperature        *float64               `json:"temperature,omitempty"`
	TopP               *float64               `json:"top_p,omitempty"`
	MaxTokens          *int                   `json:"max_tokens,omitempty"`
	NumCtx             *int                   `json:"num_ctx,omitempty"`
	NumParallel        *int                   `json:"num_parallel,omitempty"`
	NGPULayers         *int                   `json:"n_gpu_layers,omitempty"`
	CacheTypeK         *string                `json:"cache_type_k,omitempty"`
	CacheTypeV         *string                `json:"cache_type_v,omitempty"`
	DType              *string                `json:"dtype,omitempty"`
	Seed               *int                   `json:"seed,omitempty"`
	Stop               []string               `json:"stop,omitempty"`
}

type OpenAIChatResponse

type OpenAIChatResponse struct {
	ID      string         `json:"id"`
	Object  string         `json:"object"`
	Created int64          `json:"created"`
	Model   string         `json:"model"`
	Choices []OpenAIChoice `json:"choices"`
	Usage   OpenAIUsage    `json:"usage"`
}

type OpenAIChoice

type OpenAIChoice struct {
	Index        int      `json:"index"`
	Message      *Message `json:"message,omitempty"`
	Delta        *Message `json:"delta,omitempty"`
	FinishReason *string  `json:"finish_reason"`
}

type OpenAIEmbeddingObject

type OpenAIEmbeddingObject struct {
	Object    string      `json:"object"`
	Embedding interface{} `json:"embedding"`
	Index     int         `json:"index"`
}

type OpenAIEmbeddingsRequest

type OpenAIEmbeddingsRequest struct {
	Model      string      `json:"model"`
	Source     string      `json:"source,omitempty"`
	Input      interface{} `json:"input"`
	NumCtx     *int        `json:"num_ctx,omitempty"`
	NGPULayers *int        `json:"n_gpu_layers,omitempty"`
	DType      *string     `json:"dtype,omitempty"`
}

type OpenAIEmbeddingsResponse

type OpenAIEmbeddingsResponse struct {
	Object string                  `json:"object"`
	Data   []OpenAIEmbeddingObject `json:"data"`
	Model  string                  `json:"model"`
	Usage  OpenAIUsage             `json:"usage"`
}

type OpenAIImage

type OpenAIImage struct {
	B64JSON       string `json:"b64_json,omitempty"`
	URL           string `json:"url,omitempty"`
	RevisedPrompt string `json:"revised_prompt,omitempty"`
}

type OpenAIImagesGenerationRequest

type OpenAIImagesGenerationRequest struct {
	Model          string   `json:"model"`
	Prompt         string   `json:"prompt"`
	N              *int     `json:"n,omitempty"`
	Size           string   `json:"size,omitempty"`
	ResponseFormat string   `json:"response_format,omitempty"`
	Seed           *int     `json:"seed,omitempty"`
	NegativePrompt string   `json:"negative_prompt,omitempty"`
	Steps          *int     `json:"steps,omitempty"`
	CFGScale       *float64 `json:"cfg_scale,omitempty"`
	Source         string   `json:"source,omitempty"`
	Image          string   `json:"image,omitempty"`
	Images         []string `json:"images,omitempty"`
}

type OpenAIImagesGenerationResponse

type OpenAIImagesGenerationResponse struct {
	Created int64         `json:"created"`
	Data    []OpenAIImage `json:"data"`
}

type OpenAIModel

type OpenAIModel struct {
	ID      string `json:"id"`
	Object  string `json:"object"`
	Created int64  `json:"created"`
	OwnedBy string `json:"owned_by"`
}

type OpenAIModelList

type OpenAIModelList struct {
	Object string        `json:"object"`
	Data   []OpenAIModel `json:"data"`
}

type OpenAIUsage

type OpenAIUsage struct {
	PromptTokens     int `json:"prompt_tokens"`
	CompletionTokens int `json:"completion_tokens"`
	TotalTokens      int `json:"total_tokens"`
}

type PipelineTagGroup

type PipelineTagGroup struct {
	Category string   `json:"category"`
	Label    string   `json:"label"`
	Tags     []string `json:"tags"`
}

type PipelineTagsResponse

type PipelineTagsResponse struct {
	PipelineTags []PipelineTagGroup `json:"pipeline_tags"`
}

type ProviderInfo

type ProviderInfo struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	Source     string `json:"source,omitempty"`
	ModelCount int    `json:"model_count"`
}

type ProviderTagModelRequest

type ProviderTagModelRequest struct {
	Model       string `json:"model"`
	DisplayName string `json:"display_name,omitempty"`
	Description string `json:"description,omitempty"`
}

type ProviderTagModelSelection

type ProviderTagModelSelection struct {
	Model       string `json:"model"`
	DisplayName string `json:"display_name,omitempty"`
	Description string `json:"description,omitempty"`
}

func (*ProviderTagModelSelection) UnmarshalJSON

func (s *ProviderTagModelSelection) UnmarshalJSON(data []byte) error

type ProviderTagModelUpdateRequest

type ProviderTagModelUpdateRequest struct {
	Model       *string `json:"model,omitempty"`
	DisplayName *string `json:"display_name,omitempty"`
	Description *string `json:"description,omitempty"`
}

type ProviderTagModelsReplaceRequest

type ProviderTagModelsReplaceRequest struct {
	Models []ProviderTagModelSelection `json:"models"`
}

type PsResponse

type PsResponse struct {
	Models []RunningModel `json:"models"`
}

type PullJobResponse

type PullJobResponse struct {
	ID          string       `json:"id"`
	Status      string       `json:"status"`
	Kind        string       `json:"kind"`
	Name        string       `json:"name"`
	Quant       string       `json:"quant,omitempty"`
	Quants      []string     `json:"quants,omitempty"`
	CreatedAt   time.Time    `json:"created_at"`
	UpdatedAt   time.Time    `json:"updated_at"`
	CompletedAt *time.Time   `json:"completed_at,omitempty"`
	Progress    PullResponse `json:"progress"`
	Error       string       `json:"error,omitempty"`
}

type PullRequest

type PullRequest struct {
	Model string `json:"model"`
	// Quant selects a GGUF weight variant when multiple quantizations exist (e.g. Q4_K_M). Ignored for non-GGUF models.
	Quant string `json:"quant,omitempty"`
	// Quants selects one or more GGUF weight variants. When set, it takes precedence over Quant.
	Quants []string `json:"quants,omitempty"`
}

type PullResponse

type PullResponse struct {
	Status         string `json:"status"`
	Digest         string `json:"digest,omitempty"`
	Total          int64  `json:"total,omitempty"`
	Completed      int64  `json:"completed,omitempty"`
	TotalBytes     int64  `json:"total_bytes,omitempty"`
	CompletedBytes int64  `json:"completed_bytes,omitempty"`
}

type RunningModel

type RunningModel struct {
	Name      string    `json:"name"`
	Model     string    `json:"model"`
	Size      int64     `json:"size"`
	Format    string    `json:"format"`
	Status    string    `json:"status,omitempty"`
	ExpiresAt time.Time `json:"expires_at"`
}

type SettingsResponse

type SettingsResponse struct {
	Version                  string            `json:"version"`
	StorageDir               string            `json:"storage_dir"`
	ModelDir                 string            `json:"model_dir"`
	DatasetDir               string            `json:"dataset_dir"`
	ServerURL                string            `json:"server_url"`
	AIGatewayURL             string            `json:"ai_gateway_url"`
	CloudProviderName        string            `json:"cloud_provider_name"`
	DefaultCloudProviderName string            `json:"default_cloud_provider_name"`
	DefaultServerURL         string            `json:"default_server_url"`
	DefaultAIGatewayURL      string            `json:"default_ai_gateway_url"`
	Autostart                bool              `json:"autostart"`
	WebSearch                WebSearchSettings `json:"web_search"`
}

type SettingsUpdateRequest

type SettingsUpdateRequest struct {
	StorageDir        string             `json:"storage_dir,omitempty"`
	ModelDir          string             `json:"model_dir,omitempty"`
	DatasetDir        string             `json:"dataset_dir,omitempty"`
	ServerURL         *string            `json:"server_url,omitempty"`
	AIGatewayURL      *string            `json:"ai_gateway_url,omitempty"`
	CloudProviderName *string            `json:"cloud_provider_name,omitempty"`
	Autostart         *bool              `json:"autostart,omitempty"`
	WebSearch         *WebSearchSettings `json:"web_search,omitempty"`
}

type ShowRequest

type ShowRequest struct {
	Model string `json:"model"`
}

type ShowResponse

type ShowResponse struct {
	ModelFile string    `json:"modelfile"`
	Details   ModelInfo `json:"details"`
}

type StopRequest

type StopRequest struct {
	Model string `json:"model"`
}

type TagsResponse

type TagsResponse struct {
	Models []ModelInfo `json:"models"`
}

type ThirdPartyProvider

type ThirdPartyProvider struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	BaseURL  string `json:"base_url"`
	APIKey   string `json:"api_key,omitempty"`
	Provider string `json:"provider,omitempty"` // e.g., "openai", "anthropic", "deepseek"
	Enabled  bool   `json:"enabled"`
}

type ThirdPartyProviderCreateRequest

type ThirdPartyProviderCreateRequest struct {
	Name     string `json:"name"`
	BaseURL  string `json:"base_url"`
	APIKey   string `json:"api_key"`
	Provider string `json:"provider,omitempty"`
	Enabled  *bool  `json:"enabled,omitempty"`
}

type ThirdPartyProviderUpdateRequest

type ThirdPartyProviderUpdateRequest struct {
	Name     string `json:"name,omitempty"`
	BaseURL  string `json:"base_url,omitempty"`
	APIKey   string `json:"api_key,omitempty"`
	Provider string `json:"provider,omitempty"`
	Enabled  *bool  `json:"enabled,omitempty"`
}

type ThirdPartyProviderValidateRequest

type ThirdPartyProviderValidateRequest struct {
	ID       string `json:"id,omitempty"`
	Name     string `json:"name,omitempty"`
	BaseURL  string `json:"base_url"`
	APIKey   string `json:"api_key,omitempty"`
	Provider string `json:"provider,omitempty"`
	Enabled  *bool  `json:"enabled,omitempty"`
}

type ThirdPartyProviderValidateResponse

type ThirdPartyProviderValidateResponse struct {
	Valid      bool `json:"valid"`
	ModelCount int  `json:"model_count"`
}

type ThirdPartyProvidersResponse

type ThirdPartyProvidersResponse struct {
	Providers []ThirdPartyProvider `json:"providers"`
}

type Tool

type Tool struct {
	Type     string       `json:"type"`
	Function ToolFunction `json:"function"`
}

type ToolCall

type ToolCall struct {
	Index    *int         `json:"index,omitempty"`
	ID       string       `json:"id,omitempty"`
	Type     string       `json:"type"`
	Function ToolFunction `json:"function"`
}

type ToolFunction

type ToolFunction struct {
	Index       *int        `json:"index,omitempty"`
	Name        string      `json:"name"`
	Description string      `json:"description,omitempty"`
	Parameters  interface{} `json:"parameters,omitempty"`
	Arguments   interface{} `json:"arguments,omitempty"`
}

type UpgradeCheckResponse

type UpgradeCheckResponse struct {
	CurrentVersion  string `json:"current_version"`
	LatestVersion   string `json:"latest_version"`
	UpdateAvailable bool   `json:"update_available"`
	ReleaseNotes    string `json:"release_notes,omitempty"`
	ReleaseURL      string `json:"release_url,omitempty"`
}

type UpgradeProgressResponse

type UpgradeProgressResponse struct {
	Status   string `json:"status"`   // "checking", "downloading", "extracting", "installing", "completed", "error"
	Progress int    `json:"progress"` // 0-100
	Message  string `json:"message"`
	Version  string `json:"version,omitempty"`
}

type WebSearchOptions

type WebSearchOptions struct {
	Enabled bool   `json:"enabled,omitempty"`
	Query   string `json:"query,omitempty"`
}

type WebSearchResult

type WebSearchResult struct {
	Title       string  `json:"title"`
	URL         string  `json:"url"`
	Snippet     string  `json:"snippet,omitempty"`
	Engine      string  `json:"engine,omitempty"`
	Category    string  `json:"category,omitempty"`
	Score       float64 `json:"score,omitempty"`
	PublishedAt string  `json:"published_at,omitempty"`
}

type WebSearchSettings

type WebSearchSettings struct {
	Enabled        bool     `json:"enabled"`
	MaxResults     int      `json:"max_results"`
	Language       string   `json:"language,omitempty"`
	Providers      []string `json:"providers,omitempty"`
	SafeSearch     int      `json:"safe_search"`
	TimeoutSeconds int      `json:"timeout_seconds"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL