config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package registry wires concrete LLM providers into an llmproxy.Client. This package is the only place that imports both llmproxy and provider/*; llmproxy itself has no knowledge of concrete provider implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(cfg ProviderConfig) []llmproxy.Provider

Build returns the set of providers enabled by the given configuration. Unconfigured providers are skipped; if a provider fails to initialize, it is logged and omitted rather than failing the whole build.

func NewConfig

func NewConfig[T any]() *T

NewConfig creates a new configuration instance of the specified type T is a generic type that allows creating configurations for different structs

Types

type EmbeddingConfig

type EmbeddingConfig struct {
	BatchSize      int           `env:"EMBEDDING_BATCH_SIZE" envDefault:"20"`
	MaxConcurrent  int           `env:"EMBEDDING_MAX_CONCURRENT" envDefault:"1"`
	MaxPerAccount  int           `env:"EMBEDDING_MAX_PER_ACCOUNT" envDefault:"3"`
	BatchTimeout   time.Duration `env:"EMBEDDING_BATCH_TIMEOUT" envDefault:"30s"`
	QueryTimeout   time.Duration `env:"EMBEDDING_QUERY_TIMEOUT" envDefault:"30s"`
	ExtractTimeout time.Duration `env:"EMBEDDING_EXTRACT_TIMEOUT" envDefault:"5m"`
}

type ProviderConfig

type ProviderConfig struct {
	OpenAI    openai.Config
	Mistral   mistral.Config
	Gemini    gemini.Config
	Anthropic anthropic.Config

	// SelfHosted points to a YAML file describing locally-hosted endpoints.
	// nil = self-hosted provider disabled.
	SelfHosted *string `env:"SELFHOSTED_CONFIG_FILE"`
}

ProviderConfig holds the API keys for different LLM providers

Jump to

Keyboard shortcuts

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