pub struct ServedModel(/* private fields */);Expand description
Model an OpenAI-compatible server serves, identified as
openai-compatible/<served model>.
Servers name their models at runtime, so each distinct id is interned once
and kept for the process lifetime, which keeps AgentModel Copy and
one pointer wide. A process interns only the names its servers report and
its sessions store.
Implementations§
Source§impl ServedModel
impl ServedModel
Sourcepub const CONFIGURED: Self
pub const CONFIGURED: Self
Model named by the host’s OPENAI_COMPATIBLE_MODEL, stored under the
bare openai-compatible id.
Sourcepub fn new(name: &str) -> Option<Self>
pub fn new(name: &str) -> Option<Self>
Returns the served model name, such as qwen3:latest, or None
for a blank name.
Sourcepub const fn id(self) -> &'static str
pub const fn id(self) -> &'static str
Returns the stable model id, such as openai-compatible/qwen3:latest.
Sourcepub fn name(self) -> Option<&'static str>
pub fn name(self) -> Option<&'static str>
Returns the name the server serves, or None for
Self::CONFIGURED, whose name the host environment supplies.
Trait Implementations§
Source§impl Clone for ServedModel
impl Clone for ServedModel
impl Copy for ServedModel
Source§impl Debug for ServedModel
impl Debug for ServedModel
impl Eq for ServedModel
Source§impl Hash for ServedModel
impl Hash for ServedModel
Source§impl PartialEq for ServedModel
impl PartialEq for ServedModel
impl StructuralPartialEq for ServedModel
Auto Trait Implementations§
impl Forget for ServedModel
impl Freeze for ServedModel
impl Move for ServedModel
impl RefUnwindSafe for ServedModel
impl Send for ServedModel
impl Sync for ServedModel
impl Unpin for ServedModel
impl UnsafeUnpin for ServedModel
impl UnwindSafe for ServedModel
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.