pub struct AppState {Show 13 fields
pub llm: Option<Arc<dyn LlmInferenceEngine + Send + Sync>>,
pub embed: Option<Arc<dyn EmbedEngine + Send + Sync>>,
pub transcribe: Option<Arc<dyn TranscribeEngine + Send + Sync>>,
pub tts: Option<Arc<dyn TtsEngine + Send + Sync>>,
pub auto_config: Option<ResolvedFerrumConfig>,
pub prompt_template: Option<Arc<ModelChatTemplate>>,
pub default_enable_thinking: Option<bool>,
pub served_model_registry: Arc<ServedModelRegistry>,
pub request_dump_dir: Option<Arc<PathBuf>>,
pub profile_jsonl: Option<Arc<PathBuf>>,
pub profile_detail: ObservabilityProfileDetail,
pub memory_profile_jsonl: Option<Arc<PathBuf>>,
pub first_request_memory_recorded: Arc<AtomicBool>,
/* private fields */
}Expand description
Application state shared across handlers — one optional engine per modality. Handlers reach into the field they need and 503 when it’s not loaded.
Fields§
§llm: Option<Arc<dyn LlmInferenceEngine + Send + Sync>>§embed: Option<Arc<dyn EmbedEngine + Send + Sync>>§transcribe: Option<Arc<dyn TranscribeEngine + Send + Sync>>§tts: Option<Arc<dyn TtsEngine + Send + Sync>>§auto_config: Option<ResolvedFerrumConfig>§prompt_template: Option<Arc<ModelChatTemplate>>§default_enable_thinking: Option<bool>§served_model_registry: Arc<ServedModelRegistry>§request_dump_dir: Option<Arc<PathBuf>>§profile_jsonl: Option<Arc<PathBuf>>§profile_detail: ObservabilityProfileDetail§memory_profile_jsonl: Option<Arc<PathBuf>>§first_request_memory_recorded: Arc<AtomicBool>Implementations§
Source§impl AppState
impl AppState
pub fn with_llm(self, engine: Arc<dyn LlmInferenceEngine + Send + Sync>) -> Self
pub fn with_embed(self, engine: Arc<dyn EmbedEngine + Send + Sync>) -> Self
pub fn with_transcribe( self, engine: Arc<dyn TranscribeEngine + Send + Sync>, ) -> Self
pub fn with_tts(self, engine: Arc<dyn TtsEngine + Send + Sync>) -> Self
pub fn with_auto_config(self, auto_config: ResolvedFerrumConfig) -> Self
pub fn with_prompt_template( self, prompt_template: Option<ModelChatTemplate>, ) -> Self
pub fn with_default_enable_thinking(self, enable_thinking: Option<bool>) -> Self
pub fn with_interleaved_system_coalescing(self, enabled: bool) -> Self
pub fn with_served_model_registry(self, registry: ServedModelRegistry) -> Self
pub fn with_request_dump_dir(self, request_dump_dir: Option<PathBuf>) -> Self
pub fn with_profile_jsonl(self, profile_jsonl: Option<PathBuf>) -> Self
pub fn with_profile_detail( self, profile_detail: ObservabilityProfileDetail, ) -> Self
pub fn with_memory_profile_jsonl( self, memory_profile_jsonl: Option<PathBuf>, ) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AppState
impl !UnwindSafe for AppState
impl Freeze for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
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