Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pylair-ollama

Optional Ollama integration (M5) — never a dependency of Pylair core.

Apps opt in by depending on pylair-ollama and @expose-ing the helpers themselves; detection, status, and streaming then ride the normal bridge — including pull-credit backpressure and task cancellation (cancelling a stream aborts the HTTP request mid-token).

from collections.abc import AsyncIterator

from pylair import expose
from pylair_ollama import Message, OllamaStatus, chat, pull, status


@expose
async def ollama_status() -> OllamaStatus:
    """installed / running / version / models — for the app's UI."""
    return await status()


@expose
async def ask(prompt: str, model: str = "qwen3:8b") -> AsyncIterator[str]:
    """Token-by-token through the bridge; cancel from the UI aborts the
    Ollama request mid-stream."""
    async for tok in chat(model, [Message(role="user", content=prompt)]):
        yield tok


@expose
async def pull_model(model: str) -> AsyncIterator[dict]:
    """First-run UX: stream download progress to the UI."""
    async for ev in pull(model):
        yield ev

pylair codegen types OllamaStatus/Message automatically, so the UI gets typed stubs for free.

What it reports

status() never raises: installed (binary on PATH), running (API responds), version, models, error with a plain-language message ("Ollama is not running — start it with ollama serve").

chat / pull raise OllamaError with UI-ready messages; unreachable host → "Ollama is not running", API error → "Ollama error N: ".

Out of scope (deliberate)

  • Bundling an inference runtime — Ollama stays an external dependency the user installs (brief §12 open question 4). pull() covers the "model not downloaded yet" UX without shipping llama.cpp.
  • ollama serve auto-start: status() reports it; the app decides.
  • Embeddings/images/tool-call structured output: the wire shapes are there when an app needs them; this package stays small.

Pylair builds on Tauri but is not affiliated with or endorsed by the Tauri project.

License: MIT OR Apache-2.0.

Metadata

Release files for pylair-ollama 0.1.0rc2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylair-ollama 0.1.0rc2
File Size Uploaded Provenance Actions
pylair_ollama-0.1.0rc2.tar.gz 15.3 kB With provenance Details for pylair_ollama-0.1.0rc2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pylair-ollama 0.1.0rc2
File Interpreter ABI Platform Actions
pylair_ollama-0.1.0rc2-py3-none-any.whl Python 3 none any Details for pylair_ollama-0.1.0rc2-py3-none-any.whl

Total release size: 24.9 kB

Release files / pylair_ollama-0.1.0rc2.tar.gz

Download URL pylair_ollama-0.1.0rc2.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1e9c1012a8064521b16ee351e8e02c68ae5c83594c7788d12ba50bf7241b7789
BLAKE2b-256 checksum
How to use checksums
8fe9a3d25fa86dc94f92fc135f4dceb84f32db7f2f94c89360c976680784c3ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / pylair_ollama-0.1.0rc2-py3-none-any.whl

Download URL pylair_ollama-0.1.0rc2-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57ce10b81545c5b75a21b8116c802d3bfb3f83b2401ec099d9098cda4d53405b
BLAKE2b-256 checksum
How to use checksums
a1ac7dea6113181b912b5ca23db74027d17daafb648c6db66d8bdc215651e33f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for pylair-ollama 0.1.0rc2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pylair_ollama-0.1.0rc2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page