use axum::{ Json, Router, extract::{DefaultBodyLimit, RawQuery, State}, http::{HeaderMap, StatusCode}, middleware, response::{IntoResponse, Response}, routing::{get, post}, }; use serde::Serialize; use crate::{ responses, worker::{WorkerState, WorkerStatus}, }; #[derive(Serialize)] struct HealthResponse { status: &'static str, } #[derive(Serialize)] struct StatusResponse { service: &'static str, server_pid: u32, model: Option, version: &'static str, worker: WorkerState, ready: bool, max_context: Option, } /// The generations shown by default in `requests` (the Python Monitor shows twelve). const RECENT_REQUESTS: usize = 12; #[cfg(test)] mod tests; mod state; pub use state::{AppState, EngineLink, HttpPolicy, ModelView, Services}; mod routes; #[allow(unused_imports)] pub use routes::*; mod admin_routes; #[allow(unused_imports)] pub use admin_routes::*; mod readiness; #[allow(unused_imports)] pub use readiness::*; mod metrics_document; #[allow(unused_imports)] pub use metrics_document::*;