pub struct OllamaRuntime { /* private fields */ }Expand description
Coordinates a shared Ollama client, model lifecycle helpers, and execution guards.
Implementations§
Source§impl OllamaRuntime
impl OllamaRuntime
Sourcepub async fn new(config: RuntimeConfig) -> Result<Self>
pub async fn new(config: RuntimeConfig) -> Result<Self>
Validates config, builds an HTTP client (timeouts + optional auth), then constructs
Ollama via Ollama::new_with_client.
pub fn client(&self) -> &Ollama
pub fn guard(&self) -> &ExecutionGuard
pub fn models(&self) -> &ModelManager
Sourcepub async fn ensure_model(&self, model: &str) -> Result<()>
pub async fn ensure_model(&self, model: &str) -> Result<()>
Shortcut for ModelManager::ensure. Equivalent to self.models().ensure(model).await.
Sourcepub async fn run<F, Fut, T>(&self, f: F) -> Result<T>
pub async fn run<F, Fut, T>(&self, f: F) -> Result<T>
Shortcut for ExecutionGuard::run. Equivalent to self.guard().run(f).await.
Prefer this at call sites when you only need guarded execution once; keep using
Self::guard when you want a reusable handle (for example attaching metrics to the
guard or holding ExecutionGuard::max_retries in scope).
Auto Trait Implementations§
impl Freeze for OllamaRuntime
impl !RefUnwindSafe for OllamaRuntime
impl Send for OllamaRuntime
impl Sync for OllamaRuntime
impl Unpin for OllamaRuntime
impl UnsafeUnpin for OllamaRuntime
impl !UnwindSafe for OllamaRuntime
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