llm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultOllamaModel = "qwen2.5-coder:3b"

DefaultOllamaModel is pulled when --llm-model is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config) (ports.LLM, error)

New returns noop, ollama, or native depending on mode.

Types

type Config

type Config struct {
	Mode        string
	Model       string
	Endpoint    string
	Timeout     time.Duration
	PullTimeout time.Duration
	APIKey      string
	Logger      *slog.Logger
}

Config selects an LLM adapter.

type Noop

type Noop struct{}

Noop never classifies or rewrites.

func (Noop) Classify

func (Noop) Close

func (Noop) Close() error

func (Noop) Name

func (Noop) Name() string

func (Noop) Rewrite

type Ollama

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

Ollama talks to a local Ollama HTTP API. If Endpoint is set, it only connects (config mode). If Endpoint is empty, it reuses :11434, otherwise a single blot-managed server on :12434. A previous managed process (and its llama-server children) is stopped before a new one is started.

func (*Ollama) Classify

func (o *Ollama) Classify(ctx context.Context, in ports.ClassifyIn) (ports.ClassifyOut, error)

func (*Ollama) Close

func (o *Ollama) Close() error

func (*Ollama) Name

func (o *Ollama) Name() string

func (*Ollama) Rewrite

func (o *Ollama) Rewrite(ctx context.Context, in ports.RewriteIn) (ports.RewriteOut, error)

Jump to

Keyboard shortcuts

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