ollama-kit
Runtime helpers for ollama-rs: configure a shared reqwest client (timeouts, auth), cap concurrent calls / retry transients, and optionally ensure a model exists locally. The Ollama client is exposed as-is—no mirrored generate/chat API.
Cargo.toml
= "0.1"
# optional: `ExecutionGuard::run_stream`, `OllamaRuntime::run_stream`
= { = "0.1", = ["stream"] }
What it gives you
| Piece | Role |
|---|---|
OllamaRuntime::new + RuntimeConfig |
Parses base_url, default ports, trailing path slash; rejects Production + auto_pull. |
client() |
&ollama_rs::Ollama — call generate, list_local_models, etc. unchanged. |
run / guard() |
Semaphore (max_concurrent), per-attempt timeout, max_retries; maps errors to RuntimeError. |
ensure_model / models() |
Lists tags; pulls only if Development and auto_pull. |
Outbound HTTP only: this crate does not start or supervise the Ollama binary.
Example
use Duration;
use ;
async
Docs
API reference: docs.rs/ollama-kit
MSRV / stability
Pinned ollama-rs patch in Cargo.toml; bump when you deliberately upgrade. Breaking changes follow semver starting from 0.1.
License
MIT — see LICENSE.