Skip to main content

ProviderCapacity

Struct ProviderCapacity 

Source
pub struct ProviderCapacity {
    pub max_concurrent_requests: u32,
    pub active_requests: u32,
    pub requests_per_second: u32,
    pub max_batch_size: u32,
    pub mtp_enabled: bool,
    pub drafter_vram_gb: Option<f32>,
    pub moe_holdings: Vec<MoeExpertHolding>,
    pub moe_roles: Vec<MoeProviderRole>,
    pub iroh_endpoint_id: Option<String>,
}
Expand description

Provider capacity information

Fields§

§max_concurrent_requests: u32

Maximum concurrent requests

§active_requests: u32

Current active requests

§requests_per_second: u32

Requests per second capacity

§max_batch_size: u32

Maximum batch size

§mtp_enabled: bool

Multi-Token Prediction availability. Set by the provider at tenzro_registerProvider time when their serving runtime has the target’s paired drafter co-loaded (HfModelEntry.drafter_id

  • mtp_kind == DraftMtp or Generic). When true, the InferenceRouter may route MTP-eligible requests preferentially to this provider; when false, it falls back to standard autoregressive providers.
§drafter_vram_gb: Option<f32>

VRAM headroom (GB) the provider has reserved for the speculative drafter alongside the target. Unsloth measures ~2 GB extra for Gemma 4 MTP heads. None means the provider hasn’t declared a drafter footprint, which is fine when mtp_enabled = false.

§moe_holdings: Vec<MoeExpertHolding>

MoE expert-shard declaration. When a provider can’t fit an entire MoE model (e.g. Qwen 3.5 397B-A17B) on its hardware, it can host a subset of expert weights and serve as one peer in a decentralized expert-parallel dispatch. Empty holdings means the provider does not participate in MoE expert serving for any model and is treated as a full-model replica only.

§moe_roles: Vec<MoeProviderRole>

MoE-pipeline role this provider plays. Replica is the default — the provider holds the full model and serves single-peer inference. Router provides the gating-network step and fans out batched expert calls. ExpertHolder participates in the expert-shard pool. PrefillDecode runs both phases co-located (the centralized SOTA default). Providers can declare more than one role; the router picks the matching role per request.

§iroh_endpoint_id: Option<String>

Iroh endpoint id of this provider. Used by the MoE router to dispatch batched expert calls over QUIC directly to the holder peer without going through the OpenAI-compatible HTTP endpoint. Required when moe_roles includes Router or ExpertHolder.

Implementations§

Source§

impl ProviderCapacity

Source

pub fn has_capacity(&self) -> bool

Checks if provider has capacity for a new request

Source

pub fn utilization(&self) -> u8

Returns the utilization percentage (0-100)

Trait Implementations§

Source§

impl Clone for ProviderCapacity

Source§

fn clone(&self) -> ProviderCapacity

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProviderCapacity

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProviderCapacity

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ProviderCapacity

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ProviderCapacity

Source§

fn eq(&self, other: &ProviderCapacity) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ProviderCapacity

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ProviderCapacity

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.