Skip to content

Getting started

Start here after README.md when you want to confirm the package works, then choose either the lightweight remote path or local/offline engines.

Use docs/api.md for the supported integrator contract, docs/architecture.md for the implementation map, and docs/faq.md for cache/history reset and common troubleshooting.

Requirements

  • Python >=3.9 (see pyproject.toml)
  • OPENAI_API_KEY for VoiceManager() defaults or explicit remote REPL/web TTS
  • For microphone input: OS-level microphone permissions for your terminal/IDE

Install

pip install abstractvoice

The plain install is lightweight and remote/plugin oriented. For fully local inference, listening, Supertonic/Piper TTS, and cloning engines, install abstractvoice[apple] or abstractvoice[gpu], or compose granular extras such as abstractvoice[supertonic,stt,audio-io]. Optional extras are documented in docs/installation.md.

60-second smoke test (no mic required)

For a direct text-to-file TTS smoke test, run:

OPENAI_API_KEY=... abstractvoice \
  --provider openai \
  --model tts-1 \
  --voice alloy \
  --prompt "Hello from AbstractVoice." \
  --output hello.wav

This path writes the audio file and exits. It also accepts compatible remote audio servers (--provider openai-compatible --api http://localhost:8000/v1) and local providers selected through --tts-engine after the matching optional extra is installed.

Start the REPL:

abstractvoice --verbose

From a source checkout (without installing the console script), use:

python -m abstractvoice cli --verbose

In the REPL, run:

  • /speak hello (tests TTS without calling an LLM)

The interactive REPL default is --tts-engine auto: installed Supertonic first, installed Piper second, then OpenAI remote. A plain lightweight install starts on OpenAI; abstractvoice[all-apple] and abstractvoice[all-gpu] start on Supertonic. If the status line says openai (remote), set OPENAI_API_KEY or switch to a local engine.

For local voice generation, prefer Supertonic. For new voice clones, the default local cloning backend is OmniVoice; install abstractvoice[omnivoice] or a platform/full profile before using clone commands without --engine.

For local/offline TTS instead:

pip install "abstractvoice[supertonic]"
abstractvoice-prefetch --supertonic
abstractvoice --tts-engine supertonic --stt-engine faster_whisper --verbose

For the smaller Piper fallback:

pip install "abstractvoice[piper]"
abstractvoice-prefetch --piper en
abstractvoice --tts-engine piper --stt-engine faster_whisper --verbose

On a Mac with Apple silicon, transcribe on the Apple GPU with --stt-engine mlx-whisper (installed by abstractvoice[apple] or abstractvoice[stt-mlx]).

Natural voices with Qwen3-TTS

Qwen3-TTS gives more natural, expressive speech in ten languages, voice design from a written description, and the 70 built-in voices. On Apple silicon it runs on the Apple GPU through MLX and starts speaking in about a tenth of a second; elsewhere it runs on PyTorch (CUDA or CPU).

pip install "abstractvoice[qwen3-tts]"
python -m abstractvoice download --qwen3-tts Qwen/Qwen3-TTS-12Hz-1.7B-Base   # renders the built-in voices

# One file in a built-in voice, as one generation:
abstractvoice --voice fr-female-camille --prompt "Bonjour et bienvenue." --output camille.wav --one-shot

# In the REPL: list them, pick one, speak
abstractvoice --tts-engine supertonic
#   /voices clones
#   /voices clone en-gb-male-oliver
#   /speak Good evening.

The voice ids, their profiles and how they were made are in Built-in voices. For Qwen's preset speakers and voice design see Qwen3-TTS checkpoints.

Optional Browser Example

The local web UI is a small FastAPI example around VoiceManager: discussion read-through with separate assistant/user voices, text to WAV, audio-file transcription, and a tiny optional LLM dialogue panel for OpenAI-compatible local providers such as Ollama. It is not the production server surface; use AbstractCore Server for production OpenAI-compatible HTTP endpoints.

pip install "abstractvoice[web]"
abstractvoice web --port 5000

For a local web lab with Supertonic/faster-whisper:

pip install "abstractvoice[web,supertonic,stt]"
abstractvoice-prefetch --supertonic
abstractvoice web --port 5000 --tts-engine supertonic --stt-engine faster_whisper

For a remote OpenAI-compatible web smoke test:

abstractvoice web --port 5000 --tts-engine openai-compatible --stt-engine openai-compatible --remote-base-url http://localhost:8000/v1

If you want the browser UI and a smaller optional engine install, compose extras directly, such as abstractvoice[web,supertonic] or abstractvoice[web,omnivoice].

Then open http://127.0.0.1:5000.

The web example is offline-first by default. Its auto TTS default has the same interactive behavior as the REPL: installed Supertonic, installed Piper, then remote OpenAI. Prefetch models first, or start it with --allow-downloads when you explicitly want web requests to download missing models.

The settings column has four tabs:

  • Voice: the TTS provider and its preset voice, then the assistant and user voices. Their menus group the preset voice, your voices and the built-in voices, and Show voices that speak keeps the voices of one language. Switching providers resets the preset to that provider/language default. Selecting a cloned voice can take a while on first use because the cloning backend loads weights and builds prompt/runtime caches; the page shows a busy overlay meanwhile. The engine's model and Qwen3-TTS controls sit under Advanced.
  • Create voice: From a description creates a voice from words (Qwen3-TTS VoiceDesign; needs abstractvoice[qwen3-tts] and abstractvoice[stt]), and From a recording clones an uploaded or recorded sample, with its language. A new voice becomes the assistant voice at once. The recording path validates a new clone by synthesizing a short sample before reporting success; if an optional provider runtime cannot load, the stored clone is removed and the backend error is shown instead of leaving a broken voice in the selector.
  • Assistant: the page detects Ollama (http://localhost:11434) and LM Studio (http://localhost:1234), picks one that has models and fills the model list (embedding models are listed apart, as they cannot chat); Custom URL… takes any OpenAI-compatible server and Detect looks again. The browser remembers your choice. Then use Ask Assistant: the browser owns the short chat history and the example server forwards one /v1/chat/completions request.
  • Speech tools: speak a text, or transcribe a file.

Minimal library usage

from abstractvoice import VoiceManager

vm = VoiceManager()
vm.speak("Hello from AbstractVoice.")

This uses OpenAI remote audio and reads OPENAI_API_KEY. For local inference:

from abstractvoice import VoiceManager

vm = VoiceManager(tts_engine="supertonic", stt_engine="faster_whisper")
vm.speak("Hello from the local stack.")

For Supertonic fixed-profile local TTS, install abstractvoice[supertonic], prefetch with abstractvoice-prefetch --supertonic, and use VoiceManager(tts_engine="supertonic").

The public entry point is abstractvoice.VoiceManager (abstractvoice/voice_manager.py).

If you’re using AbstractVoice inside the AbstractFramework ecosystem, the intended architecture is:

  • AbstractCore runs agents and exposes OpenAI-compatible endpoints.
  • AbstractVoice is installed alongside it and provides TTS/STT as a capability backend plugin.

Pointers:

  • docs/api.md → “Integrations (AbstractFramework ecosystem)”
  • Capability plugin implementation: abstractvoice/integrations/abstractcore_plugin.py

If you’re integrating into the AbstractFramework ecosystem (AbstractCore / AbstractRuntime), see: - README.md (ecosystem overview) - docs/api.md (Integrations section; code pointers)

Minimal AbstractCore Server smoke test:

pip install "abstractcore[server]" abstractvoice
OPENAI_API_KEY=... python -m abstractcore.server.app

# TTS through AbstractCore + AbstractVoice
curl -X POST http://localhost:8000/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"input":"Hello from AbstractVoice through AbstractCore.","format":"wav"}' \
  --output hello.wav

# STT through AbstractCore + AbstractVoice
curl -X POST http://localhost:8000/v1/audio/transcriptions \
  -F "file=@hello.wav" \
  -F "language=en"

If the server is configured with ABSTRACTCORE_API_KEY, include Authorization: Bearer <key> in those requests.

ABSTRACTCORE_API_KEY is AbstractCore’s master key: when set, AbstractCore can use any preconfigured provider API keys. A specific provider key can still be overridden by also setting that provider’s explicit env var (for example OPENAI_API_KEY).

Enable microphone input (voice modes)

By default, the REPL does not start microphone capture. Enable it explicitly:

abstractvoice --voice-mode stop

From a source checkout:

python -m abstractvoice cli --voice-mode stop

Recommended modes (implemented in abstractvoice/vm/core.py and abstractvoice/recognition.py):

  • stop (recommended on speakers): keeps listening; during TTS it suppresses normal transcriptions but still lets you say “ok stop” to cut playback.
  • wait (strict turn-taking): pauses mic processing while speaking.
  • full (barge-in by speech): best with AEC or a headset; speakers can self-interrupt.

See docs/repl_guide.md for commands and docs/adr/0002_barge_in_interruption.md for rationale.

The REPL runs with allow_downloads=False, so prefetch explicitly:

abstractvoice-prefetch --stt small
abstractvoice-prefetch --piper en
abstractvoice-prefetch --supertonic

For cloning engines (optional / large), see docs/installation.md and docs/voices-and-licenses.md.

Current engine caveats, including AudioDiT direct TTS quality and OmniVoice profile stability, are tracked in docs/known-issues.md.

Clear local history or caches

Inside the REPL, /clear resets the LLM message history sent to the provider. /reset also resets active voice state. Saved memories only exist when you run /save <name>.

Terminal command history, cloned voices, and model caches live in separate local directories. The exact reset commands are in docs/faq.md.

Contributing / local development

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
python -m pytest -q

See also: CONTRIBUTING.md, SECURITY.md, and internal notes in docs/development.md.