Versions in this module Expand all Collapse all v0 v0.1.1 Mar 23, 2026 v0.1.0 Mar 22, 2026 Changes in this version + type AttemptMetric struct + Backend string + ErrorCategory string + Outcome string + type BackendHealthSnapshot struct + ActiveHealthCheck bool + ConsecutiveFails int + HalfOpenInFlight int + LastFailTime time.Time + Name string + PathPrefix string + Priority int + Protocol string + State string + URL string + Weight int + type BackendSelector struct + func NewBackendSelector(health *HealthManager) *BackendSelector + func (bs *BackendSelector) Select(candidates []modelEntry) *candidateResult + func (bs *BackendSelector) SelectFallback(candidates []modelEntry) []candidateResult + func (bs *BackendSelector) SelectOrdered(candidates []modelEntry) []candidateResult + type CanonicalEvent struct + Data json.RawMessage + EventType string + type ConsoleRouteOptions struct + BasePath string + type DefaultOpts struct + MaxTokens int + NormalizeXHigh bool + Temperature *float64 + type EncodeOpts struct + ReasoningEffort string + SystemPrompt string + type HealthManager struct + func NewHealthManager(cfg HealthManagerConfig, client *http.Client, debug *logging.DebugLog) *HealthManager + func (hm *HealthManager) AllBackendsDown() bool + func (hm *HealthManager) CircuitState(name string) string + func (hm *HealthManager) IsHealthy(name string) bool + func (hm *HealthManager) ReleaseProbe(name string) + func (hm *HealthManager) ReportFailure(name string) bool + func (hm *HealthManager) ReportSuccess(name string) + func (hm *HealthManager) Snapshot(backends []config.Backend) []BackendHealthSnapshot + func (hm *HealthManager) StartActiveChecks(backends []config.Backend) + func (hm *HealthManager) Stop() + func (hm *HealthManager) TryAcquireProbe(name string) bool + type HealthManagerConfig struct + FailThreshold int + HalfOpenMaxRequests int + RecoveryTimeout time.Duration + type ModelIndex struct + func BuildModelIndex(backends []config.Backend) *ModelIndex + func (idx *ModelIndex) AllAliases() []string + func (idx *ModelIndex) DefaultBackend() *config.Backend + func (idx *ModelIndex) MatchByPrefix(path string) (*config.Backend, bool) + func (idx *ModelIndex) Resolve(alias string) (backend *config.Backend, backendModel string, found bool) + func (idx *ModelIndex) ResolveCandidates(alias string) ([]modelEntry, bool) + func (idx *ModelIndex) ResolveWithinBackend(alias string, backend *config.Backend) ([]modelEntry, bool) + type Observer interface + ObserveAttempt func(metric AttemptMetric) + ObserveRequest func(metric RequestMetric) + func NewNoopObserver() Observer + func NewPrometheusObserver() (Observer, http.Handler, error) + type ProtocolCodec interface + DetectInbound func(path string, headers http.Header) bool + ExtractUsage func(body []byte) logging.UsageInfo + FromCanonical func(body []byte) ([]byte, string, error) + InjectDefaults func(body []byte, opts DefaultOpts) []byte + InjectSystemPrompt func(body []byte, prompt string) []byte + Name func() string + NewStreamDecoder func() StreamDecoder + NewStreamEncoder func(w http.ResponseWriter) StreamEncoder + ResponseFromCanonical func(body []byte, statusCode int) ([]byte, error) + ResponseToCanonical func(body []byte, statusCode int) ([]byte, error) + ToCanonical func(body []byte, opts EncodeOpts) ([]byte, error) + type RequestMetric struct + Backend string + ClientProtocol string + Duration time.Duration + ErrorCategory string + Result string + RetryCount int + StatusCode int + type Server struct + Cfg config.Config + Client *http.Client + Codecs map[string]ProtocolCodec + ConfigPath string + Debug *logging.DebugLog + Health *HealthManager + ModelIndex *ModelIndex + Observer Observer + Selector *BackendSelector + TokenLog *logging.TokenLogger + func New(cfg config.Config, tokenLog *logging.TokenLogger, debug *logging.DebugLog, ...) *Server + func (s *Server) AllBackendsDown() bool + func (s *Server) Close() error + func (s *Server) CurrentConfig() config.Config + func (s *Server) Handle(w http.ResponseWriter, r *http.Request) + func (s *Server) RegisterConsoleRoutes(mux *http.ServeMux) + func (s *Server) RegisterConsoleRoutesWithOptions(mux *http.ServeMux, opts ConsoleRouteOptions) + func (s *Server) ReloadConfig(newCfg config.Config) error + func (s *Server) SaveAndReloadConfig(path string, cfg config.Config) error + func (s *Server) SetConfigPath(path string) + type StreamDecoder interface + Decode func(line string) ([]CanonicalEvent, error) + Flush func() ([]CanonicalEvent, logging.UsageInfo) + type StreamEncoder interface + Close func() error + Encode func(event CanonicalEvent) error