Ollama provider for chat-rs.
Thin wrapper around [chat_completions] — Ollama serves an
OpenAI-compatible /v1/chat/completions endpoint, so all chat,
streaming, tools, structured output, and embedding logic lives in the
chat-completions crate.
What this crate adds on top:
- Default base URL pointing at the local daemon
OLLAMA_HOSTenv var support- [
OllamaBuilder::pull] to ensure the model is present before the first request, hitting Ollama's native/api/pull. Returns the builder so it slots into the normal chain.
# async fn run() -> Result<(), Box<dyn std::error::Error>> {
use chat_ollama::OllamaBuilder;
let client = OllamaBuilder::new()
.with_model("llama3.2")
.pull().await?
.build();
# Ok(()) }