From 11b3b776625f12dd246f2dfbc45cd03d750428f0 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Thu, 15 Oct 2026 22:21:33 +0100 Subject: [PATCH] style: reorder Config and modelRegistry fields for alignment --- llmgateway.go | 10 +++++----- registry.go | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/llmgateway.go b/llmgateway.go index 1a24f89..67f309e 100644 --- a/llmgateway.go +++ b/llmgateway.go @@ -55,11 +55,6 @@ type Config struct { // (validateModelAliases, registry.go). ModelAliases map[string]string `json:"modelAliases,omitempty"` Providers map[string]*ProviderConfig `json:"providers,omitempty"` - // RequireModelPrefix, when true, makes every model addressable only as - // "provider/model" or as a ModelAliases id: a bare discovered id is not - // resolved (404 unknown model) and is not listed by GET /v1/models. It - // removes the sorted-first bare-id collision winner. Defaults to false. - RequireModelPrefix bool `json:"requireModelPrefix,omitempty"` // ModelMeta declares per-model metadata overrides (feature v0.23): // context window size and per-token cost, keyed by an exact // "provider/model" id or a bare model id (applying wherever that bare @@ -177,6 +172,11 @@ type Config struct { // already does. Without it a tenant can enable beta features on the // operator's own Anthropic account. Defaults to false. StripClientAnthropicBeta bool `json:"stripClientAnthropicBeta,omitempty"` + // RequireModelPrefix, when true, makes every model addressable only as + // "provider/model" or as a ModelAliases id: a bare discovered id is not + // resolved (404 unknown model) and is not listed by GET /v1/models. It + // removes the sorted-first bare-id collision winner. Defaults to false. + RequireModelPrefix bool `json:"requireModelPrefix,omitempty"` } // ProviderConfig describes one upstream LLM provider. diff --git a/registry.go b/registry.go index 178a8c0..e573079 100644 --- a/registry.go +++ b/registry.go @@ -664,9 +664,6 @@ type modelRegistry struct { // cheap nil-map lookup (always false/zero) that adds no branching // cost to the v0.1 no-aliases case. aliases map[string]string - // requirePrefix is Config.RequireModelPrefix: resolve and listFor treat - // a bare id as unaddressable, leaving "provider/model" and aliases. - requirePrefix bool // modelMeta is the validated Config.ModelMeta config-override map // (feature v0.23), built once by newModelRegistry via // validateModelMeta and never mutated afterward. nil (not merely @@ -722,6 +719,9 @@ type modelRegistry struct { warnedMu sync.Mutex // modelsCacheMu guards modelsCache. modelsCacheMu sync.Mutex + // requirePrefix is Config.RequireModelPrefix: resolve and listFor treat + // a bare id as unaddressable, leaving "provider/model" and aliases. + requirePrefix bool } // modelsCacheEntry is one cached, encoded GET /v1/models response body