Skip to main content

Module admin

Module admin 

Source
Expand description

Admin API endpoints for operational management.

Provides non-OpenAI routes used by operators to inspect and control a running OxiBonsai server instance.

MethodPathDescription
GET/admin/statusServer status and live metrics
GET/admin/configCurrent configuration snapshot
POST/admin/reset-metricsReset all metric counters to zero
GET/admin/cache-statsKV/inference cache statistics
GET/admin/workload-statsWorkload 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§

AdminState
Shared state passed to all admin route handlers.
ConfigSnapshot
Snapshot of key server configuration values.
ServerStatus
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.