ollama

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModelGLM47Flash      = "glm-4.7-flash"
	ModelMinistral38B    = "ministral-3:8b"
	ModelRNJ1            = "rnj-1"
	ModelFunctionGemma   = "functiongemma"
	ModelDevstralSmall2  = "devstral-small-2"
	ModelNemotron3Nano30 = "nemotron-3-nano:30b"
	ModelLlama321B       = "llama3.2:1b"
	ModelQwen317B        = "qwen3:1.7b"
	ModelQwen306B        = "qwen3:0.6b"
	ModelGranite31MoE1B  = "granite3.1-moe:1b"
	ModelQwen2505B       = "qwen2.5:0.5b"
	ModelLlama32         = "llama3.2"
	ModelLlama31         = "llama3.1"
	ModelQwen25          = "qwen2.5"
	ModelPhi3            = "phi3"
	ModelDeepSeekR1      = "deepseek-r1"
	ModelMistral         = "mistral"
	ModelGemma3          = "gemma3"
	ModelDefault         = ModelGLM47Flash
)
View Source
const EnvOllamaHost = "OLLAMA_HOST"

EnvOllamaHost is the environment variable that overrides the Ollama base URL. Set it to signal that Ollama is available for auto-detection:

export OLLAMA_HOST=http://localhost:11434

Variables

This section is empty.

Functions

func Available added in v0.40.0

func Available() bool

Available reports whether an Ollama server is reachable.

It returns true immediately when OLLAMA_HOST is set (explicit configuration). Otherwise it probes http://localhost:11434 with a 200 ms timeout, which is negligible on the loopback interface when Ollama is running locally.

func BaseURL added in v0.40.0

func BaseURL() string

BaseURL returns the effective Ollama base URL. Returns the value of OLLAMA_HOST if set, otherwise http://localhost:11434.

func DefaultOptions added in v0.12.0

func DefaultOptions() []llm.Option

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...llm.Option) *Provider

func (*Provider) CreateStream

func (p *Provider) CreateStream(ctx context.Context, src llm.Buildable) (llm.Stream, error)

func (*Provider) Download

func (p *Provider) Download(ctx context.Context, models []llm.Model) error

func (*Provider) FetchModels

func (p *Provider) FetchModels(ctx context.Context) ([]llm.Model, error)

func (*Provider) Models

func (p *Provider) Models() llm.Models

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) Resolve added in v0.40.0

func (p *Provider) Resolve(modelID string) (llm.Model, error)

Jump to

Keyboard shortcuts

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