pub struct LlmExecutorFactory;Expand description
Candle executor factory
Builds a ModelExecutor from a resolved model path. Despite the
historical “candle” name (PR #127 deleted the legacy CandleBackend
trait), this factory now produces real Backend<B>-based executors
for LLMs (LlamaFamilyModel / Qwen3MoeModel) and candle-based
executors for embedding / multimodal / ASR (Bert, CLIP, Whisper).
The factory dispatches over four axes:
- Dim 1 (architecture): LlamaFamilyModel vs Qwen3MoeModel — runtime
value, decided inside [
build_llm]. - Dim 3 (weight format): safetensors vs GGUF — runtime branch on
WeightFormat::detect()at the top ofSelf::create. - Dim 4 (device): CpuBackend / MetalBackend / CudaBackend — type
parameter
B, picked by the(device, kv_dtype)cascade below. - Dim 5 (kv dtype): KvFp16 / KvInt8 / KvFp8 — type parameter
K, same cascade. OnlyKvFp16is wired today;KvInt8lands in PR C (seedocs/dim5-model-wireup-plan.md).
Trait Implementations§
Source§impl ComponentFactory<Arc<dyn ModelExecutor + Send + Sync>> for LlmExecutorFactory
impl ComponentFactory<Arc<dyn ModelExecutor + Send + Sync>> for LlmExecutorFactory
Source§fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ComponentConfig,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ModelExecutor + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ComponentConfig,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ModelExecutor + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a component instance
Source§fn metadata(&self) -> ComponentMetadata
fn metadata(&self) -> ComponentMetadata
Get component metadata
Auto Trait Implementations§
impl Freeze for LlmExecutorFactory
impl RefUnwindSafe for LlmExecutorFactory
impl Send for LlmExecutorFactory
impl Sync for LlmExecutorFactory
impl Unpin for LlmExecutorFactory
impl UnsafeUnpin for LlmExecutorFactory
impl UnwindSafe for LlmExecutorFactory
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<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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 more