Help us shape the future of Go! Take the 2026 Go Developer Survey

proxy

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 46 Imported by: 0

Documentation

Overview

Package proxy contains configuration, middleware, routing, and model interaction logic for the language model proxy server.

Index

Constants

View Source
const (
	// CatalogControlEnum identifies a control with an exact value vocabulary.
	CatalogControlEnum = "enum"
	// CatalogControlInteger identifies a bounded integer control.
	CatalogControlInteger = "integer"
	// CatalogControlBoolean identifies a Boolean control.
	CatalogControlBoolean = "boolean"
	// CatalogCurrencyUSD identifies published United States dollar prices.
	CatalogCurrencyUSD = "USD"
)
View Source
const (
	// DefaultPort is the TCP port used by the HTTP server when no explicit port is provided.
	DefaultPort = 8080
	// DefaultWorkers is the maximum number of concurrent upstream HTTP operations.
	DefaultWorkers = 4
	// DefaultQueueSize is the number of upstream HTTP operations that may wait for a worker.
	DefaultQueueSize = 100
	// DefaultModel is the model identifier used when the client does not supply one.
	DefaultModel = ModelNameGPT41
	// DefaultProvider is the provider identifier used when the client does not supply one.
	DefaultProvider = ProviderNameOpenAI
	// DefaultDictationProvider is the provider used when /dictate does not supply one.
	DefaultDictationProvider = ProviderNameOpenAI

	// DefaultRequestTimeoutSeconds is the request work budget used when the client omits one.
	DefaultRequestTimeoutSeconds = 360
	// DefaultMaxRequestTimeoutSeconds is the one-hour operator capacity ceiling for a request.
	DefaultMaxRequestTimeoutSeconds = 60 * 60
	// DefaultMaxPromptBytes limits JSON LLM request bodies accepted by POST /.
	DefaultMaxPromptBytes = 4 * 1024 * 1024
	// MaxV2RequestBytes limits each buffered canonical message request.
	MaxV2RequestBytes = 8 * 1024 * 1024
	// DefaultMaxAssetBytes bounds one tenant asset upload at the largest supported provider file size.
	DefaultMaxAssetBytes int64 = 2_000_000_000
	// DefaultAssetRetentionSeconds keeps uploaded tenant assets for 48 hours.
	DefaultAssetRetentionSeconds = 48 * 60 * 60
	// DefaultAssetStorePath is the persistent filesystem location for tenant assets.
	DefaultAssetStorePath      = "/data/assets"
	DefaultDictationModel      = "gpt-4o-mini-transcribe"
	DefaultMaxInputAudioBytes  = 25 * 1024 * 1024
	DefaultManagementJWTIssuer = "tauth"
	// DefaultManagementUsageQueueSize is the number of managed usage events retained for asynchronous persistence.
	DefaultManagementUsageQueueSize = 1024
)
View Source
const (
	// LogLevelDebug indicates that the application should log debug information.
	LogLevelDebug = "debug"

	// LogLevelInfo indicates that the application should log informational messages.
	LogLevelInfo = "info"
)
View Source
const (
	ManagementConfigUIFileName = "config-ui.yaml"
	ManagementConfigUIPath     = "/" + ManagementConfigUIFileName
)
View Source
const (
	CatalogMediaLimitStatusBounded   = "bounded"
	CatalogMediaLimitStatusUnbounded = "unbounded"
	CatalogMediaLimitStatusUnknown   = "unknown"

	CatalogMediaTransportAny    = "any"
	CatalogMediaTransportFile   = "file"
	CatalogMediaTransportInline = "inline"

	CatalogMediaLimitUnitBytes = "bytes"
	CatalogMediaLimitUnitFiles = "files"

	CatalogMediaLimitScopeAttachment             = "attachment"
	CatalogMediaLimitScopeAttachmentEncodedBytes = "attachment_encoded_bytes"
	CatalogMediaLimitScopeRequest                = "request"
	CatalogMediaLimitScopeRequestEncodedBytes    = "request_encoded_bytes"

	CatalogMediaLimitTypeAll = "all"

	CatalogMediaLimitIDInlineRequestBytes = "inline_request_bytes"
	CatalogMediaLimitIDImageCount         = "image_count"
	CatalogMediaLimitIDAudioCount         = "audio_count"
	CatalogMediaLimitIDImageInlineBytes   = "image_inline_bytes"
	CatalogMediaLimitIDAudioInlineBytes   = "audio_inline_bytes"
	CatalogMediaLimitIDImageFileBytes     = "image_file_bytes"
	CatalogMediaLimitIDAudioFileBytes     = "audio_file_bytes"
)
View Source
const (
	// ModelNameGPT4oMini identifies the GPT-4o-mini model.
	ModelNameGPT4oMini = "gpt-4o-mini"
	// ModelNameGPT4o identifies the GPT-4o model.
	ModelNameGPT4o = "gpt-4o"
	// ModelNameGPT41 identifies the GPT-4.1 model.
	ModelNameGPT41 = "gpt-4.1"
	// ModelNameGPT5Mini identifies the GPT-5-mini model.
	ModelNameGPT5Mini = "gpt-5-mini"
	// ModelNameGPT5 identifies the GPT-5 model which does not accept the temperature field.
	ModelNameGPT5 = "gpt-5"
	// ModelNameGPT55 identifies the GPT-5.5 model which does not accept the temperature field.
	ModelNameGPT55 = "gpt-5.5"
	// ModelNameGPT55Pro identifies the GPT-5.5 pro model which does not accept the temperature field.
	ModelNameGPT55Pro = "gpt-5.5-pro"
	// ModelNameGPT56 identifies the GPT-5.6 model which does not accept the temperature field.
	ModelNameGPT56 = "gpt-5.6"
)
View Source
const (
	// ModelOperationText identifies text generation through the proxy messages contract.
	ModelOperationText = "text"
	// ModelOperationDictation identifies audio transcription through the proxy dictation contract.
	ModelOperationDictation = "dictation"
	// ModelOperationVideoGeneration identifies provider-backed video generation.
	ModelOperationVideoGeneration = "video_generation"
	// CatalogCredentialAPIKey identifies one opaque provider API key.
	CatalogCredentialAPIKey = "api_key"
	// CatalogArtifactText identifies text input or output.
	CatalogArtifactText = "text"
	// CatalogArtifactImage identifies image input or output.
	CatalogArtifactImage = "image"
	// CatalogArtifactAudio identifies audio input or output.
	CatalogArtifactAudio = "audio"
	// CatalogArtifactVideo identifies video input or output.
	CatalogArtifactVideo = "video"
	// CatalogWireContractMultipartTranscription identifies normalized multipart dictation.
	CatalogWireContractMultipartTranscription = "multipart_transcription"
)
View Source
const (
	// ModelWeightAccessProprietary identifies families whose model weights are not published for independent deployment.
	ModelWeightAccessProprietary = "proprietary"
	// ModelWeightAccessOpenWeights identifies families with published weights for independent deployment.
	ModelWeightAccessOpenWeights = "open_weights"
)
View Source
const (
	// ProviderCatalogSchemaVersion is the only accepted providers.yml schema.
	ProviderCatalogSchemaVersion = 1

	CatalogProviderFieldKindCredential = "credential"
	CatalogProviderFieldKindSetting    = "setting"
	CatalogProviderFieldTypeOpaque     = "opaque"
	CatalogProviderFieldTypeURL        = "url"

	CatalogAuthenticationBearer           = "bearer"
	CatalogAuthenticationHeader           = "header"
	CatalogEndpointMethodPost             = "POST"
	CatalogProtocolOpenAIResponses        = "openai_responses"
	CatalogProtocolOpenAIChatCompletions  = "openai_chat_completions"
	CatalogProtocolAnthropicMessages      = "anthropic_messages"
	CatalogProtocolGeminiInteractions     = "gemini_interactions"
	CatalogProtocolMultipartTranscription = "multipart_transcription"

	CatalogProtocolXAIVideosGenerations = "xai_videos_generations"
)
View Source
const (
	// ProviderNameOpenAI identifies the OpenAI provider.
	ProviderNameOpenAI = "openai"
	// ProviderNameDeepSeek identifies the DeepSeek provider.
	ProviderNameDeepSeek = "deepseek"
	// ProviderNameDashScope identifies Alibaba Cloud Model Studio DashScope-compatible routing.
	ProviderNameDashScope = "dashscope"
	// ProviderNameMoonshot identifies Moonshot/Kimi routing.
	ProviderNameMoonshot = "moonshot"
	// ProviderNameMiniMax identifies MiniMax routing.
	ProviderNameMiniMax = "minimax"
	// ProviderNameSiliconFlow identifies SiliconFlow routing.
	ProviderNameSiliconFlow = "siliconflow"
	// ProviderNameZAI identifies international Z.AI routing.
	ProviderNameZAI = "zai"
	// ProviderNameGemini identifies Google Gemini routing.
	ProviderNameGemini = "gemini"
	// ProviderNameAnthropic identifies Anthropic Claude routing.
	ProviderNameAnthropic = "anthropic"
	// ProviderNameMeta identifies Meta Model API routing.
	ProviderNameMeta = "meta"
	// ProviderNameXAI identifies the xAI credential and routing boundary.
	ProviderNameXAI = "xai"
)
View Source
const (
	// ModelNameDeepSeekV4Flash identifies the low-cost DeepSeek V4 flash model.
	ModelNameDeepSeekV4Flash = "deepseek-v4-flash"
	// ModelNameDeepSeekV4Pro identifies the higher-capability DeepSeek V4 pro model.
	ModelNameDeepSeekV4Pro = "deepseek-v4-pro"
	// ModelNameDeepSeekChat identifies the legacy DeepSeek chat model name.
	ModelNameDeepSeekChat = "deepseek-chat"
	// ModelNameDeepSeekReasoner identifies the legacy DeepSeek reasoner model name.
	ModelNameDeepSeekReasoner = "deepseek-reasoner"
	// ModelNameDashScopeQwenPlus identifies DashScope Qwen Plus.
	ModelNameDashScopeQwenPlus = "qwen-plus"
	// ModelNameDashScopeQwen37Max identifies DashScope Qwen 3.7 Max.
	ModelNameDashScopeQwen37Max = "qwen3.7-max"
	// ModelNameDashScopeQwen37Plus identifies DashScope Qwen 3.7 Plus.
	ModelNameDashScopeQwen37Plus = "qwen3.7-plus"
	// ModelNameDashScopeQwen36Flash identifies DashScope Qwen 3.6 Flash.
	ModelNameDashScopeQwen36Flash = "qwen3.6-flash"
	// ModelNameMoonshotKimiK26 identifies Moonshot Kimi K2.6.
	ModelNameMoonshotKimiK26 = "kimi-k2.6"
	// ModelNameMoonshotKimiK3 identifies Moonshot Kimi K3.
	ModelNameMoonshotKimiK3 = "kimi-k3"
	// ModelNameMoonshotKimiK27Code identifies Moonshot Kimi K2.7 Code.
	ModelNameMoonshotKimiK27Code = "kimi-k2.7-code"
	// ModelNameMoonshotKimiK27CodeHighSpeed identifies Moonshot Kimi K2.7 Code Highspeed.
	ModelNameMoonshotKimiK27CodeHighSpeed = "kimi-k2.7-code-highspeed"
	// ModelNameMiniMaxM27 identifies MiniMax M2.7.
	ModelNameMiniMaxM27 = "minimax-m2.7"
	// ModelNameMiniMaxM27HighSpeed identifies MiniMax M2.7 Highspeed.
	ModelNameMiniMaxM27HighSpeed = "minimax-m2.7-highspeed"
	// ModelNameMiniMaxM25 identifies MiniMax M2.5.
	ModelNameMiniMaxM25 = "minimax-m2.5"
	// ModelNameMiniMaxM25HighSpeed identifies MiniMax M2.5 Highspeed.
	ModelNameMiniMaxM25HighSpeed = "minimax-m2.5-highspeed"
	// ModelNameMiniMaxM21 identifies MiniMax M2.1.
	ModelNameMiniMaxM21 = "minimax-m2.1"
	// ModelNameMiniMaxM21HighSpeed identifies MiniMax M2.1 Highspeed.
	ModelNameMiniMaxM21HighSpeed = "minimax-m2.1-highspeed"
	// ModelNameMiniMaxM2 identifies MiniMax M2.
	ModelNameMiniMaxM2 = "minimax-m2"
	// ModelNameSiliconFlowDeepSeek identifies SiliconFlow-hosted DeepSeek R1.
	ModelNameSiliconFlowDeepSeek = ModelNameDeepSeekReasoner
	// ModelNameZAIGLM identifies the GLM 5.1 model.
	ModelNameZAIGLM = "glm-5.1"
	// ModelNameGemini35Flash identifies Gemini 3.5 Flash.
	ModelNameGemini35Flash = "gemini-3.5-flash"
	// ModelNameClaudeOpus48 identifies Claude Opus 4.8.
	ModelNameClaudeOpus48 = "claude-opus-4-8"
	// ModelNameClaudeSonnet46 identifies Claude Sonnet 4.6.
	ModelNameClaudeSonnet46 = "claude-sonnet-4-6"
	// ModelNameClaudeHaiku45 identifies Claude Haiku 4.5.
	ModelNameClaudeHaiku45 = "claude-haiku-4-5-20251001"
	// ModelNameClaudeHaiku45Alias identifies the Claude Haiku 4.5 convenience alias.
	ModelNameClaudeHaiku45Alias = "claude-haiku-4-5"
	// ModelNameClaudeSonnet45 identifies Claude Sonnet 4.5.
	ModelNameClaudeSonnet45 = "claude-sonnet-4-5-20250929"
	// ModelNameClaudeSonnet45Alias identifies the Claude Sonnet 4.5 convenience alias.
	ModelNameClaudeSonnet45Alias = "claude-sonnet-4-5"
	// ModelNameClaudeOpus41 identifies Claude Opus 4.1.
	ModelNameClaudeOpus41 = "claude-opus-4-1-20250805"
	// ModelNameClaudeOpus41Alias identifies the Claude Opus 4.1 convenience alias.
	ModelNameClaudeOpus41Alias = "claude-opus-4-1"
	// ModelNameMuseSpark11 identifies Meta Muse Spark 1.1.
	ModelNameMuseSpark11 = "muse-spark-1.1"
	// ModelNameMuseSpark12 identifies Meta Muse Spark 1.2.
	ModelNameMuseSpark12 = "muse-spark-1.2"
	// ModelNameGrok43 identifies the current Grok 4.3 model.
	ModelNameGrok43 = "grok-4.3"
	// ModelNameGrok43Latest identifies the Grok 4.3 latest alias.
	ModelNameGrok43Latest = "grok-4.3-latest"
	// ModelNameGrok45 identifies the Grok 4.5 model.
	ModelNameGrok45 = "grok-4.5"
	// ModelNameGrokLatest identifies the current Grok latest alias.
	ModelNameGrokLatest = "grok-latest"
	// ModelNameGrokBuild01 identifies the Grok Build coding model.
	ModelNameGrokBuild01 = "grok-build-0.1"
	// ModelNameGrokCodeFast identifies the Grok code fast alias.
	ModelNameGrokCodeFast = "grok-code-fast"
	// ModelNameGrokCodeFast1 identifies the Grok code fast 1 alias.
	ModelNameGrokCodeFast1 = "grok-code-fast-1"
	// ModelNameGrokCodeFast10825 identifies the dated Grok code fast 1 model.
	ModelNameGrokCodeFast10825 = "grok-code-fast-1-0825"
)
View Source
const (
	PublicModelCapabilityText       = "text"
	PublicModelCapabilityDictation  = "dictation"
	PublicModelCapabilityWebSearch  = "web_search"
	PublicModelCapabilityImageInput = "image_input"
	PublicModelCapabilityAudioInput = "audio_input"
	PublicModelCapabilityReasoning  = "reasoning"
	PublicModelCapabilityVideo      = "video_generation"
)

