gollm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package gollm implements llm.Runner on top of github.com/teilomillet/gollm, providing a unified adapter for Anthropic API, OpenAI, Ollama, and other providers supported by gollm. This is the opt-in alternative to the claude-cli bridge; selected via .sdd/config.local.yaml llm.provider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

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

Runner wraps a gollm client and adapts it to llm.Runner. When the provider is Anthropic, the SystemPrompt is passed with ephemeral cache control so the stable prefix is server-cached across calls in the same 5-minute window — a significant speedup for batch operations like sdd summarize --all.

func NewRunner

func NewRunner(cfg model.LLMConfig) (*Runner, error)

NewRunner constructs a gollm-backed Runner from an LLMConfig. Provider must be one of the gollm-supported providers (e.g. "anthropic", "openai", "ollama"). Returns a typed error when required config is missing (API key for remote providers).

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, req llm.Request) (*llm.RunResult, error)

Run sends the request to the underlying gollm client. When caching is enabled (Anthropic), the SystemPrompt is tagged ephemeral so the server caches the prefix. Other providers ignore the cache hint but still see the split system/user message pair.

Jump to

Keyboard shortcuts

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