Expand description
Admin API endpoints for operational management.
Provides non-OpenAI routes used by operators to inspect and control a running OxiBonsai server instance.
| Method | Path | Description |
|---|---|---|
| GET | /admin/status | Server status and live metrics |
| GET | /admin/config | Current configuration snapshot |
| POST | /admin/reset-metrics | Reset all metric counters to zero |
| GET | /admin/cache-stats | KV/inference cache statistics |
| GET | /admin/workload-stats | Workload aggregator + KV policy |
§Example
ⓘ
use std::sync::Arc;
use oxibonsai_runtime::admin::{AdminState, create_admin_router};
use oxibonsai_runtime::metrics::InferenceMetrics;
let metrics = Arc::new(InferenceMetrics::new());
let state = Arc::new(AdminState::new(metrics));
let router = create_admin_router(Arc::clone(&state));Structs§
- Admin
State - Shared state passed to all admin route handlers.
- Config
Snapshot - Snapshot of key server configuration values.
- Server
Status - Live server status snapshot.
Functions§
- create_
admin_ router - Build the Axum router for all admin endpoints.
- features_
enabled - Return the list of Cargo features that were enabled at compile time.
- get_
cache_ stats GET /admin/cache-stats— return placeholder cache statistics.- get_
config GET /admin/config— return current configuration snapshot.- get_
status GET /admin/status— return live server status and metrics.- get_
workload_ stats GET /admin/workload-stats— return runtime workload telemetry.- reset_
metrics POST /admin/reset-metrics— reset all metric counters to zero.