Skip to main content

Crate crabllm_proxy

Crate crabllm_proxy 

Source

Re-exports§

pub use auth::Principal;

Modules§

admin
admin_providers
anthropic
Anthropic-compatible inbound endpoint.
auth
ext
gemini
Gemini-compatible inbound endpoint.
handlers
storage

Structs§

AppState
Shared application state passed to all handlers.
UsageEvent
Per-request event emitted after a request completes. Embedders subscribe to the AppState::usage_events broadcast channel to observe live traffic without scraping the Prometheus endpoint.

Constants§

PREFIX_AUDIT
PREFIX_BUDGET
PREFIX_CACHE
PREFIX_KEYS
PREFIX_PROVIDERS
PREFIX_RATE_LIMIT
PREFIX_USAGE

Functions§

log_request
Middleware that logs every incoming HTTP request with method, path, status, and latency. 2xx/3xx log at info, 4xx/5xx at warn. /health and /metrics log at debug so probes don’t flood the default output.
router
Build the Axum router with all API routes, the built-in auth middleware, active-connection tracking, /health, and merged admin routes. This is the batteries-included shape used by the standalone gateway binary.
routes
Build the bare API route tree (/v1/*) bound to state, with no auth, observability, or admin layers. Embedders use this when they want to install their own auth or observability middleware instead of the defaults in router. Standalone callers should prefer router.