Public model capability identifiers are the stable filter vocabulary for the generated public catalog.

View Source
const PublicCapabilitiesPath = "/api/public/capabilities"

PublicCapabilitiesPath is the canonical unauthenticated capability catalog resource consumed by public frontend builds and external API clients.

Variables

View Source
var (
	// SchemaGPT4oMini defines allowed payload fields for the GPT-4o-mini model.
	SchemaGPT4oMini = ModelPayloadSchema{AllowedRequestFields: []string{keyModel, keyInput, keyMaxOutputTokens, keyBackground, keyStore, keyTemperature}}
	// SchemaGPT4o defines allowed payload fields for the GPT-4o model.
	SchemaGPT4o = ModelPayloadSchema{AllowedRequestFields: []string{keyModel, keyInput, keyMaxOutputTokens, keyBackground, keyStore, keyTemperature, keyTools, keyToolChoice}}
	// SchemaGPT41 defines allowed payload fields for the GPT-4.1 model.
	SchemaGPT41 = ModelPayloadSchema{AllowedRequestFields: []string{keyModel, keyInput, keyMaxOutputTokens, keyBackground, keyStore, keyTemperature, keyTools, keyToolChoice}}
	// SchemaGPT5 defines allowed payload fields for the GPT-5 model.
	SchemaGPT5 = ModelPayloadSchema{AllowedRequestFields: []string{keyModel, keyInput, keyMaxOutputTokens, keyBackground, keyStore, keyTools, keyToolChoice, keyReasoning}}
	// SchemaGPT55 defines allowed payload fields for GPT-5.5 family models.
	SchemaGPT55 = SchemaGPT5
)
View Source
var (
	// ErrUnknownProvider is returned when a request names a provider that is not registered.
	ErrUnknownProvider = errors.New(errorUnknownProvider)
	// ErrProviderNotConfigured is returned when a registered provider lacks a required server-side credential.
	ErrProviderNotConfigured = errors.New(errorProviderNotConfigured)
	// ErrUnsupportedCapability is returned when a request asks a provider for an unsupported capability.
	ErrUnsupportedCapability = errors.New(errorUnsupportedCapability)
	// ErrUnsupportedEndpoint is returned when a provider does not support the requested endpoint.
	ErrUnsupportedEndpoint = errors.New(errorUnsupportedEndpoint)
	// ErrConflictingModelParameters is returned when query and JSON body model values disagree.
	ErrConflictingModelParameters = errors.New(errorConflictingModelParameters)
	// ErrProviderRateLimited is returned when an upstream provider reports rate limiting.
	ErrProviderRateLimited = errors.New(errorProviderRateLimited)
	// ErrProviderAPI is returned when an upstream provider returns an unsuccessful response.
	ErrProviderAPI = errors.New(errorProviderAPI)
	// ErrProviderMediaLimit is returned when media exceeds the selected provider offering limit.
	ErrProviderMediaLimit = errors.New("provider media limit exceeded")
	// ErrInvalidChatMessages is returned when a JSON request body contains invalid chat messages.
	ErrInvalidChatMessages = errors.New(errorInvalidChatMessages)
	// ErrInvalidModelCatalog is returned when configured provider model catalogs are incomplete or inconsistent.
	ErrInvalidModelCatalog = errors.New("invalid_model_catalog")
)
View Source
var (
	ErrInvalidManagementConfiguration = errors.New("invalid management configuration")
)
View Source
var ErrInvalidUpstreamRateLimitConfiguration = errors.New("invalid_upstream_rate_limit_configuration")

