factory

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package factory resolves an llm.Runner from model.LLMConfig. It lives in a sub-package to break the import cycle: internal/llm defines the Runner interface consumed by the claude and gollm sub-packages, and the factory sits above all three to dispatch and wrap.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg model.LLMConfig) (llm.Runner, error)

New builds an llm.Runner from config. Provider and model fall back to model.DefaultLLMProvider / model.DefaultLLMModel when empty. Remote providers (anthropic, openai) get wrapped with a rate.Limiter: an explicit cfg.RateLimitRPS takes precedence, otherwise a conservative tier-1-safe default is selected per provider/model family (see providerDefaultRPS). Local providers (claude-cli, ollama) stay uncapped. Errors distinguish configuration problems from transport failures so the CLI can surface them distinctly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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