Skip to main content

Orchestrator

Struct Orchestrator 

Source
pub struct Orchestrator { /* private fields */ }
Expand description

Orchestrator manages vLLM process lifecycle

Implementations§

Source§

impl Orchestrator

Source

pub fn new(configs: HashMap<String, ModelConfig>) -> Self

Create a new orchestrator with the given model configurations

Source

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

Source

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

Source

pub async fn process_state(&self, model: &str) -> Option<ProcessState>

Get the current state of a model’s process

Source

pub fn registered_models(&self) -> Vec<String>

Get all registered model names

Source

pub fn model_port(&self, model: &str) -> Option<u16>

Get the configured port for a model

Source

pub fn model_path(&self, model: &str) -> Option<String>

Get the configured model path (HuggingFace ID or local path) for a model

Source

pub fn eviction_policy_for(&self, model: &str) -> Option<EvictionPolicy>

Get the effective eviction policy for a model (override > config)

Source

pub fn is_checkpointed(&self, model: &str) -> bool

Check if a model is currently in the Checkpointed state

Source

pub fn set_eviction_policy(&self, model: &str, policy: EvictionPolicy)

Override the eviction policy for a model at runtime

Source

pub async fn ensure_running(&self, model: &str) -> Result<(), OrchestratorError>

Ensure a model’s process is running and ready

This will:

  1. Start the process if not started
  2. Wait for it to become healthy
  3. Return once the model is ready to serve requests
Source

pub async fn wake_model(&self, model: &str) -> Result<(), OrchestratorError>

Wake a model from sleep

Source

pub async fn set_checkpointed( &self, model: &str, images_dir: PathBuf, eviction: EvictionPolicy, ) -> Result<(), OrchestratorError>

Put a model to sleep using the given eviction policy. Set a model’s state to Checkpointed (for CLI –restore-detached and checkpoint_path config).

Used to indicate a pre-existing checkpoint on disk so that wake_model will run CRIU restore instead of starting fresh.

Source

pub async fn sleep_model( &self, model: &str, eviction: EvictionPolicy, ) -> Result<(), OrchestratorError>

The sleep sequence is:

  1. Apply weight strategy (vLLM sleep API if Offload/Discard)
  2. Apply process strategy (CudaSuspend, Checkpoint, Stop, or KeepRunning)
Source

pub async fn force_sleep(&self, model: &str, eviction: EvictionPolicy)

Force a model to sleep, escalating to Stop if the initial policy 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.

Source

pub async fn is_ready(&self, model: &str) -> bool

Check if a model is ready

Trait Implementations§

Source§

impl Drop for Orchestrator

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more