Skip to main content

🗣️ ollama-speak (ospeak)

PyPI version License: MIT Python 3.9+ Ollama 100% Local AI

100% Local, Offline Multilingual Neural Text-to-Speech CLI for Ollama (Kokoro-82M and Piper ONNX).

ollama-speak (ospeak) is a standalone, sovereign voice engine built specifically for the local AI and Ollama community. It runs 100% locally on your own machine using open-weights models:

  • Kokoro-82M (Default): Apache 2.0 open-weight 82M-parameter neural model providing studio-grade broadcast speech.
  • Piper TTS (Ultra-lightweight): Fast ONNX neural voice engine designed to run with sub-100ms latency even on low-spec hardware or a Raspberry Pi.

Zero cloud API calls, zero telemetry, zero corporate tracking, and zero accounts. Once local weights are downloaded, ollama-speak works completely with your internet disconnected.


💻 Minimum System and Hardware Requirements

ollama-speak is designed to run smoothly across consumer laptops, older desktop PCs, MacBooks, and high-performance workstations.

Hardware Requirements Table

Component Piper ONNX (Ultra-Lightweight) Kokoro-82M (Studio Quality Default)
CPU Any 64-bit CPU (Intel, AMD, ARM64 / Apple Silicon, Raspberry Pi 4/5) Modern multi-core CPU (AVX2 recommended) or Apple Silicon M1–M4
GPU (Optional) Not needed (pure CPU ONNX) Accelerated on CUDA / ROCm / Metal, runs easily on CPU
System RAM 1 GB minimum (uses ~80 MB during inference) 2 GB to 4 GB RAM (uses ~350 MB during inference)
Disk Space ~35 MB for voice model ~350 MB for open-weight model checkpoint
Audio System Standard OS sound (ALSA, PulseAudio, PipeWire, CoreAudio, WASAPI) Standard OS sound
Internet Only required once for initial model download Only required once for initial model download

Supported Operating Systems

  • Linux: Ubuntu 20.04+, Debian 11+, Fedora 38+, Arch Linux, DGX OS (x86_64 and ARM64).
  • macOS: macOS 11 (Big Sur) and newer (Intel and Apple Silicon M1/M2/M3/M4). Uses native afplay.
  • Windows: Windows 10 & 11 (64-bit), Python 3.9–3.14 (PyTorch Kokoro on Python 3.10–3.12, Kokoro ONNX on Python 3.13, Piper ONNX across all versions). Uses native winsound / PowerShell audio backend.

✨ Features

  • 100% Sovereign and Offline: No queries leave your computer. Never sends your text to Microsoft, Google, Bing, or any remote server.
  • Dual Local Engine Architecture:
    • Kokoro-82M: Deeply expressive, human-like voice with natural breath pacing and emotional cadence.
    • Piper ONNX: Blazing fast sub-100ms latency for real-time voice assistants.
  • Self-Contained Model Downloader: Run ollama-speak --setup to pre-download open weights once, or let it fetch them on first run. Once cached, it runs offline indefinitely.
  • Zero-Swallow Pipe Echo: When piping text from any command (ollama run llama3 "..." | ollama-speak), it mirrors text directly to your terminal so your transcript remains visible and copy-pasteable.
  • Native Pairing with ollama-web: Run ollama-web --speak "your question" or pipe ollama-web "your question" | ollama-speak for live terminal text plus local voice playback.
  • Native Cross-Platform Playback: Automatically utilizes local audio players (pw-play, paplay, mpv, ffplay, afplay on macOS, PowerShell on Windows).

🚀 Installation

ollama-speak is published to the official Python Package Index (PyPI). You can install it directly into any active Python environment:

pip install --upgrade ollama-speak

Or install in an isolated global CLI environment using pipx (recommended by the Python Packaging Authority for standalone command line utilities):

pipx install ollama-speak

To install with optional Piper ONNX support:

pip install --upgrade "ollama-speak[all]"

Option 2 — One-Line Turnkey Installer (Zero Configuration)

Works automatically on fresh Linux, macOS, and WSL systems without requiring manual virtual environments or encountering PEP 668 system python locks.

Linux and macOS:

curl -fsSL https://raw.githubusercontent.com/AjarnSpencer/ollama-speak/main/install.sh | bash

Windows (PowerShell):

irm https://raw.githubusercontent.com/AjarnSpencer/ollama-speak/main/install.ps1 | iex

What the turnkey installer does:

  • Sets up an isolated virtual environment in ~/.local/share/ollama-speak/venv (zero system conflicts).
  • Symlinks ollama-speak and ospeak launchers into ~/.local/bin/.
  • Configures user PATH if not already set.
  • Automatically pre-downloads local model weights so it works offline immediately.

Option 3 — Install from GitHub

pip install git+https://github.com/AjarnSpencer/ollama-speak.git

Or clone and run locally:

git clone https://github.com/AjarnSpencer/ollama-speak.git
cd ollama-speak
./install.sh

Pre-Download Local Models for 100% Offline Use

ollama-speak --setup

This downloads and caches the Kokoro-82M and Piper open weights into your local user directory. After this step, you can disconnect your computer from the internet completely.


