pub struct OmlxConfig {
pub host: String,
pub api_key: Option<String>,
pub timeout: Option<Duration>,
}Expand description
Configuration for connecting to an oMLX server.
Default reads the environment, so explicit fields take precedence over
the environment, which takes precedence over the built-in defaults:
| Field | Environment | Default |
|---|---|---|
host | OMLX_HOST | http://localhost:8000 |
api_key | OMLX_API_KEY | none |
timeout | OMLX_TIMEOUT, in milliseconds | 10 minutes |
use mojentic::llm::gateways::{OmlxConfig, OmlxGateway};
let gateway = OmlxGateway::with_config(OmlxConfig {
host: "http://studio.local:8000".to_string(),
..Default::default()
});Fields§
§host: StringServer address without the /v1 suffix. The gateway adds /v1.
api_key: Option<String>Sent as Authorization: Bearer <key>. No header is sent without one.
timeout: Option<Duration>Bounds non-streaming requests, including model load.
Streams are cancelled by dropping them; a whole-response timeout
would cut off long replies.
None means no timeout.
Trait Implementations§
Source§impl Clone for OmlxConfig
impl Clone for OmlxConfig
Source§fn clone(&self) -> OmlxConfig
fn clone(&self) -> OmlxConfig
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 OmlxConfig
Shows whether a key is set, never the key itself.
impl Debug for OmlxConfig
Shows whether a key is set, never the key itself.
Source§impl Default for OmlxConfig
impl Default for OmlxConfig
impl Eq for OmlxConfig
Source§impl PartialEq for OmlxConfig
impl PartialEq for OmlxConfig
impl StructuralPartialEq for OmlxConfig
Auto Trait Implementations§
impl Freeze for OmlxConfig
impl RefUnwindSafe for OmlxConfig
impl Send for OmlxConfig
impl Sync for OmlxConfig
impl Unpin for OmlxConfig
impl UnsafeUnpin for OmlxConfig
impl UnwindSafe for OmlxConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.