ErrInvalidUpstreamRateLimitConfiguration identifies an invalid shared upstream rate-limit rule.

View Source
var ErrUnknownModel = errors.New(errorUnknownModel)

ErrUnknownModel is returned when a model identifier is not recognized.

Functions

func BuildPublicCapabilityRouter added in v0.3.0

func BuildPublicCapabilityRouter(capabilityCatalog PublicCapabilityCatalog, logLevel string) *gin.Engine

BuildPublicCapabilityRouter constructs the minimal public REST surface used when frontend tooling needs capability data without private runtime config.

func BuildRequestPayload

func BuildRequestPayload(modelIdentifier string, rawRequestProfile string, combinedPrompt any, webSearchEnabled bool, maxTokens *int, reasoningEffort string) any

BuildRequestPayload selects the correct OpenAI Responses payload shape for the configured request profile.

func BuildRouter

func BuildRouter(configuration Configuration, structuredLogger *zap.SugaredLogger) (*gin.Engine, error)

BuildRouter constructs the HTTP router used by the proxy. configuration supplies management, routing, queue, worker, and timeout settings. structuredLogger records structured log messages during routing.

func RenderManagementConfigUI added in v0.2.19

func RenderManagementConfigUI(configuration ManagementConfiguration) string

RenderManagementConfigUI renders the browser-facing llm-proxy, MPR UI, and TAuth YAML config.

