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 serveauto-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.0rc3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pylair_ollama-0.1.0rc3.tar.gz | 16.4 kB | With provenance | Details for pylair_ollama-0.1.0rc3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pylair_ollama-0.1.0rc3-py3-none-any.whl | Python 3 | none | any | Details for pylair_ollama-0.1.0rc3-py3-none-any.whl |
Total release size: 26.7 kB
Release files / pylair_ollama-0.1.0rc3.tar.gz
| Download URL | pylair_ollama-0.1.0rc3.tar.gz |
|---|---|
| Size | 16.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4eb41dad9d85c09920b496113819a8bdb049a5835befb9ce2f4e6729d5c2c193
|
|
BLAKE2b-256 checksum How to use checksums |
5adc11942ac765a898e195bd01080b175fe0b01da9f156b96b07e0d9096323e9
|
| 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 15, 2026.
Transparency logRelease files / pylair_ollama-0.1.0rc3-py3-none-any.whl
| Download URL | pylair_ollama-0.1.0rc3-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89dfcbc0d8827752bed1b9628749beba6a497ecf86804d831acbc6d535a49646
|
|
BLAKE2b-256 checksum How to use checksums |
1d0114ee3b0723a1543eaa412622b701cc488536fd5efd9c036b90bae3410134
|
| 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 15, 2026.
Transparency logSecurity for pylair-ollama 0.1.0rc3
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.
Attestation for pylair_ollama-0.1.0rc3.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 15, 2026.
Transparency logA 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.