pub struct Orchestrator { /* private fields */ }Expand description
Orchestrator manages vLLM process lifecycle
Implementations§
Source§impl Orchestrator
impl Orchestrator
Sourcepub fn new(configs: HashMap<String, ModelConfig>) -> Self
pub fn new(configs: HashMap<String, ModelConfig>) -> Self
Create a new orchestrator with the given model configurations
Sourcepub fn with_command(
configs: HashMap<String, ModelConfig>,
vllm_command: String,
) -> Self
pub fn with_command( configs: HashMap<String, ModelConfig>, vllm_command: String, ) -> Self
Create a new orchestrator with a custom command for spawning processes
This is useful for testing with mock-vllm
Sourcepub fn with_options(
configs: HashMap<String, ModelConfig>,
vllm_command: String,
checkpoint_config: Option<CheckpointConfig>,
) -> Self
pub fn with_options( configs: HashMap<String, ModelConfig>, vllm_command: String, checkpoint_config: Option<CheckpointConfig>, ) -> Self
Create a new orchestrator with full options including checkpoint config
Sourcepub async fn process_state(&self, model: &str) -> Option<ProcessState>
pub async fn process_state(&self, model: &str) -> Option<ProcessState>
Get the current state of a model’s process
Sourcepub fn registered_models(&self) -> Vec<String>
pub fn registered_models(&self) -> Vec<String>
Get all registered model names
Sourcepub fn sleep_level_for(&self, model: &str) -> Option<u8>
pub fn sleep_level_for(&self, model: &str) -> Option<u8>
Get the configured sleep level for a model
Sourcepub async fn ensure_running(&self, model: &str) -> Result<(), OrchestratorError>
pub async fn ensure_running(&self, model: &str) -> Result<(), OrchestratorError>
Ensure a model’s process is running and ready
This will:
- Start the process if not started
- Wait for it to become healthy
- Return once the model is ready to serve requests
Sourcepub async fn wake_model(&self, model: &str) -> Result<(), OrchestratorError>
pub async fn wake_model(&self, model: &str) -> Result<(), OrchestratorError>
Wake a model from sleep
Sourcepub async fn sleep_model(
&self,
model: &str,
level: SleepLevel,
) -> Result<(), OrchestratorError>
pub async fn sleep_model( &self, model: &str, level: SleepLevel, ) -> Result<(), OrchestratorError>
Put a model to sleep
Sourcepub async fn force_sleep(&self, model: &str, level: SleepLevel)
pub async fn force_sleep(&self, model: &str, level: SleepLevel)
Force a model to sleep, escalating to Stop if the initial level fails.
This is a guaranteed-cleanup method: it logs errors but never returns Err.
Used to clean up partially-woken models that hold GPU memory.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Orchestrator
impl !RefUnwindSafe for Orchestrator
impl Send for Orchestrator
impl Sync for Orchestrator
impl Unpin for Orchestrator
impl !UnwindSafe for Orchestrator
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