mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-22 22:59:09 +02:00
[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.
This commit is contained in:
+1
-5
@@ -246,10 +246,6 @@ type Server struct {
|
||||
// in processMappings before the receive loop reconnects to resync.
|
||||
// Zero uses defaultMappingBatchWatchdog.
|
||||
MappingBatchWatchdog time.Duration
|
||||
// MiddlewareDataDir is the base directory the middleware system uses to
|
||||
// resolve file-backed configuration (e.g. the cost_meter pricing table).
|
||||
// Empty means any middleware that requires a file fails at configure time.
|
||||
MiddlewareDataDir string
|
||||
// MiddlewareCaptureBudgetBytes overrides the proxy-wide in-flight capture
|
||||
// budget passed to middleware.NewManager. Zero or negative values fall
|
||||
// back to defaultMiddlewareCaptureBudgetBytes (256 MiB).
|
||||
@@ -2093,7 +2089,7 @@ func (s *Server) initMiddlewareManager(ctx context.Context) error {
|
||||
return fmt.Errorf("middleware manager requires metrics bundle")
|
||||
}
|
||||
otelMeter := s.meter.Meter()
|
||||
mwbuiltin.Configure(ctx, s.MiddlewareDataDir, otelMeter, s.Logger, s.mgmtClient)
|
||||
mwbuiltin.Configure(ctx, otelMeter, s.Logger, s.mgmtClient)
|
||||
|
||||
mwMetrics, err := middleware.NewMetrics(otelMeter)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user