Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.0rc3 instead.

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.0rc1

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.0rc1
File Size Uploaded Provenance Actions
pylair_ollama-0.1.0rc1.tar.gz 15.3 kB With provenance Details for pylair_ollama-0.1.0rc1.tar.gz

Built distribution (wheel)

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

Total release size: 24.8 kB

Release files / pylair_ollama-0.1.0rc1.tar.gz

Download URL pylair_ollama-0.1.0rc1.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
87f1caa5d8f88a6b57a850ce8a670c22ab2b69764722452806aa18ae43e85094
BLAKE2b-256 checksum
How to use checksums
efbf800287afad3766b443f910b7dcd26158db903d2381e14f5325b8cd3ac911
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.0rc1-py3-none-any.whl

Download URL pylair_ollama-0.1.0rc1-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a64149fbd78d347cfcffa67db584017cd502112e014190b4fd4e8483c898591d
BLAKE2b-256 checksum
How to use checksums
882721bd00e7342752a9f20df5ed2053c4fdeb542791a5d9681002f295664a2d
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.0rc1

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.0rc1.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