func Serve

func Serve(configuration Configuration, structuredLogger *zap.SugaredLogger) error

Serve builds the router from the supplied configuration and structuredLogger and starts the HTTP server on the configured port.

func ServePublicCapabilities added in v0.3.0

func ServePublicCapabilities(capabilityCatalog PublicCapabilityCatalog, port int, logLevel string) error

ServePublicCapabilities starts the minimal public REST surface on port.

Types

type CatalogControl added in v1.0.0

type CatalogControl struct {
	ID               string   `json:"id" mapstructure:"id" yaml:"id"`
	Kind             string   `json:"kind" mapstructure:"kind" yaml:"kind"`
	Values           []string `json:"values" mapstructure:"values" yaml:"values,omitempty"`
	Minimum          *int     `json:"minimum" mapstructure:"minimum" yaml:"minimum,omitempty"`
	Maximum          *int     `json:"maximum" mapstructure:"maximum" yaml:"maximum,omitempty"`
	AccountDependent bool     `json:"account_dependent" mapstructure:"account_dependent" yaml:"account_dependent,omitempty"`
}

CatalogControl declares one route-specific request control.

type CatalogLimit added in v1.0.0

type CatalogLimit struct {
	ID               string `json:"id" mapstructure:"id" yaml:"id"`
	Value            *int   `json:"value" mapstructure:"value" yaml:"value,omitempty"`
	Unit             string `json:"unit" mapstructure:"unit" yaml:"unit"`
	AccountDependent bool   `json:"account_dependent" mapstructure:"account_dependent" yaml:"account_dependent,omitempty"`
}

CatalogLimit declares one fixed or account-dependent route limit.

type CatalogMediaLimit added in v1.0.0

type CatalogMediaLimit struct {
	ID           string `json:"id" mapstructure:"id" yaml:"id"`
	MediaType    string `json:"media_type" mapstructure:"media_type" yaml:"media_type"`
	Transport    string `json:"transport" mapstructure:"transport" yaml:"transport"`
	Status       string `json:"status" mapstructure:"status" yaml:"status"`
	Value        *int64 `json:"value" mapstructure:"value" yaml:"value,omitempty"`
	Unit         string `json:"unit" mapstructure:"unit" yaml:"unit"`
	Scope        string `json:"scope" mapstructure:"scope" yaml:"scope"`
	Source       string `json:"source" mapstructure:"source" yaml:"source"`
	LastVerified string `json:"last_verified" mapstructure:"last_verified" yaml:"last_verified"`
}

CatalogMediaLimit declares one provider-offering media admission rule.

type CatalogMinimumCharge added in v1.0.0

type CatalogMinimumCharge struct {
	Currency string  `json:"currency" mapstructure:"currency" yaml:"currency"`
	Amount   float64 `json:"amount" mapstructure:"amount" yaml:"amount"`
	Unit     string  `json:"unit" mapstructure:"unit" yaml:"unit"`
}

CatalogMinimumCharge declares one published request minimum.

type CatalogPriceConditions added in v1.0.0

type CatalogPriceConditions struct {
	Resolution     string `json:"resolution" mapstructure:"resolution" yaml:"resolution,omitempty"`
	GeneratedAudio string `json:"generated_audio" mapstructure:"generated_audio" yaml:"generated_audio,omitempty"`
	InputMedia     string `json:"input_media" mapstructure:"input_media" yaml:"input_media,omitempty"`
	OutputMedia    string `json:"output_media" mapstructure:"output_media" yaml:"output_media,omitempty"`
	Duration       string `json:"duration" mapstructure:"duration" yaml:"duration,omitempty"`
	Quantity       string `json:"quantity" mapstructure:"quantity" yaml:"quantity,omitempty"`
	Quality        string `json:"quality" mapstructure:"quality" yaml:"quality,omitempty"`
	Mode           string `json:"mode" mapstructure:"mode" yaml:"mode,omitempty"`
	APIVersion     string `json:"api_version" mapstructure:"api_version" yaml:"api_version,omitempty"`
	AvatarType     string `json:"avatar_type" mapstructure:"avatar_type" yaml:"avatar_type,omitempty"`
	BillingMode    string `json:"billing_mode" mapstructure:"billing_mode" yaml:"billing_mode,omitempty"`
	BillingOutcome string `json:"billing_outcome" mapstructure:"billing_outcome" yaml:"billing_outcome,omitempty"`
}

CatalogPriceConditions identifies one exact published billing condition set.

type CatalogPriceDescriptor added in v1.0.0

type CatalogPriceDescriptor struct {
	Provider          string                `json:"provider" mapstructure:"provider"`
	Model             string                `json:"model" mapstructure:"model"`
	Operation         string                `json:"operation" mapstructure:"operation"`
	Available         bool                  `json:"available" mapstructure:"available"`
	Rates             []CatalogPriceRate    `json:"rates" mapstructure:"rates"`
	MinimumCharge     *CatalogMinimumCharge `json:"minimum_charge" mapstructure:"minimum_charge"`
	Source            string                `json:"source" mapstructure:"source"`
	LastVerified      string                `json:"last_verified" mapstructure:"last_verified"`
	UnavailableReason string                `json:"unavailable_reason" mapstructure:"unavailable_reason"`
}

CatalogPriceDescriptor owns pricing for one provider, model, and operation.

type CatalogPriceRate added in v1.0.0

