MCPcopy
hub / github.com/netbirdio/netbird / Middleware

Struct Middleware

proxy/internal/middleware/builtin/llm_router/middleware.go:74–81  ·  view source on GitHub ↗

Middleware routes requests to upstream LLM providers based on the llm.model metadata emitted by llm_request_parser.

Source from the content-addressed store, hash-verified

72// Middleware routes requests to upstream LLM providers based on the
73// llm.model metadata emitted by llm_request_parser.
74type Middleware struct {
75 cfg Config
76 // tokenSrc caches one auto-refreshing OAuth2 TokenSource per GCP
77 // service-account key (keyed by a hash of the key material), so Vertex
78 // token minting happens once and refreshes are amortised across requests.
79 tokenMu sync.Mutex
80 tokenSrc map[string]oauth2.TokenSource
81}
82
83// New constructs a Middleware with the supplied configuration. Empty
84// or nil Providers slice yields a router that denies every request as

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected