pub struct AxumServer { /* private fields */ }Expand description
Axum-based server implementation.
The server is built around AppState, which holds an optional
engine per modality. Handlers fault to 503 when the modality they
need isn’t loaded, instead of running stub error logic.
Implementations§
Source§impl AxumServer
impl AxumServer
Sourcepub fn from_state(state: AppState) -> Self
pub fn from_state(state: AppState) -> Self
Create a server with a fully populated AppState.
Sourcepub fn from_llm(engine: Arc<dyn LlmInferenceEngine + Send + Sync>) -> Self
pub fn from_llm(engine: Arc<dyn LlmInferenceEngine + Send + Sync>) -> Self
Convenience constructor for an LLM-only server (chat / completions).
Sourcepub fn from_embed(engine: Arc<dyn EmbedEngine + Send + Sync>) -> Self
pub fn from_embed(engine: Arc<dyn EmbedEngine + Send + Sync>) -> Self
Convenience constructor for an embedding-only server (/v1/embeddings).
Sourcepub fn from_transcribe(engine: Arc<dyn TranscribeEngine + Send + Sync>) -> Self
pub fn from_transcribe(engine: Arc<dyn TranscribeEngine + Send + Sync>) -> Self
Convenience constructor for a transcription-only server
(/v1/audio/transcriptions).
Sourcepub fn from_tts(engine: Arc<dyn TtsEngine + Send + Sync>) -> Self
pub fn from_tts(engine: Arc<dyn TtsEngine + Send + Sync>) -> Self
Convenience constructor for a TTS-only server (/v1/audio/speech).
Sourcepub fn with_auto_config(self, auto_config: ResolvedFerrumConfig) -> Self
pub fn with_auto_config(self, auto_config: ResolvedFerrumConfig) -> Self
Attach the startup auto-configuration decision trace exposed by
/health. Constructors keep this optional so tests and non-LLM
deployments can use the server without a model-specific resolver.
Sourcepub fn with_prompt_template(
self,
prompt_template: Option<ModelChatTemplate>,
) -> Self
pub fn with_prompt_template( self, prompt_template: Option<ModelChatTemplate>, ) -> Self
Attach the loaded model’s prompt template, if available. This keeps OpenAI request aliases from driving prompt-family selection.
Sourcepub fn with_lora_adapters(
self,
base_model_id: impl Into<String>,
adapters: Vec<LoraAdapterModel>,
) -> Self
pub fn with_lora_adapters( self, base_model_id: impl Into<String>, adapters: Vec<LoraAdapterModel>, ) -> Self
Attach startup-loaded LoRA adapter model ids.