pub struct WorkerConfig {
pub model: Option<String>,
pub api_base_url: Option<String>,
pub max_tokens: Option<u32>,
pub temperature: Option<f32>,
pub host: Option<String>,
pub port: Option<u16>,
}Expand description
Per-worker connection and model configuration.
Optional overrides for a named worker. All fields are optional; when absent the worker falls back to its built-in defaults or environment variables.
Workers prefer TOML config over defaults but environment variables still
override TOML values (e.g. OPENAI_API_KEY always takes precedence over
any key stored in the config file).
§Example
[workers.openai]
model = "gpt-4o"
api_base_url = "https://api.openai.com/v1"
[workers.anthropic]
model = "claude-opus-4-6"
max_tokens = 4096
[workers.llama_cpp]
host = "localhost"
port = 8080§Panics
This type never panics.
Fields§
§model: Option<String>Model name to use (e.g. "gpt-4o", "claude-opus-4-6").
api_base_url: Option<String>API base URL (e.g. "https://api.openai.com/v1").
Overrides the worker’s built-in default endpoint.
max_tokens: Option<u32>Maximum tokens to generate. None uses the worker default.
temperature: Option<f32>Sampling temperature. None uses the worker default.
host: Option<String>Hostname for local servers (llama.cpp / vLLM).
port: Option<u16>Port for local servers (llama.cpp / vLLM).
Trait Implementations§
Source§impl Clone for WorkerConfig
impl Clone for WorkerConfig
Source§fn clone(&self) -> WorkerConfig
fn clone(&self) -> WorkerConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorkerConfig
impl Debug for WorkerConfig
Source§impl Default for WorkerConfig
impl Default for WorkerConfig
Source§fn default() -> WorkerConfig
fn default() -> WorkerConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for WorkerConfig
impl<'de> Deserialize<'de> for WorkerConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for WorkerConfig
impl PartialEq for WorkerConfig
Source§fn eq(&self, other: &WorkerConfig) -> bool
fn eq(&self, other: &WorkerConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for WorkerConfig
impl Serialize for WorkerConfig
impl StructuralPartialEq for WorkerConfig
Auto Trait Implementations§
impl Freeze for WorkerConfig
impl RefUnwindSafe for WorkerConfig
impl Send for WorkerConfig
impl Sync for WorkerConfig
impl Unpin for WorkerConfig
impl UnsafeUnpin for WorkerConfig
impl UnwindSafe for WorkerConfig
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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> 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> 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