type CatalogPriceRate struct {
	Component  string                 `json:"component" mapstructure:"component" yaml:"component"`
	Currency   string                 `json:"currency" mapstructure:"currency" yaml:"currency"`
	Rate       float64                `json:"rate" mapstructure:"rate" yaml:"rate"`
	Unit       string                 `json:"unit" mapstructure:"unit" yaml:"unit"`
	Conditions CatalogPriceConditions `json:"conditions" mapstructure:"conditions" yaml:"conditions"`
}

CatalogPriceRate is one exact published billing component.

type CatalogPriceSelection added in v1.0.0

type CatalogPriceSelection struct {
	Available         bool
	Rate              *CatalogPriceRate
	MinimumCharge     *CatalogMinimumCharge
	Source            string
	LastVerified      string
	UnavailableReason string
}

CatalogPriceSelection is an exact price result. Unavailable selections carry a stable reason and never guess a rate.

type CatalogProvider added in v1.0.0

type CatalogProvider struct {
	ID              string   `mapstructure:"id"`
	Label           string   `mapstructure:"label"`
	CredentialKinds []string `mapstructure:"credential_kinds"`
}

CatalogProvider declares one provider that can own provider offerings.

type CatalogService added in v1.0.0

type CatalogService struct {
	// contains filtered or unexported fields
}

CatalogService is the validated model-operation capability and price snapshot used by routing, public discovery, management, and later planning.

func NewCatalogService added in v1.0.0

func NewCatalogService(catalog ModelCatalog) (CatalogService, error)

NewCatalogService validates one complete catalog snapshot.

func (CatalogService) ResolveOffering added in v1.0.0

func (service CatalogService) ResolveOffering(provider string, model string) (ProviderOffering, error)

ResolveOffering resolves one canonical provider and model pair.

func (CatalogService) Revision added in v1.0.0

func (service CatalogService) Revision() string

Revision returns the exact catalog snapshot identifier.

func (CatalogService) SelectPrice added in v1.0.0

func (service CatalogService) SelectPrice(provider string, model string, operation string, component string, conditions CatalogPriceConditions) CatalogPriceSelection

SelectPrice returns the exact component and condition match. Missing or incomplete selections return a typed unavailable result.

type Configuration

type Configuration struct {
	Management               ManagementConfiguration
	Port                     int
	LogLevel                 string
	WorkerCount              int
	QueueSize                int
	RequestTimeoutSeconds    int
	MaxRequestTimeoutSeconds int
	MaxPromptBytes           int64
	MaxAssetBytes            int64
	AssetRetentionSeconds    int
	AssetStorePath           string
	MaxInputAudioBytes       int64
	UpstreamRateLimits       []UpstreamRateLimitConfiguration
	Endpoints                *Endpoints
	ProviderCatalog          *ProviderCatalog
	ProviderConnectionValues map[string]map[string]string
	ModelCatalog             ModelCatalog
	// contains filtered or unexported fields
}

Configuration holds runtime settings.

func NewConfiguration

func NewConfiguration(configuration Configuration) (Configuration, error)

NewConfiguration returns a normalized runtime configuration after validating startup invariants.

func (*Configuration) ApplyTunables

func (configuration *Configuration) ApplyTunables()

ApplyTunables ensures tunable configuration values have sensible defaults.

type Endpoints

type Endpoints struct {
	// contains filtered or unexported fields
}

Endpoints provides concurrency-safe access to OpenAI endpoint URLs.

func NewEndpoints

func NewEndpoints() *Endpoints

NewEndpoints creates an Endpoints instance initialized with default URLs.

func NewEndpointsForURLs added in v0.2.17

func NewEndpointsForURLs(rawBaseURL string, rawTranscriptionsURL string) *Endpoints

NewEndpointsForURLs creates an Endpoints instance from configured OpenAI URLs.

func (*Endpoints) GetModelsURL

func (endpointConfiguration *Endpoints) GetModelsURL() string

GetModelsURL returns the URL used for the OpenAI models endpoint.

func (*Endpoints) GetResponsesURL

func (endpointConfiguration *Endpoints) GetResponsesURL() string

GetResponsesURL returns the URL used for the OpenAI responses endpoint.

func (*Endpoints) GetTranscriptionsURL

func (endpointConfiguration *Endpoints) GetTranscriptionsURL() string

GetTranscriptionsURL returns the URL used for the OpenAI audio transcriptions endpoint.

func (*Endpoints) ResetModelsURL

func (endpointConfiguration *Endpoints) ResetModelsURL()

ResetModelsURL resets the models endpoint to the default.

func (*Endpoints) ResetResponsesURL

func (endpointConfiguration *Endpoints) ResetResponsesURL()

ResetResponsesURL resets the responses endpoint to the default.

func (*Endpoints) ResetTranscriptionsURL

func (endpointConfiguration *Endpoints) ResetTranscriptionsURL()

ResetTranscriptionsURL resets the transcriptions endpoint to the default.

func (*Endpoints) SetModelsURL

func (endpointConfiguration *Endpoints) SetModelsURL(newURL string)

SetModelsURL sets the URL for the OpenAI models endpoint.

func (*Endpoints) SetProviderBaseURL added in v1.2.0

func (endpointConfiguration *Endpoints) SetProviderBaseURL(provider string, rawBaseURL string)

SetProviderBaseURL replaces the catalog base URL for every transport of one provider. It is intended for black-box tests that route catalog adapters to a fake upstream.

func (*Endpoints) SetProviderTransportBaseURL added in v1.2.0

func (endpointConfiguration *Endpoints) SetProviderTransportBaseURL(provider string, transport string, rawBaseURL string)

SetProviderTransportBaseURL replaces the catalog base URL for one provider transport. It is intended for black-box tests that route a catalog adapter to a fake upstream.

func (*Endpoints) SetProviderTransportURL added in v1.2.0

func (endpointConfiguration *Endpoints) SetProviderTransportURL(provider string, transport string, rawURL string)

SetProviderTransportURL replaces the complete catalog URL for one provider transport. It is intended for black-box tests that route a catalog adapter to a fake upstream.

func (*Endpoints) SetResponsesURL

func (endpointConfiguration *Endpoints) SetResponsesURL(newURL string)

SetResponsesURL sets the URL for the OpenAI responses endpoint.

func (*Endpoints) SetTranscriptionsURL

func (endpointConfiguration *Endpoints) SetTranscriptionsURL(newURL string)

SetTranscriptionsURL sets the URL for the OpenAI audio transcriptions endpoint.

type ExactModel added in v1.0.0

