#[non_exhaustive]pub struct ModelLaunch {Show 14 fields
pub id: String,
pub engine: EngineKind,
pub source: String,
pub context: Option<u32>,
pub slots: Option<u32>,
pub gpu_layers: Option<i32>,
pub swap_group: Option<String>,
pub embedding: bool,
pub extra_args: Vec<String>,
pub idle_ttl: Option<Duration>,
pub wrap: Option<Wrap>,
pub adapters: Vec<LoraAdapter>,
pub lora_slots: Option<u32>,
pub mmproj: Option<String>,
}Expand description
A model this node may be told to load.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringPool id; also the engine’s served model name.
engine: EngineKind§source: StringA GGUF path for llama.cpp; a path or Hub id for vLLM; an MLX-format model directory (or Hub id) for MLX-LM.
context: Option<u32>§slots: Option<u32>Concurrent requests (llama.cpp slots, vLLM max sequences).
gpu_layers: Option<i32>llama.cpp --n-gpu-layers; None keeps the engine’s default (all that fit).
swap_group: Option<String>Models in the same group are never resident together.
embedding: bool§extra_args: Vec<String>§idle_ttl: Option<Duration>Unload after this long without requests; None keeps it loaded.
wrap: Option<Wrap>Wrap a stock server already running on loopback (such as vllm serve or llama-server
started by hand) instead of starting an engine: the node only probes, advertises and forwards.
adapters: Vec<LoraAdapter>LoRA adapters served on this base (llama.cpp and vLLM only; see
ModelLaunch::check_adapters). Each is its own pool id.
lora_slots: Option<u32>vLLM only: start the engine with LoRA on (--enable-lora, --max-loras at least this)
even without adapters, so adapters can be added and removed while it runs
(crate::Supervisor::add_adapter_live). A vLLM base started with adapters can take more
at run time without it. llama.cpp ignores it: llama-server loads adapter files only at start.
mmproj: Option<String>llama.cpp only: a multimodal projector GGUF (--mmproj), so the model takes images
(and audio, when the projector has it). See crate::Supervisor::set_projector_live.
Implementations§
Source§impl ModelLaunch
impl ModelLaunch
pub fn new( id: impl Into<String>, engine: EngineKind, source: impl Into<String>, ) -> Self
Sourcepub fn with_mmproj(self, path: impl Into<String>) -> Self
pub fn with_mmproj(self, path: impl Into<String>) -> Self
See ModelLaunch::mmproj.
Sourcepub fn with_lora_slots(self, slots: u32) -> Self
pub fn with_lora_slots(self, slots: u32) -> Self
Sourcepub fn runtime_lora(&self) -> bool
pub fn runtime_lora(&self) -> bool
Whether the engine starts able to take adapters at run time: vLLM with adapters or
ModelLaunch::lora_slots.
pub fn with_adapters(self, adapters: Vec<LoraAdapter>) -> Self
Sourcepub fn served_ids(&self) -> Vec<String>
pub fn served_ids(&self) -> Vec<String>
The pool ids this launch serves: the base’s, then each adapter’s.
Sourcepub fn check_adapters(&self) -> Result<(), String>
pub fn check_adapters(&self) -> Result<(), String>
Whether the adapters can be served: llama.cpp or vLLM (not MLX-LM, not a wrapped server,
not an embedding model), unique non-empty ids other than the base’s, finite scales, and
paths the engine takes. On llama.cpp each adapter must be a LoRA GGUF (general.type =
adapter, adapter.type = lora) with the base GGUF’s architecture; both headers are
read. On vLLM a local adapter must be a PEFT LoRA directory; anything else must look like a
Hub id.
Sourcepub fn capabilities(&self) -> Capabilities
pub fn capabilities(&self) -> Capabilities
What this model takes. Embedding models only embed (and can’t run on MLX-LM at all). A
llama.cpp model takes images and audio when it has a multimodal projector
(ModelLaunch::mmproj, or --mmproj in extra_args); the projector decides which, and
llama-server refuses what it lacks. vLLM and MLX-LM models are text only here.
Trait Implementations§
Source§impl Clone for ModelLaunch
impl Clone for ModelLaunch
Source§impl Debug for ModelLaunch
impl Debug for ModelLaunch
Source§impl<'de> Deserialize<'de> for ModelLaunch
impl<'de> Deserialize<'de> for ModelLaunch
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>,
impl Eq for ModelLaunch
Source§impl PartialEq for ModelLaunch
impl PartialEq for ModelLaunch
Source§impl Serialize for ModelLaunch
impl Serialize for ModelLaunch
impl StructuralPartialEq for ModelLaunch
Auto Trait Implementations§
impl Forget for ModelLaunch
impl Freeze for ModelLaunch
impl Move for ModelLaunch
impl RefUnwindSafe for ModelLaunch
impl Send for ModelLaunch
impl Sync for ModelLaunch
impl Unpin for ModelLaunch
impl UnsafeUnpin for ModelLaunch
impl UnwindSafe for ModelLaunch
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
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>,
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
key and return true if they are equal.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreimpl<T> Message for T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.