Help us shape the future of Go! Take the 2026 Go Developer Survey

model

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureLLMSpy

func ConfigureLLMSpy(cfg *config.Config, u *ui.UI, provider, apiKey string) error

ConfigureLLMSpy enables a cloud provider in the llmspy gateway. It discovers the provider's env var from the running llmspy pod, patches the llms-secrets Secret with the API key, enables the provider in the llmspy-config ConfigMap, and restarts the deployment.

func FormatBytes added in v0.5.0

func FormatBytes(b int64) string

FormatBytes formats a byte count as a human-readable string.

func GetProviderStatus

func GetProviderStatus(cfg *config.Config) (map[string]ProviderStatus, error)

GetProviderStatus reads llmspy state and returns global provider status. It queries the llmspy pod for available providers and cross-references with the ConfigMap (enabled/disabled) and Secret (API keys).

func PullOllamaModel added in v0.5.0

func PullOllamaModel(name string) error

PullOllamaModel pulls a model from the Ollama registry. It streams progress to stdout, matching the UX of `ollama pull`.

Types

type OllamaModel added in v0.5.0

type OllamaModel struct {
	Name       string `json:"name"`
	Size       int64  `json:"size"`
	ModifiedAt string `json:"modified_at"`
}

OllamaModel describes a model pulled in the local Ollama instance.

func ListOllamaModels added in v0.5.0

func ListOllamaModels() ([]OllamaModel, error)

ListOllamaModels queries the local Ollama server for pulled models. Returns nil and an error if Ollama is not reachable.

type ProviderInfo added in v0.3.1

type ProviderInfo struct {
	ID     string // provider id (e.g. "zai", "anthropic")
	Name   string // display name (e.g. "Z.AI", "Anthropic")
	EnvVar string // env var for API key (e.g. "ZHIPU_API_KEY")
}

ProviderInfo describes an llmspy provider discovered from the running pod.

func GetAvailableProviders added in v0.3.1

func GetAvailableProviders(cfg *config.Config) ([]ProviderInfo, error)

GetAvailableProviders queries the llmspy pod for all providers that accept an API key.

type ProviderStatus

type ProviderStatus struct {
	Enabled   bool
	HasAPIKey bool
	EnvVar    string // environment variable name (e.g. ANTHROPIC_API_KEY)
}

ProviderStatus captures effective global llmspy provider state.

Jump to

Keyboard shortcuts

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