pub struct ServerConfig {Show 19 fields
pub host: String,
pub port: u16,
pub max_concurrent: usize,
pub timeout_secs: u64,
pub cors_enabled: bool,
pub api_keys: Vec<String>,
pub rate_limit_capacity: f64,
pub rate_limit_rate: f64,
pub body_limit_bytes: usize,
pub metrics_enabled: bool,
pub structured_tracing: bool,
pub router_capacity: usize,
pub router_mem_budget_mb: usize,
pub router_preload: Vec<String>,
pub admin_bearer_token: Option<String>,
pub admin_listen: String,
pub batch_spool_dir: Option<String>,
pub batch_max_pending_bytes: usize,
pub per_key_rate_limits: Option<HashMap<String, (f64, f64)>>,
}Expand description
Configuration for the OxiLLaMa API server.
Fields§
§host: StringHost address to bind to.
port: u16Port number.
max_concurrent: usizeMaximum concurrent requests.
timeout_secs: u64Request timeout in seconds.
cors_enabled: boolEnable CORS headers.
api_keys: Vec<String>API keys for authentication (empty = no auth).
rate_limit_capacity: f64Rate limit: maximum burst capacity (0.0 = no limit).
rate_limit_rate: f64Rate limit: tokens per second refill rate.
body_limit_bytes: usizeMaximum request body size in bytes (0 = no limit).
metrics_enabled: boolEnable the /metrics Prometheus endpoint.
structured_tracing: boolEnable structured request tracing middleware.
router_capacity: usizeMaximum number of concurrently loaded models (0 = 1, single-model mode).
router_mem_budget_mb: usizeMemory budget for the model pool in MiB (0 = unlimited).
router_preload: Vec<String>Model IDs to pre-load at startup.
admin_bearer_token: Option<String>Bearer token required for all /admin/* routes.
None = token-less mode (admin only accessible from loopback).
admin_listen: StringAddress the admin interface is expected to listen on. Used for the startup safety check: non-loopback + no token → fatal error.
batch_spool_dir: Option<String>Directory for disk-spooled batch jobs.
Defaults to $TMPDIR/oxillama_batch_spool.
batch_max_pending_bytes: usizeMaximum pending bytes across all queued batch jobs.
per_key_rate_limits: Option<HashMap<String, (f64, f64)>>Per-key override map: api_key → (capacity, rate_per_second).
When a request carries an API key that appears in this map, the
override (capacity, rate) pair is used instead of the server
defaults. Keys absent from this map use rate_limit_capacity and
rate_limit_rate as their bucket parameters.
None (the default) disables per-key rate limiting entirely.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl Default for ServerConfig
impl Default for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfig
impl<'de> Deserialize<'de> for ServerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more