config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: AGPL-3.0 Imports: 8 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
}

ProviderConfig holds the env-delivered API keys for the catalog LLM providers. Structured providers (self-hosted endpoints, backend-routed stand-ins) are not configured here.

Jump to

Keyboard shortcuts

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