factory

package
v0.17.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package factory is the local host's llm.Runner composition: it resolves model.LLMConfig — a host-private config schema that never goes public — into one composed pkg/llm Runner (provider adapter, rate-limit decorator, timeout decorator).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

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

New builds a composed 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. Every runner is bounded by the configured cfg.Timeout (falling back to defaultTimeout) — deadlines are configuration, so they compose here rather than being defaulted by any consumer. 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