📦 PyPI Package Information (For Maintainers)

  • PyPI Release: https://pypi.org/project/ollama-speak/
  • Release Automation: Pushing a version tag (e.g. git tag v1.1.1 && git push origin v1.1.1) automatically triggers GitHub Actions (.github/workflows/release.yml) to build and publish updates to PyPI.

📖 Command Line Reference and Flags

ollama-speak can be invoked as either ollama-speak or ospeak.

Flag Short Default Description
text STDIN Text string to speak aloud (reads from STDIN pipe if omitted)
--engine ENGINE -e kokoro Local TTS engine: kokoro (studio quality) or piper (ultra-fast ONNX)
--kokoro Shortcut for --engine kokoro
--piper Shortcut for --engine piper
--voice VOICE -v bm_george Select specific local voice (e.g. bm_george, af_heart, bf_alice)
--output FILE -o None Save spoken audio to a local WAV/MP3/OGG/FLAC file instead of playing (.mp3 uses ffmpeg)
--setup --download-models Pre-download all local weights for 100% offline use
--list-voices List all available local open-weight voices and aliases
--version -V Print installed ollama-speak version
-h, --help Show full help manual and flags

🎙️ Supported Local Open-Weight Voices

Run ollama-speak --list-voices to see all local voices:

Voice Name Language Gender / Style Engine
bm_george (Default) British English Male (Warm Baritone) Kokoro-82M
bm_lewis British English Male Kokoro-82M
bf_alice British English Female Kokoro-82M
af_heart American English Female (Warm) Kokoro-82M
am_adam American English Male Kokoro-82M
jf_tebukuro Japanese Female Kokoro-82M
zf_xiaobei Mandarin Chinese Female Kokoro-82M
ef_dora Spanish Female Kokoro-82M
ff_siwis French Female Kokoro-82M
if_sara Italian Female Kokoro-82M
pf_dora Portuguese Female Kokoro-82M
hf_alpha Hindi Female Kokoro-82M
piper British English Clear / Fast ONNX Piper

💡 Practical Tutorials and Workflows

Tutorial 1 — Direct Local Text Narration

Speak any text locally using your default Kokoro voice:

ollama-speak "All local systems are operational and running completely offline."

Tutorial 2 — Zero-Swallow Piped Input from Local Ollama

Pipe output from any local Ollama model directly into ollama-speak. The text prints on screen in real-time, and local voice speaks the answer:

ollama run llama3 "Explain quantum computing in two sentences" | ollama-speak

Tutorial 3 — Fast Piper ONNX for Low-Spec PCs

If you are running on a Raspberry Pi or low-spec laptop, pass --piper for ultra-fast, lightweight inference:

ollama run llama3 "Give me one piece of life advice" | ollama-speak --piper

Tutorial 4 — Changing Local Voices

Choose between different genders, accents, and languages:

# American Female (Kokoro-82M):
ollama-speak -v af_heart "Welcome to the future of sovereign, local artificial intelligence."

# British Female (Kokoro-82M):
ollama-speak -v bf_alice "It is a pleasure to assist you today."

Tutorial 5 — Exporting Audio to File

Save the synthesized speech directly to a standard audio file:

ollama-speak -o ~/Music/summary.wav "Your daily briefing has been saved locally."

🔒 100% Offline and Sovereign Guarantee

  • No Remote Servers: Text is synthesized entirely inside your computer's RAM using open-weights models.
  • No Cloud Fallbacks: It will never silently phone home to Microsoft, Bing, Google, or any cloud API.
  • No API Keys or Subscriptions: You own your hardware, and you own your voice assistant.

📄 License

This project is licensed under the MIT License. Kokoro-82M model weights are released under the Apache 2.0 License. Piper TTS is released under the MIT License.

Metadata

Release files for ollama-speak 1.2.1

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

Source distribution (sdist)

Source distribution for ollama-speak 1.2.1
File Size Uploaded Provenance Actions
ollama_speak-1.2.1.tar.gz 19.0 kB With provenance Details for ollama_speak-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ollama-speak 1.2.1
File Interpreter ABI Platform Actions
ollama_speak-1.2.1-py3-none-any.whl Python 3 none any Details for ollama_speak-1.2.1-py3-none-any.whl

Total release size: 34.7 kB

Release files / ollama_speak-1.2.1.tar.gz

Download URL ollama_speak-1.2.1.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8fbc81d8ce3e7ce70630ea87bcefd385d4434eaa9bcd19c27fcae20d04b945cb
BLAKE2b-256 checksum
How to use checksums
dd4f4702758bc1662e281c2776b827e1aedd3a2c8b56ac1e779187db0690cfd5
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 22, 2026.

Transparency log

Release files / ollama_speak-1.2.1-py3-none-any.whl

Download URL ollama_speak-1.2.1-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c101c2949412aff1dc70c83af42e024a15c0810d87b90f36001ef1cbf3d3c449
BLAKE2b-256 checksum
How to use checksums
e619d10e4613a857877cc380a68d97f5b5063673cf679998af8e5c1ef8e5a09f
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 22, 2026.

Transparency log

Security for ollama-speak 1.2.1

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 ollama_speak-1.2.1.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 22, 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