Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version = "dev"
Version is the build's release version, reported by /healthz.
Functions ¶
This section is empty.
Types ¶
type GRPCServer ¶
type GRPCServer struct {
// contains filtered or unexported fields
}
GRPCServer hosts the proxy data-plane and admin services.
func NewGRPCServer ¶
func NewGRPCServer(proxy pb.GatewayServiceServer, admin pb.AdminServiceServer, nodeReg pb.NodeRegistryServiceServer, verifier *apikeys.Verifier, addr string, maxRecvMsgSize int) *GRPCServer
NewGRPCServer wires interceptors (logging first, auth second) and registers the services.
func (*GRPCServer) Start ¶
func (s *GRPCServer) Start() error
func (*GRPCServer) Stop ¶
func (s *GRPCServer) Stop()
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer serves the health endpoints and, when configured, the OpenAI-compatible API.
func NewHTTPServer ¶
func NewHTTPServer(pinger Pinger, addr string, api *OpenAIAPI, requestTimeout time.Duration, more ...Registrar) *HTTPServer
NewHTTPServer creates the HTTP server. api may be nil (health only); requestTimeout bounds one API call, which waits on an upstream model.
func (*HTTPServer) Shutdown ¶
func (s *HTTPServer) Shutdown(ctx context.Context) error
Shutdown gracefully shuts down the HTTP server
func (*HTTPServer) WithDegradedReadiness ¶ added in v0.13.1
func (s *HTTPServer) WithDegradedReadiness(window time.Duration) *HTTPServer
WithDegradedReadiness keeps /readyz at 200 for up to window after the last good ping, while recently verified keys still work (AUTH_STALE_IF_ERROR): a 503 would pull every replica at once. Past the window nothing is served.
type OpenAIAPI ¶
type OpenAIAPI struct {
// contains filtered or unexported fields
}
OpenAIAPI serves the data plane over HTTP in the OpenAI wire format. It calls the same handlers as gRPC after the same key and scope check, so routing, throttling and usage reporting behave identically on both transports.
func NewOpenAIAPI ¶
func NewOpenAIAPI(proxy pb.GatewayServiceServer, verifier *apikeys.Verifier) *OpenAIAPI