type ExactModel struct {
	ID          string   `mapstructure:"id" yaml:"id"`
	Publisher   string   `mapstructure:"publisher" yaml:"publisher"`
	Family      string   `mapstructure:"family" yaml:"family"`
	Version     string   `mapstructure:"version" yaml:"version"`
	Operations  []string `mapstructure:"operations" yaml:"operations"`
	MediaInputs []string `mapstructure:"media_inputs" yaml:"media_inputs"`
}

ExactModel declares provider-independent identity and model capabilities.

type HTTPDoer

type HTTPDoer interface {
	Do(httpRequest *http.Request) (*http.Response, error)
}

HTTPDoer executes HTTP requests, allowing the proxy to abstract the underlying HTTP client.

var (
	// HTTPClient is the default HTTPDoer implementation that delegates to http.DefaultClient.
	HTTPClient HTTPDoer = http.DefaultClient
)

type ManagementConfiguration added in v0.2.19

type ManagementConfiguration struct {
	PublicOrigin             string
	UIDescription            string
	UIOrigins                []string
	AdminEmails              []string
	TAuthURL                 string
	TAuthTenantID            string
	GoogleClientID           string
	LoginPath                string
	LogoutPath               string
	NoncePath                string
	SessionPath              string
	JWTSigningKey            string
	JWTIssuer                string
	SessionCookieName        string
	DatabasePath             string
	UsageQueueSize           int
	ProviderKeyEncryptionKey string
	ManagementAPIOrigin      string
	ProxyOrigin              string
	DatabaseDialector        gorm.Dialector
}

ManagementConfiguration holds authenticated browser UI and self-service tenant settings.

func (*ManagementConfiguration) ApplyTunables added in v0.2.19

func (configuration *ManagementConfiguration) ApplyTunables()

ApplyTunables normalizes optional management settings.

type ModelCatalog added in v1.0.0

type ModelCatalog struct {
	Revision   string                   `mapstructure:"revision"`
	Operations []ModelOperationKind     `mapstructure:"operations"`
	Providers  []CatalogProvider        `mapstructure:"providers"`
	Publishers []ModelPublisher         `mapstructure:"publishers"`
	Families   []ModelFamily            `mapstructure:"families"`
	Models     []ExactModel             `mapstructure:"models"`
	Offerings  []ProviderOffering       `mapstructure:"offerings"`
	Prices     []CatalogPriceDescriptor `mapstructure:"prices"`
}

ModelCatalog is the canonical normalized model and provider-offering registry.

type ModelFamily added in v1.0.0

type ModelFamily struct {
	ID           string `mapstructure:"id" yaml:"id"`
	Publisher    string `mapstructure:"publisher" yaml:"publisher"`
	Label        string `mapstructure:"label" yaml:"label"`
	WeightAccess string `mapstructure:"weight_access" yaml:"weight_access"`
}

ModelFamily groups exact models from one publisher.

type ModelOperationKind added in v1.0.0

type ModelOperationKind struct {
	ID              string   `json:"id" mapstructure:"id" yaml:"id"`
	InputArtifacts  []string `json:"input_artifacts" mapstructure:"input_artifacts" yaml:"input_artifacts"`
	OutputArtifacts []string `json:"output_artifacts" mapstructure:"output_artifacts" yaml:"output_artifacts"`
}

ModelOperationKind declares one operation and its possible artifact types.

type ModelPayloadSchema

type ModelPayloadSchema struct {
	// AllowedRequestFields enumerates JSON fields permitted in the request payload.
	AllowedRequestFields []string
}

ModelPayloadSchema lists request fields allowed by a model.

func ResolveModelPayloadSchema

func ResolveModelPayloadSchema(requestProfile string) ModelPayloadSchema

ResolveModelPayloadSchema returns the schema for a request profile or an empty schema when unknown.

type ModelPublisher added in v1.0.0

type ModelPublisher struct {
	ID    string `mapstructure:"id" yaml:"id"`
	Label string `mapstructure:"label" yaml:"label"`
}

ModelPublisher declares the organization or community that publishes models.

type OpenAIClient

type OpenAIClient struct {
	// contains filtered or unexported fields
}

OpenAIClient provides access to the OpenAI responses API with configurable endpoints and tunable parameters.

func NewOpenAIClient

func NewOpenAIClient(httpClient HTTPDoer, endpoints *Endpoints) *OpenAIClient

NewOpenAIClient constructs an OpenAIClient initialized with the supplied components.

type ProviderCatalog added in v1.2.0

type ProviderCatalog struct {
	// contains filtered or unexported fields
}

ProviderCatalog is one validated immutable catalog snapshot.

func NewProviderCatalog added in v1.2.0

func NewProviderCatalog(schema ProviderCatalogSchema) (*ProviderCatalog, error)

NewProviderCatalog validates an in-memory provider catalog schema.

func ParseProviderCatalog added in v1.2.0

func ParseProviderCatalog(document []byte) (*ProviderCatalog, error)

ParseProviderCatalog decodes and validates one strict providers.yml document.

func (*ProviderCatalog) ModelCatalog added in v1.2.0

func (catalog *ProviderCatalog) ModelCatalog() ModelCatalog

ModelCatalog returns a detached normalized runtime projection.

func (*ProviderCatalog) ResolveEnvironmentBindings added in v1.2.0

func (catalog *ProviderCatalog) ResolveEnvironmentBindings(environment map[string]string) (map[string]map[string]string, error)

ResolveEnvironmentBindings returns validated runtime connection values for configured catalog bindings.

func (*ProviderCatalog) Schema added in v1.2.0

func (catalog *ProviderCatalog) Schema() ProviderCatalogSchema

Schema returns a detached copy of the private catalog schema.

func (*ProviderCatalog) SchemaVersion added in v1.2.0

func (catalog *ProviderCatalog) SchemaVersion() int

SchemaVersion returns the exact persisted schema version.

type ProviderCatalogAuthentication added in v1.2.0

type ProviderCatalogAuthentication struct {
	Kind   string `yaml:"kind"`
	Field  string `yaml:"field"`
	Header string `yaml:"header"`
	Prefix string `yaml:"prefix"`
}

ProviderCatalogAuthentication defines how a connection credential is sent.

type ProviderCatalogEndpoint added in v1.2.0

type ProviderCatalogEndpoint struct {
	Method         string `yaml:"method"`
	DefaultBaseURL string `yaml:"default_base_url,omitempty"`
	SettingField   string `yaml:"setting_field,omitempty"`
	Path           string `yaml:"path"`
}

ProviderCatalogEndpoint defines a transport collection URL.

type ProviderCatalogField added in v1.2.0

type ProviderCatalogField struct {
	ID          string                         `yaml:"id"`
	Label       string                         `yaml:"label"`
	Kind        string                         `yaml:"kind"`
	Type        string                         `yaml:"type"`
	Required    bool                           `yaml:"required"`
	Default     *string                        `yaml:"default"`
	Secret      bool                           `yaml:"secret"`
	Validation  ProviderCatalogFieldValidation `yaml:"validation"`
	Environment string                         `yaml:"environment"`
}

ProviderCatalogField defines one tenant connection input.

type ProviderCatalogFieldValidation added in v1.2.0

type ProviderCatalogFieldValidation struct {
	MinimumLength  int      `yaml:"minimum_length,omitempty"`
	Pattern        string   `yaml:"pattern,omitempty"`
	AllowedSchemes []string `yaml:"allowed_schemes,omitempty"`
}

ProviderCatalogFieldValidation selects one reusable edge validator.

type ProviderCatalogFinishRules added in v1.2.0

type ProviderCatalogFinishRules struct {
	Complete []string `yaml:"complete"`
	Continue []string `yaml:"continue"`
}

ProviderCatalogFinishRules declares exact complete and incomplete signals.

type ProviderCatalogHeader added in v1.2.0

type ProviderCatalogHeader struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

ProviderCatalogHeader defines one nonsecret static transport header.

type ProviderCatalogModelMigration added in v1.2.0

type ProviderCatalogModelMigration struct {
	ManagedSchemaVersion int    `yaml:"managed_schema_version"`
	Provider             string `yaml:"provider"`
	Operation            string `yaml:"operation"`
	SourceModel          string `yaml:"source_model"`
	TargetModel          string `yaml:"target_model"`
}

ProviderCatalogModelMigration maps one persisted model identifier to the current catalog contract.

type ProviderCatalogOffering added in v1.2.0

type ProviderCatalogOffering struct {
	Model             string                     `yaml:"model"`
	UpstreamModel     string                     `yaml:"upstream_model"`
	Transport         string                     `yaml:"transport"`
	Operations        []string                   `yaml:"operations"`
	DefaultOperations []string                   `yaml:"default_operations,omitempty"`
	RequestProfile    string                     `yaml:"request_profile,omitempty"`
	WebSearch         bool                       `yaml:"web_search,omitempty"`
	OutputTokenLimit  int                        `yaml:"output_token_limit,omitempty"`
	ReasoningEffort   *ReasoningEffortCapability `yaml:"reasoning_effort,omitempty"`
	MediaInputs       []string                   `yaml:"media_inputs,omitempty"`
	MediaLimits       []CatalogMediaLimit        `yaml:"media_limits,omitempty"`
	Controls          []CatalogControl           `yaml:"controls,omitempty"`
	Limits            []CatalogLimit             `yaml:"limits,omitempty"`
	Prices            []ProviderCatalogPrice     `yaml:"prices"`
}

ProviderCatalogOffering defines one exact model route inside its provider.

type ProviderCatalogPrice added in v1.2.0

type ProviderCatalogPrice struct {
	Operation         string                `yaml:"operation"`
	Available         bool                  `yaml:"available"`
	Rates             []CatalogPriceRate    `yaml:"rates,omitempty"`
	MinimumCharge     *CatalogMinimumCharge `yaml:"minimum_charge,omitempty"`
	Source            string                `yaml:"source"`
	LastVerified      string                `yaml:"last_verified"`
	UnavailableReason string                `yaml:"unavailable_reason,omitempty"`
}

ProviderCatalogPrice defines one operation price inside its provider offering.

type ProviderCatalogProtocolParameters added in v1.2.0

type ProviderCatalogProtocolParameters struct {
	ModelField        string                     `yaml:"model_field"`
	TokenField        string                     `yaml:"token_field"`
	OutputFields      []string                   `yaml:"output_fields"`
	FinishRules       ProviderCatalogFinishRules `yaml:"finish_rules"`
	ContinuationRules []string                   `yaml:"continuation_rules"`
	ErrorRules        []string                   `yaml:"error_rules"`
	UsageFields       ProviderCatalogUsageFields `yaml:"usage_fields"`
}

ProviderCatalogProtocolParameters declares the adapter-owned wire fields and outcomes.

type ProviderCatalogProvider added in v1.2.0

type ProviderCatalogProvider struct {
	ID         string                     `yaml:"id"`
	Label      string                     `yaml:"label"`
	Aliases    []string                   `yaml:"aliases,omitempty"`
	Fields     []ProviderCatalogField     `yaml:"fields"`
	Transports []ProviderCatalogTransport `yaml:"transports"`
	Offerings  []ProviderCatalogOffering  `yaml:"offerings"`
}

ProviderCatalogProvider defines one provider and all provider-owned routes.

type ProviderCatalogResourceVisibility added in v1.2.0

type ProviderCatalogResourceVisibility struct {
	RetryIntervalMilliseconds int   `yaml:"retry_interval_milliseconds"`
	RetryLimit                int   `yaml:"retry_limit"`
	RetryStatusCodes          []int `yaml:"retry_status_codes"`
}

ProviderCatalogResourceVisibility defines bounded retries for a created resource that is not readable yet.

type ProviderCatalogSchema added in v1.2.0

type ProviderCatalogSchema struct {
	SchemaVersion   int                             `yaml:"schema_version"`
	ModelMigrations []ProviderCatalogModelMigration `yaml:"model_migrations,omitempty"`
	Operations      []ModelOperationKind            `yaml:"operations"`
	Publishers      []ModelPublisher                `yaml:"publishers"`
	Families        []ModelFamily                   `yaml:"families"`
	Models          []ExactModel                    `yaml:"models"`
	Providers       []ProviderCatalogProvider       `yaml:"providers"`
}

ProviderCatalogSchema is the strict persisted shape of configs/providers.yml.

type ProviderCatalogTransport added in v1.2.0

type ProviderCatalogTransport struct {
	ID                 string                            `yaml:"id"`
	Endpoint           ProviderCatalogEndpoint           `yaml:"endpoint"`
	Authentication     ProviderCatalogAuthentication     `yaml:"authentication"`
	Headers            []ProviderCatalogHeader           `yaml:"headers,omitempty"`
	RequestProtocol    string                            `yaml:"request_protocol"`
	ResponseProtocol   string                            `yaml:"response_protocol"`
	UsageMapping       string                            `yaml:"usage_mapping"`
	Lifecycle          string                            `yaml:"lifecycle"`
	ResourceVisibility ProviderCatalogResourceVisibility `yaml:"resource_visibility,omitempty"`
	ProtocolParameters ProviderCatalogProtocolParameters `yaml:"protocol_parameters"`
}

ProviderCatalogTransport defines one reusable provider protocol route.

type ProviderCatalogUsageFields added in v1.2.0

