Files
netbird/proxy/internal/llm/model.go
braginini 2316c20a2b [management, proxy] Management-owned LLM pricing: file-backed defaults +
operator prices, delivered via cost_meter middleware config

  Operator-pinned model prices (ProviderModel.InputPer1k/OutputPer1k) were
  stored and round-tripped through the API but never consumed for billing:
  the proxy priced exclusively from a defaults_pricing.yaml embedded in
  its binary. Any model outside that file recorded $0 spend, price changes
  required a proxy release, and the catalog and the YAML were two
  hand-synced copies of the same rates, guarded only by a manually
  maintained coverage list that had already drifted.
2026-07-29 16:49:37 +02:00

22 lines
871 B
Go

package llm
import (
sharedllm "github.com/netbirdio/netbird/shared/llm"
)
// NormalizeBedrockModel strips an ARN wrapper, a cross-region inference-profile
// prefix, and the version/throughput suffix from a Bedrock model id so it
// matches the catalog/pricing key. Thin delegate to the shared implementation
// (shared/llm), which management also uses at synthesis time so both sides of
// the pricing / routing contract normalize identically.
func NormalizeBedrockModel(modelID string) string {
return sharedllm.NormalizeBedrockModel(modelID)
}
// NormalizeVertexModel strips the "@version" suffix from a Vertex AI model id
// so it matches the catalog/pricing key. Thin delegate to shared/llm, kept
// beside NormalizeBedrockModel for the same contract reason.
func NormalizeVertexModel(modelID string) string {
return sharedllm.NormalizeVertexModel(modelID)
}