Documentation
¶
Overview ¶
Package llm provides a unified interface for LLM inference across multiple providers (OpenAI, Anthropic, Google Vertex AI, Google Gemini, OpenRouter, AWS Bedrock).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InferenceOptions ¶
type InferenceOptions struct {
Provider string // "openai", "anthropic", "vertex", "gemini", "openrouter", "bedrock"
Model string
Prompt string
SystemPrompt string
MaxTokens int
// Retry
Retries int // Max retry attempts (0 = no retry)
RetryDelay time.Duration // Initial delay between retries (doubles each attempt)
Logger *slog.Logger // Logger for retry logging (optional)
// Provider-specific
TokenEnv string // Env var name holding the API key (openai, anthropic, gemini, openrouter)
Project string // GCP project ID (vertex only)
Location string // GCP region (vertex only)
}
InferenceOptions holds the configuration for a single LLM inference call.