Documentation
¶
Overview ¶
Package v1 implements the OpenAI-compatible /v1/... API endpoints.
Incoming requests are:
- Authenticated via the Internal Token Service
- Validated against the token's rules (allowed models)
- Routed to the appropriate provider by the Router Service
- Translated back to OpenAI-compatible responses
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler holds the dependencies for the v1 API.
type Params ¶ added in v0.1.2
type Params struct {
Tokens *token.Service
RouterSvc *router.Service
MetricsSvc *metrics.Service
ProviderSvc *provider.Service
ModelInfoSvc *modelinfo.Service
VirtualSvc *virtual.Service
Logger *slog.Logger
// NoAuth skips bearer validation: requests route with a nil token.
NoAuth bool
}
Params carries every dependency of the v1 Handler in one value, so adding a service touches one struct instead of every call site.
Click to show internal directories.
Click to hide internal directories.