ollama

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 9 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"
)

Known model IDs for Ollama. These are tested and known to work well with the chat API.

View Source
const ModelDefault = ModelGLM47Flash

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider implements the Ollama (local) LLM backend.

func New

func New(baseURL string) *Provider

New creates a new Ollama provider. If baseURL is empty, defaults to http://localhost:11434.

func (*Provider) CreateStream

func (p *Provider) CreateStream(ctx context.Context, opts llm.StreamOptions) (<-chan llm.StreamEvent, error)

func (*Provider) DefaultModel

func (p *Provider) DefaultModel() string

DefaultModel returns the configured default model ID.

func (*Provider) Download

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

Download pulls the specified models from the Ollama registry. This method blocks until all models are downloaded. Models that are already installed will be skipped.

func (*Provider) FetchModels

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

FetchModels retrieves the list of currently installed models from Ollama. This enumerates ALL models, including ones that may not support chat.

func (*Provider) Models

func (p *Provider) Models() []llm.Model

Models returns a curated list of tested models that are known to work with streaming, tool calling, and conversations. These models are verified to be compatible with all features.

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) WithDefaultModel

func (p *Provider) WithDefaultModel(modelID string) *Provider

WithDefaultModel sets the default model to use.

Jump to

Keyboard shortcuts

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