type ProviderCatalogUsageFields struct {
	Input  string `yaml:"input"`
	Output string `yaml:"output"`
	Total  string `yaml:"total"`
}

ProviderCatalogUsageFields maps provider usage values to canonical token counts.

type ProviderOffering added in v1.0.0

type ProviderOffering struct {
	Provider           string                     `mapstructure:"provider"`
	Model              string                     `mapstructure:"model"`
	ProviderModel      string                     `mapstructure:"provider_model"`
	Transport          string                     `mapstructure:"transport"`
	Operations         []string                   `mapstructure:"operations"`
	DefaultOperations  []string                   `mapstructure:"default_operations"`
	WireContract       string                     `mapstructure:"wire_contract"`
	ExecutionLifecycle string                     `mapstructure:"execution_lifecycle"`
	RequestProfile     string                     `mapstructure:"request_profile"`
	WebSearch          bool                       `mapstructure:"web_search"`
	OutputTokenLimit   int                        `mapstructure:"output_token_limit"`
	ReasoningEffort    *ReasoningEffortCapability `mapstructure:"reasoning_effort"`
	MediaInputs        []string                   `mapstructure:"media_inputs"`
	MediaLimits        []CatalogMediaLimit        `mapstructure:"media_limits"`
	Controls           []CatalogControl           `mapstructure:"controls"`
	Limits             []CatalogLimit             `mapstructure:"limits"`
}

ProviderOffering declares one provider route for one exact model.

type PublicCapabilityCatalog added in v0.2.59

type PublicCapabilityCatalog struct {
	Revision                 string                       `json:"revision"`
	Operations               []ModelOperationKind         `json:"operations"`
	Providers                []PublicProviderCapability   `json:"providers"`
	Publishers               []PublicModelPublisher       `json:"publishers"`
	Families                 []PublicModelFamily          `json:"families"`
	Models                   []PublicExactModelCapability `json:"models"`
	Offerings                []PublicProviderOffering     `json:"offerings"`
	Prices                   []CatalogPriceDescriptor     `json:"prices"`
	Counts                   PublicCapabilityCounts       `json:"counts"`
	MaxPromptBytes           int64                        `json:"max_prompt_bytes"`
	MaxInputAudioBytes       int64                        `json:"max_input_audio_bytes"`
	MaxRequestTimeoutSeconds int                          `json:"max_request_timeout_seconds"`
}

PublicCapabilityCatalog is the normalized tenant-safe model discovery contract.

func NewPublicCapabilityCatalog added in v0.2.59

func NewPublicCapabilityCatalog(configuration Configuration) (PublicCapabilityCatalog, error)

NewPublicCapabilityCatalog validates and projects the runtime catalog into a deterministic public representation.

type PublicCapabilityCounts added in v1.0.0

type PublicCapabilityCounts struct {
	Providers         int `json:"providers"`
	ModelPublishers   int `json:"model_publishers"`
	ModelFamilies     int `json:"model_families"`
	ExactModels       int `json:"exact_models"`
	ProviderOfferings int `json:"provider_offerings"`
}

PublicCapabilityCounts reports each normalized catalog dimension separately.

type PublicExactModelCapability added in v1.0.0

type PublicExactModelCapability struct {
	Identifier        string   `json:"identifier"`
	Publisher         string   `json:"publisher"`
	Family            string   `json:"family"`
	Version           string   `json:"version"`
	Operations        []string `json:"operations"`
	MediaInputs       []string `json:"media_inputs"`
	Capabilities      []string `json:"capabilities"`
	ProviderOfferings []string `json:"provider_offerings"`
}

PublicExactModelCapability describes one provider-independent exact model.

type PublicModelFamily added in v1.0.0

type PublicModelFamily struct {
	Identifier   string `json:"identifier"`
	Publisher    string `json:"publisher"`
	Label        string `json:"label"`
	WeightAccess string `json:"weight_access"`
}

PublicModelFamily identifies one family within a model publisher.

type PublicModelPublisher added in v1.0.0

type PublicModelPublisher struct {
	Identifier string `json:"identifier"`
	Label      string `json:"label"`
	ModelCount int    `json:"model_count"`
}

PublicModelPublisher identifies one model publisher and its exact-model count.

type PublicProviderCapability added in v0.2.59

type PublicProviderCapability struct {
	Identifier      string   `json:"identifier"`
	Label           string   `json:"label"`
	CredentialKinds []string `json:"credential_kinds"`
}

PublicProviderCapability identifies one selectable provider.

type PublicProviderOffering added in v1.0.0

type PublicProviderOffering struct {
	Identifier         string              `json:"identifier"`
	Provider           string              `json:"provider"`
	Model              string              `json:"model"`
	Capabilities       []string            `json:"capabilities"`
	WireContract       string              `json:"wire_contract"`
	ExecutionLifecycle string              `json:"execution_lifecycle"`
	OutputTokenLimit   int                 `json:"output_token_limit"`
	ReasoningEfforts   []string            `json:"reasoning_efforts"`
	Controls           []CatalogControl    `json:"controls"`
	Limits             []CatalogLimit      `json:"limits"`
	MediaLimits        []CatalogMediaLimit `json:"media_limits"`
}

PublicProviderOffering describes one selectable provider and exact-model route.

type Reasoning

type Reasoning struct {
	Effort string `json:"effort"`
}

Reasoning specifies configuration options for reasoning-capable models. Effort indicates the tenant-selected reasoning intensity supported by the configured upstream adapter.

type ReasoningEffortCapability added in v0.2.35

type ReasoningEffortCapability struct {
	Adapter string   `mapstructure:"adapter" yaml:"adapter"`
	Efforts []string `mapstructure:"efforts" yaml:"efforts"`
}

ReasoningEffortCapability declares the configured upstream mapping for one exact provider offering.

type TenantDefaults added in v0.2.15

type TenantDefaults struct {
	Provider          string
	Model             string
	DictationProvider string
	DictationModel    string
	SystemPrompt      string
	ReasoningEffort   string
}

TenantDefaults holds default request values selected by an authenticated tenant.

func DefaultTenantDefaults added in v0.2.15

func DefaultTenantDefaults() TenantDefaults

DefaultTenantDefaults returns the canonical routing defaults assigned to a new managed tenant.

type Tool

type Tool struct {
	Type string `json:"type"`
}

Tool represents a tool available to the model.

type UpstreamRateLimitConfiguration added in v0.2.28

type UpstreamRateLimitConfiguration struct {
	Origin      string
	MaxRequests int
	Interval    string
}

UpstreamRateLimitConfiguration describes one exact-origin rolling-window limit.

Jump to

Keyboard shortcuts

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