Expand description
§laminae-ollama — Ollama Client for Local LLM Inference
Standalone HTTP client for Ollama. Supports both
blocking and streaming completions via the /api/chat endpoint.
Zero internal dependencies — this crate talks to a local Ollama instance and nothing else.
§Quick Start
use laminae_ollama::OllamaClient;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let client = OllamaClient::new();
if !client.is_available().await {
eprintln!("Ollama is not running — start it with `ollama serve`");
return Ok(());
}
let response = client.complete(
"llama3.2",
"You are a helpful assistant.",
"What is 2 + 2?",
0.7,
256,
).await?;
println!("{response}");
Ok(())
}Structs§
- Ollama
Client - Client for Ollama’s local LLM API.
- Ollama
Config - Configuration for creating an
OllamaClient.
Enums§
- Ollama
Error - Typed errors for the Ollama client.