1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Ollama provider for the llm-stack SDK.
//!
//! This crate implements [`Provider`](llm_stack::Provider) for Ollama's
//! Chat API, supporting both non-streaming and streaming generation
//! with tool calling.
//!
//! Ollama runs locally and requires no authentication by default.
//!
//! # Quick start
//!
//! ```rust,no_run
//! use llm_stack_ollama::{OllamaConfig, OllamaProvider};
//! use llm_stack::{ChatMessage, ChatParams, Provider};
//!
//! # async fn example() -> Result<(), llm_stack::LlmError> {
//! let provider = OllamaProvider::new(OllamaConfig::default());
//!
//! let params = ChatParams {
//! messages: vec![ChatMessage::user("Hello!")],
//! ..Default::default()
//! };
//!
//! let response = provider.generate(¶ms).await?;
//! println!("{}", response.text().unwrap_or("no text"));
//! # Ok(())
//! # }
//! ```
pub use OllamaConfig;
pub use ;
pub use OllamaProvider;