pub struct InferRuntime { /* private fields */ }Expand description
The adapter.
Implementations§
Source§impl InferRuntime
impl InferRuntime
Sourcepub async fn reset_restarts(&self, h: &InstanceHandle)
pub async fn reset_restarts(&self, h: &InstanceHandle)
Give a managed instance a fresh restart budget. Only an explicit operator start calls this: an automatic restart or drive never does, so a server that keeps dying stays given up.
Sourcepub async fn restart(
&self,
h: &InstanceHandle,
grace: Duration,
) -> Result<(), RuntimeError>
pub async fn restart( &self, h: &InstanceHandle, grace: Duration, ) -> Result<(), RuntimeError>
Stop (when running) then start again.
Sourcepub async fn reconcile(
&self,
h: &InstanceHandle,
) -> Result<Reconcile, RuntimeError>
pub async fn reconcile( &self, h: &InstanceHandle, ) -> Result<Reconcile, RuntimeError>
Restart a managed server that died while it should be running, under the configured backoff and budget, and stop one found listening beyond loopback. Meant to be called on a timer; each call does at most one restart.
Source§impl InferRuntime
impl InferRuntime
Sourcepub fn new(cfg: InferConfig) -> Self
pub fn new(cfg: InferConfig) -> Self
A new adapter. It claims no capabilities until
probe_capabilities has run.
Sourcepub async fn probe_capabilities(&self) -> Vec<Capability>
pub async fn probe_capabilities(&self) -> Vec<Capability>
Check the runtime is there and refresh what provides() returns.
Source§impl InferRuntime
impl InferRuntime
Sourcepub async fn health(
&self,
h: &InstanceHandle,
) -> Result<ServerReport, RuntimeError>
pub async fn health( &self, h: &InstanceHandle, ) -> Result<ServerReport, RuntimeError>
Full probe of an instance’s server.
Sourcepub async fn endpoint(&self, h: &InstanceHandle) -> Option<String>
pub async fn endpoint(&self, h: &InstanceHandle) -> Option<String>
Base URL of an instance (http://127.0.0.1:<port>): what the
stable-address proxy forwards to.
Sourcepub async fn served_model(&self, h: &InstanceHandle) -> Option<String>
pub async fn served_model(&self, h: &InstanceHandle) -> Option<String>
The model id the server itself knows the instance by (the Ollama tag, the registry name for a launched server, the spec’s model when adopted). The mesh-serving side pins requests to it.
Sourcepub async fn spec_of(&self, h: &InstanceHandle) -> Option<InferenceSpec>
pub async fn spec_of(&self, h: &InstanceHandle) -> Option<InferenceSpec>
The spec of a loaded instance.
Sourcepub async fn deep_health(&self, h: &InstanceHandle) -> Result<(), RuntimeError>
pub async fn deep_health(&self, h: &InstanceHandle) -> Result<(), RuntimeError>
Health plus one real token (ADR-101: “a tiny completion succeeds”).
Costs compute, so it is separate from status.
Trait Implementations§
Source§impl WorkloadRuntime for InferRuntime
impl WorkloadRuntime for InferRuntime
Source§fn network_exposure(&self) -> NetworkPolicy
fn network_exposure(&self) -> NetworkPolicy
A managed server binds loopback only (a wider bind is refused at
validation). An adopted server’s own binding cannot be observed
from here (the model lab starts its servers with --host 0.0.0.0),
so it is reported as LAN-reachable rather than assumed private.
Source§fn provides(&self) -> Vec<Capability>
fn provides(&self) -> Vec<Capability>
Source§fn admit<'life0, 'life1, 'async_trait>(
&'life0 self,
w: &'life1 VerifiedWorkload,
) -> Pin<Box<dyn Future<Output = Result<Admission, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn admit<'life0, 'life1, 'async_trait>(
&'life0 self,
w: &'life1 VerifiedWorkload,
) -> Pin<Box<dyn Future<Output = Result<Admission, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
w? Reserves nothing it cannot undo.Source§fn load<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
w: &'life1 VerifiedWorkload,
cfg: &'life2 WorkloadConfig,
) -> Pin<Box<dyn Future<Output = Result<InstanceHandle, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn load<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
w: &'life1 VerifiedWorkload,
cfg: &'life2 WorkloadConfig,
) -> Pin<Box<dyn Future<Output = Result<InstanceHandle, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn start<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
grace: Duration,
) -> Pin<Box<dyn Future<Output = Result<RunEvidence, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
grace: Duration,
) -> Pin<Box<dyn Future<Output = Result<RunEvidence, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
grace) and return evidence.Source§fn unload<'life0, 'async_trait>(
&'life0 self,
h: InstanceHandle,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unload<'life0, 'async_trait>(
&'life0 self,
h: InstanceHandle,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn status<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = InstanceStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn status<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = InstanceStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn control_mode(&self) -> ControlMode
fn control_mode(&self) -> ControlMode
Source§fn adopt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
w: &'life2 VerifiedWorkload,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn adopt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
w: &'life2 VerifiedWorkload,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
stop / unload work again; it starts and
changes nothing on the device.Source§fn console<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
_c: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<RunEvidence, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn console<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
_c: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<RunEvidence, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
[console] limits apply). command must be
one of the cog’s [console].allowed_commands.Source§fn staged_payload<'life0, 'life1, 'async_trait>(
&'life0 self,
_h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = Option<PathBuf>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn staged_payload<'life0, 'life1, 'async_trait>(
&'life0 self,
_h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = Option<PathBuf>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
None:
not run from a file this node can read (a container image is tagged
by the binary’s BLAKE3; a remote device holds its own copy).Source§fn link_security(&self) -> LinkSecurity
fn link_security(&self) -> LinkSecurity
Pinned.Source§fn console_preemptions<'life0, 'life1, 'async_trait>(
&'life0 self,
_h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = Result<Vec<Preemption>, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn console_preemptions<'life0, 'life1, 'async_trait>(
&'life0 self,
_h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = Result<Vec<Preemption>, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
h. The host
gates each one as workload.stop before calling Self::preempt.Auto Trait Implementations§
impl !Freeze for InferRuntime
impl !RefUnwindSafe for InferRuntime
impl !UnwindSafe for InferRuntime
impl Send for InferRuntime
impl Sync for InferRuntime
impl Unpin for InferRuntime
impl UnsafeUnpin for InferRuntime
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more