Add backend provider and cost configuration

This commit is contained in:
2026-11-22 18:11:10 +00:00
parent f2b0ed8d6c
commit 6056f93e55
9 changed files with 108 additions and 13 deletions

View File

@@ -37,6 +37,10 @@ type CollectionSettings struct {
type BackendSettings struct {
// ID identifies the backend in its resource list.
ID string `yaml:"id"`
// Provider selects response and diagnostic conventions when supplied.
Provider *string `yaml:"provider"`
// ZeroCost enables a configured-zero fallback when no cost is reported.
ZeroCost *bool `yaml:"zero_cost"`
// Endpoint is the backend's absolute base URL.
Endpoint *string `yaml:"endpoint"`
// APIKeyEnv names an environment variable containing a credential.
@@ -163,7 +167,6 @@ type BackendSmokeTestConfig struct {
// diagnostics. A nil endpoint uses the effective backend endpoint.
Reachability *ReachabilityProbeConfig `json:"reachability,omitempty" yaml:"reachability,omitempty"`
// Authentication optionally declares a named authentication diagnostic.
// A supplied object requires Kind.
Authentication *AuthenticationProbeConfig `json:"authentication,omitempty" yaml:"authentication,omitempty"`
}
@@ -178,7 +181,8 @@ type ReachabilityProbeConfig struct {
// AuthenticationProbeConfig configures an optional named authentication diagnostic.
type AuthenticationProbeConfig struct {
// Kind selects the authentication adapter. Supported values are "none" and
// "openrouter_key"; surrounding whitespace and case are normalized.
// "openrouter_key" and "vllm_models"; surrounding whitespace and case are
// normalized. Nil leaves adapter selection to the provider default.
Kind *string `json:"kind,omitempty" yaml:"kind,omitempty"`
// Endpoint is an absolute HTTP(S) URL, including any desired path or query.
// Nil selects the adapter's backend-relative destination; an explicit blank