feat(provider): per-model and per-path upstreams (#8)

Add modelBaseUrls and pathBaseUrls to openai-type providers.
This commit is contained in:
2026-11-08 07:26:14 +00:00
committed by GitHub
parent aa9a925d49
commit a4fda5f9cb
10 changed files with 512 additions and 9 deletions
+10
View File
@@ -230,6 +230,16 @@ type ProviderConfig struct {
// also unset); a non-empty value that fails to parse, or parses to a
// duration <= 0, is a construction error naming this provider.
RequestTimeout string `json:"requestTimeout,omitempty"`
// ModelBaseURLs maps a bare model id (the id sent upstream) to the base
// URL that serves it, overriding BaseURL for that model. Its keys are
// declared models of the provider, like Models. Static: never polled by
// discovery. openai-type providers only. Empty keeps single-upstream
// behavior.
ModelBaseURLs map[string]string `json:"modelBaseUrls,omitempty"`
// PathBaseURLs maps a native passthrough path prefix (e.g. "/v1/decide")
// to a base URL for requests that name no model in ModelBaseURLs. Longest
// prefix wins; no match uses BaseURL. openai-type providers only.
PathBaseURLs map[string]string `json:"pathBaseUrls,omitempty"`
// MetadataPath is an optional second discovery endpoint (feature
// v0.23), fetched alongside the provider's normal listModels call
// when set: a path such as "/api/v0/models" (LM Studio's own,