Documentation
¶
Overview ¶
Package ollama manages the Ollama process lifecycle for Cortex.
It provides health checking, automatic startup, model detection, and model pulling — all used by the TUI, CLI, and app initialization.
Index ¶
- type Manager
- func (m *Manager) BaseURL() string
- func (m *Manager) EnsureRunning(ctx context.Context) error
- func (m *Manager) HasModel(ctx context.Context, model string) (bool, error)
- func (m *Manager) IsRunning(ctx context.Context) bool
- func (m *Manager) PullModel(ctx context.Context, model string, progressFn func(string)) error
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) StartedByUs() bool
- func (m *Manager) WaitReady(ctx context.Context, timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles checking, starting, and provisioning Ollama.
func NewManager ¶
NewManager creates a new Ollama manager. If baseURL is empty, defaults to http://localhost:11434.
func (*Manager) EnsureRunning ¶
EnsureRunning checks if Ollama is running, starts it if not, and waits for readiness.
func (*Manager) PullModel ¶
PullModel runs `ollama pull <model>` and reports progress via the callback. The progressFn is called with status strings; it may be nil.
func (*Manager) Start ¶
Start launches `ollama serve` as a background process. It does not wait for readiness — use WaitReady after Start.
func (*Manager) StartedByUs ¶
StartedByUs returns true if this manager started the Ollama process.