pub struct ServerConfigBuilder { /* private fields */ }Expand description
Builder for ServerConfig with chainable methods
Implementations§
Source§impl ServerConfigBuilder
impl ServerConfigBuilder
Sourcepub fn from_config(config: ServerConfig) -> Self
pub fn from_config(config: ServerConfig) -> Self
Start from an existing config
pub fn host(self, host: impl Into<String>) -> Self
pub fn port(self, port: u16) -> Self
pub fn max_cached_models(self, max: usize) -> Self
pub fn preload_models(self, models: Vec<String>) -> Self
pub fn add_preload_model(self, model: impl Into<String>) -> Self
pub fn enable_logging(self, enabled: bool) -> Self
pub fn enable_metrics(self, enabled: bool) -> Self
pub fn max_tokens_limit(self, limit: usize) -> Self
pub fn request_timeout_secs(self, timeout: u64) -> Self
pub fn max_concurrent_requests(self, max: usize) -> Self
pub fn cancellation_check_interval(self, interval: u64) -> Self
pub fn cancellation_check_interval_duration(self, interval: Duration) -> Self
Sourcepub fn max_context(self, max_context: Option<usize>) -> Self
pub fn max_context(self, max_context: Option<usize>) -> Self
Set maximum context length for KV cache allocation
Sourcepub fn kv_quant(self, kv_quant: KVQuantArg) -> Self
pub fn kv_quant(self, kv_quant: KVQuantArg) -> Self
Set KV cache quantization type
pub fn cors(self, cors: CorsConfig) -> Self
pub fn cors_enabled(self, enabled: bool) -> Self
pub fn cors_origins(self, origins: Vec<String>) -> Self
pub fn cors_allow_credentials(self, allow: bool) -> Self
pub fn cors_permissive_headers(self, permissive: bool) -> Self
pub fn sampling_defaults(self, defaults: SamplingParamDefaults) -> Self
pub fn tls_cert(self, cert: PathBuf) -> Self
pub fn tls_key(self, key: PathBuf) -> Self
pub fn working_dir(self, dir: PathBuf) -> Self
pub fn pid_file(self, file: PathBuf) -> Self
Sourcepub fn from_env(self) -> Self
pub fn from_env(self) -> Self
Load values from environment variables (merges with current config)
Sourcepub fn build(self) -> ServerConfig
pub fn build(self) -> ServerConfig
Build the final configuration
Trait Implementations§
Source§impl Debug for ServerConfigBuilder
impl Debug for ServerConfigBuilder
Source§impl Default for ServerConfigBuilder
impl Default for ServerConfigBuilder
Source§fn default() -> ServerConfigBuilder
fn default() -> ServerConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ServerConfigBuilder
impl RefUnwindSafe for ServerConfigBuilder
impl Send for ServerConfigBuilder
impl Sync for ServerConfigBuilder
impl Unpin for ServerConfigBuilder
impl UnsafeUnpin for ServerConfigBuilder
impl UnwindSafe for ServerConfigBuilder
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<T> JaggedSlice<T> for T
impl<T> JaggedSlice<T> for T
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more