statetype

package
v0.28.14 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnrichFromOllamaShow

func EnrichFromOllamaShow(m *ModelPullStatus, r *api.ShowResponse)

EnrichFromOllamaShow populates capability and context fields on a ModelPullStatus using the response from Ollama's /api/show endpoint. Only zero/false fields are written — callers may override afterwards.

Types

type BackendRuntimeState

type BackendRuntimeState struct {
	ID           string               `json:"id" example:"b7d9e1a3-8f0c-4a7d-9b1e-2f3a4b5c6d7e"`
	Name         string               `json:"name" example:"ollama-production"`
	Models       []string             `json:"models" example:"[\"mistral:instruct\", \"llama2:7b\", \"nomic-embed-text:latest\"]"`
	PulledModels []ModelPullStatus    `json:"pulledModels" openapi_include_type:"statetype.ModelPullStatus"`
	Backend      runtimetypes.Backend `json:"backend"`
	// Error stores a description of the last encountered error when
	// interacting with or reconciling this backend's state, if any.
	Error string `json:"error,omitempty" example:"connection timeout: context deadline exceeded"`
	// contains filtered or unexported fields
}

BackendRuntimeState represents the observed state of a single LLM backend.

func (*BackendRuntimeState) GetAPIKey

func (s *BackendRuntimeState) GetAPIKey() string

func (*BackendRuntimeState) SetAPIKey

func (s *BackendRuntimeState) SetAPIKey(key string)

type ModelDetails

type ModelDetails struct {
	ParentModel       string   `json:"parentModel" example:"mistral:7b"`
	Format            string   `json:"format" example:"gguf"`
	Family            string   `json:"family" example:"Mistral"`
	Families          []string `json:"families" example:"[\"Mistral\", \"7B\"]"`
	ParameterSize     string   `json:"parameterSize" example:"7B"`
	QuantizationLevel string   `json:"quantizationLevel" example:"Q4_K_M"`
}

type ModelPullStatus

type ModelPullStatus struct {
	Name          string       `json:"name" example:"Mistral 7B Instruct"`
	Model         string       `json:"model" example:"mistral:instruct"`
	ModifiedAt    time.Time    `json:"modifiedAt" example:"2023-11-15T14:30:45Z"`
	Size          int64        `json:"size" example:"4709611008"`
	Digest        string       `json:"digest" example:"sha256:9e3a6c0d3b5e7f8a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a"`
	Details       ModelDetails `json:"details" openapi_include_type:"statetype.ModelDetails"`
	ContextLength int          `json:"contextLength" example:"4096"`
	CanChat       bool         `json:"canChat" example:"true"`
	CanEmbed      bool         `json:"canEmbed" example:"false"`
	CanPrompt     bool         `json:"canPrompt" example:"true"`
	CanStream     bool         `json:"canStream" example:"true"`
	CanThink      bool         `json:"canThink,omitempty" example:"true"`
}

func ConvertOllamaModelResponse

func ConvertOllamaModelResponse(model *api.ListModelResponse) *ModelPullStatus

Jump to

Keyboard shortcuts

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