oxibonsai_serve/lib.rs
1//! Library interface for oxibonsai-serve.
2//!
3//! Exposes the argument-parsing, banner, configuration, environment,
4//! validation, and metrics modules so they can be exercised from integration
5//! tests without going through `main`.
6//!
7//! The four "uplift" modules added for the Alpha→Stable milestone are:
8//!
9//! - [`config`] — layered configuration (`defaults < TOML < env < CLI`)
10//! - [`mod@env`] — `OXIBONSAI_*` environment-variable parsing
11//! - [`validation`] — invariants over a fully-merged [`config::ServerConfig`]
12//! - [`metrics`] — hand-rolled Prometheus text-exposition registry
13
14pub mod args;
15pub mod banner;
16pub mod config;
17pub mod env;
18pub mod metrics;
19pub mod validation;
20
21pub use args::{ParseError, ServerArgs};
22pub use config::{
23 AuthConfig, BindConfig, ConfigError, LimitsConfig, ModelConfig, ObservabilityConfig,
24 PartialServerConfig, SamplingConfig, ServerConfig, TokenizerConfigSection,
25};
26pub use env::{parse_env_map, parse_process_env};
27pub use metrics::{MetricsRegistry, DEFAULT_HISTOGRAM_BUCKETS};
28pub use validation::{MAX_DEFAULT_MAX_TOKENS, MIN_BEARER_TOKEN_LEN, VALID_LOG_LEVELS};