Skip to main content

Module registry

Module registry 

Source
Expand description

Component registry for dynamic component creation

This module provides a registry pattern implementation that allows dynamic registration and lookup of component factories. The registry replaces hardcoded factory implementations with a flexible, extensible system that supports:

  • Dynamic component registration and discovery
  • Multiple implementations for each component type
  • Configuration-driven component selection
  • Easy testing with mock components

Structs§

ComponentConfig
Component configuration passed to factories
ComponentMetadata
Component metadata
ComponentRegistry
Global component registry for managing component factories
ContinuousBatchSchedulerFactory
Continuous batching scheduler factory
DefaultKvCacheFactory
Default KV cache factory
FifoSchedulerFactory
FIFO scheduler factory
GreedySampler
Common samplers Greedy sampler (always picks highest probability token)
GreedySamplerFactory
Greedy sampler factory
HuggingFaceTokenizerFactory
HuggingFace tokenizer factory
LlmExecutorFactory
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).
MultinomialSamplerFactory
Multinomial sampler factory
PagedKvCacheFactory
Paged KV cache factory (for PagedAttention)
PrioritySchedulerFactory
Priority scheduler factory
StubExecutorFactory
Stub executor factory
StubTokenizer
Stub tokenizer for testing
StubTokenizerFactory
Stub tokenizer factory for testing

Traits§

ComponentFactory
Factory trait for creating components

Functions§

global_registry
Get the global registry, initializing with defaults if needed
set_global_registry
Initialize global registry with a custom registry

Type Aliases§

CandleExecutorFactoryDeprecated
Back-compat alias; retained so external test fixtures referencing the old name continue to compile while we sweep call sites.