ollama-sdk

Crates.ioollama-sdk
lib.rsollama-sdk
version0.4.1
created_at2025-11-11 15:47:32.940162+00
updated_at2025-12-29 05:16:37.949054+00
descriptionAn idiomatic, unofficial Rust client for the Ollama API with support for streaming, tool calling, and custom transports.
homepage
repositoryhttps://github.com/Sathiyaraman-M/ollama-sdk
max_upload_size
id1927482
size143,823
Sathiyaraman M (Sathiyaraman-M)

documentation

README

Ollama-sdk

An idiomatic low-level Rust library for interacting with the Ollama API.

[!NOTE] This is not an official Ollama SDK.

[!WARNING] This library is currently in pre-alpha so don't use it in production. There are frequent breaking changes and the API is not stable.

Features

  • Idiomatic Rust API: Designed with Rust's best practices in mind.
  • Streaming Responses: Efficiently handle streaming responses from the Ollama API.
  • Configurable Transport: Uses reqwest by default, with an extensible Transport trait for custom implementations.
  • Robust Error Handling: Comprehensive error types for predictable error management.
  • Observability: Optional tracing for detailed logging and metrics for performance monitoring.

Installation

Add ollama-sdk to your Cargo.toml file:

[dependencies]
ollama-sdk = "0.4.1"

To enable optional features like tracing or metrics:

[dependencies]
ollama-sdk = { version = "0.4.1", features = ["tracing", "metrics"] }

Examples

[!TIP] Examples are present in the examples directory. You can run them using cargo run --example <example_name>.

Contributing

We welcome contributions! Please see our CONTRIBUTING.md for more details.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Commit count: 0

cargo fmt