ollama-oxide

Crates.ioollama-oxide
lib.rsollama-oxide
version0.0.1
created_at2026-01-12 20:30:02.238374+00
updated_at2026-01-12 20:30:02.238374+00
descriptionA Rust library for integrating with Ollama's native API, providing low-level primitives and high-level conveniences.
homepage
repositoryhttps://github.com/franciscotbjr/ollama-oxide
max_upload_size
id2038807
size49,309
Francisco (franciscotbjr)

documentation

README

ollama-oxide

ollama-oxide Logo

A Rust library providing low-level primitives and high-level conveniences for integrating with Ollama's native API.

Llama in the crate

Features

  • Low-level primitives for direct Ollama API interaction
  • High-level conveniences (optional) for common use cases
  • Async/await support with Tokio runtime
  • Type-safe API bindings generated from OpenAPI specs
  • Comprehensive error handling
  • HTTP/2 support via reqwest
  • Feature flags for modular dependencies

Architecture

Single-crate design with modular structure:

ollama-oxide/
└── src/
    ├── lib.rs           # Main library entry point
    ├── primitives/      # Low-level API primitives (default)
    ├── http/            # HTTP client layer (default)
    └── conveniences/    # High-level APIs (optional)

Feature Flags:

  • default = ["http", "primitives"] - Core functionality
  • conveniences - Optional ergonomic high-level APIs

Installation

Add this to your Cargo.toml:

# Default features (primitives + http)
[dependencies]
ollama-oxide = "0.1.0"

# With high-level conveniences
[dependencies]
ollama-oxide = { version = "0.1.0", features = ["conveniences"] }

Quick Start

#[tokio::main]
fn main() -> Result<(), Box<dyn std::error::Error>> {
    todo!("Working ");
}

Requirements

  • Rust 1.75+ (edition 2024)
  • Ollama running locally or accessible via network

Development

Building

cargo build

Running Tests

cargo test

Running Examples

cargo run --example basic_generation

API Documentation

The library follows Ollama's OpenAPI specifications (see spec/primitives/).

12 Total Endpoints:

  • 5 Simple endpoints (version, tags, ps, copy, delete)
  • 2 Medium complexity (show, embed)
  • 5 Complex with streaming (generate, chat, create, pull, push)

See spec/api-analysis.md for detailed endpoint documentation.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

License

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

Acknowledgments

Based on Ollama's official libraries and API specifications.

Links

Commit count: 47

cargo fmt