6 releases (3 breaking)
| 0.4.0 | Apr 17, 2026 |
|---|---|
| 0.3.1 | Apr 15, 2026 |
| 0.2.0 | Apr 15, 2026 |
| 0.1.1 | Apr 12, 2026 |
#1576 in Asynchronous
73KB
1.5K
SLoC
ollama_client_rs
ollama_client_rs is a transport-focused Rust SDK for the Ollama API.
It provides:
- typed request and response models
- synchronous chat requests
- streaming chat requests
- embeddings
- model listing
- lightweight telemetry hooks
This crate does not own orchestration, planning, RAG, or tool-loop behavior. Those higher-level workflows should live in the application layer, such as RAIN.
Basic usage
use ollama_client_rs::{
types::{ChatRequest, Message},
OllamaClient,
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = OllamaClient::default();
let response = client
.chat(&ChatRequest {
model: "gemma4:latest".to_string(),
messages: vec![Message::user("Summarize this project in two sentences.")],
..Default::default()
})
.await?;
println!("{}", response.message.content.unwrap_or_default());
Ok(())
}
Position in the stack
- Use
ollama_client_rswhen you want a low-level SDK for Ollama. - Use RAIN when you want agentic execution, tool orchestration, retrieval, planning, or multi-step workflows.
Dependencies
~6–14MB
~217K SLoC