Skip to content

Python v0.2.1 — Ollama Provider

Choose a tag to compare

@daiwanwei daiwanwei released this 15 Mar 13:37
· 305 commits to main since this release
892cd14

What's New

Added

  • Ollama provider (Provider.Ollama)
    • OpenAI-compatible endpoint (/v1/chat/completions) — zero new dependencies
    • Native OllamaProvider via POST /api/chat with NDJSON streaming
    • think mode for reasoning models (qwen3-thinking, deepseek-r1)
    • keep_alive / num_ctx configuration
    • Client.ollama(native=True) to switch between compat and native modes
    • Tool calls with auto-generated UUID when Ollama omits id
    • Default model: llama3.2

Install

pip install motosan-ai==0.2.1

Usage

from motosan_ai import Client

# OpenAI-compatible (default)
client = Client.ollama(model="llama3.2")

# Native with think mode
client = Client.ollama(model="qwen3", native=True, think=True)

response = await client.chat([{"role": "user", "content": "hello"}])