Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
Name string `yaml:"name" json:"name"`
URL string `yaml:"url" json:"url"`
Protocol string `yaml:"protocol" json:"protocol"`
Headers map[string]string `yaml:"headers" json:"headers"`
Models []Model `yaml:"models" json:"models"`
PathPrefix string `yaml:"path_prefix" json:"path_prefix"`
StripPrefix bool `yaml:"strip_prefix" json:"strip_prefix"`
Default bool `yaml:"default" json:"default"`
Priority int `yaml:"priority" json:"priority"`
Weight int `yaml:"weight" json:"weight"`
Timeout string `yaml:"timeout" json:"timeout"` // per-backend request timeout, e.g. "120s"; empty = use global default
SSEOnly bool `yaml:"sse_only" json:"sse_only"` // when true, WS clients use HTTP SSE directly (skip WS dial)
HealthCheck *HealthCheckConfig `yaml:"health_check" json:"health_check"`
}
type CircuitBreakerConfig ¶
type Config ¶
type Config struct {
Listen string `yaml:"listen"`
Debug bool `yaml:"debug"`
MaxConcurrentRequests int `yaml:"max_concurrent_requests"` // 0 = unlimited
Backends []Backend `yaml:"backends"`
TokenLog TokenLogConfig `yaml:"token_log"`
APIKeys map[string]string `yaml:"api_keys"`
ModelDefaults map[string]ModelDefaultConfig `yaml:"model_defaults"`
SystemPrompt string `yaml:"system_prompt"`
CircuitBreaker CircuitBreakerConfig `yaml:"circuit_breaker"`
Console ConsoleConfig `yaml:"console"`
TrustedProxies []string `yaml:"trusted_proxies"` // IPs or CIDRs; empty = only use RemoteAddr
}
func LoadConfig ¶
func NormalizeAndValidate ¶
type ConsoleConfig ¶
type HealthCheckConfig ¶
type Model ¶
type Model struct {
Name string `yaml:"name" json:"name"`
Aliases []string `yaml:"aliases" json:"aliases"`
ReasoningDefaultEffort string `yaml:"reasoning_default_effort" json:"reasoning_default_effort"`
SystemPrompt string `yaml:"system_prompt" json:"system_prompt"`
DefaultMaxTokens int `yaml:"default_max_tokens" json:"default_max_tokens"`
NormalizeXHighReasoningEffort bool `yaml:"normalize_xhigh_reasoning_effort" json:"normalize_xhigh_reasoning_effort"`
DefaultTemperature *float64 `yaml:"default_temperature,omitempty" json:"default_temperature,omitempty"`
}
type ModelDefaultConfig ¶
type ModelDefaultConfig struct {
ReasoningEffort string `yaml:"reasoning_effort" json:"reasoning_effort"`
MaxTokens int `yaml:"max_tokens" json:"max_tokens"`
SystemPrompt string `yaml:"system_prompt" json:"system_prompt"`
NormalizeXHighReasoningEffort bool `yaml:"normalize_xhigh_reasoning_effort" json:"normalize_xhigh_reasoning_effort"`
DefaultTemperature *float64 `yaml:"default_temperature,omitempty" json:"default_temperature,omitempty"`
}
type TokenLogConfig ¶
Click to show internal directories.
Click to hide internal directories.