Skip to main content

Modular audio model inference runtime with plugin architecture

Project description

VOCO Logo

VOCO

Modular audio inference runtime with plugin architecture.

Overview

Voco separates the core runtime from model implementations. Install only what you need, use a consistent API across different models.

Core concept: One interface for multiple TTS/audio models.

router = AudioRouter()
router.load("kokoro", alias="tts")
router.infer("tts", text="Hello world")

Switch models without changing your code:

router.load("other-model", alias="tts")  # Same interface
router.infer("tts", text="Hello world")

Install

# Core (lightweight, no dependencies)
pip install voco

# Install plugins you need
pip install voco-kokoro  # for Kokoro TTS

Usage

from voco.core import AudioRouter
import voco_kokoro

router = AudioRouter()
router.load("kokoro", alias="tts", device="cpu")

for result in router.infer("tts", text="Hello world", voice="af_heart"):
    audio = result.audio

How It Works

Voco separates the core runtime from model plugins:

  1. Core (voco): Router, caching, plugin loader - no heavy dependencies
  2. Plugins (voco-kokoro, voco-gtts, etc.): Each model is a separate package with its own dependencies

Load models dynamically at runtime:

router = AudioRouter()
router.load("kokoro", alias="tts")  # Loads voco-kokoro plugin
audio = router.infer("tts", text="Hello world")

Switch models without changing code:

router.load("gtts", alias="tts")  # Replace with Google TTS
audio = router.infer("tts", text="Hello world")  # Same interface

Features

  • Zero dependencies in core
  • Consistent API across models
  • Plugin architecture
  • Optional caching layer (experimental)
  • Type safe

Caching (Experimental)

Optional file-based cache for repeated inference calls.

router = AudioRouter(cache=True)

# First call generates and caches
audio = router.infer("tts", text="Hello world")

# Subsequent calls return cached result
audio = router.infer("tts", text="Hello world")

Configuration

router = AudioRouter(
    cache=True,
    cache_config={
        "max_size_mb": 500,           # Max cache size
        "ttl_seconds": 86400,         # Time to live (1 hour - 30 days)
        "warn_at_percent": 80,        # Warning threshold
    }
)

Management

router.cache.stats()              # View cache usage
router.cache.clear()              # Clear all cache
router.cache.clear(model="tts")   # Clear specific model

Per-Call Control

# Skip cache for specific call
audio = router.infer("tts", text="Hello", cache=False)

Notes

voco uses file-based cache and stored in ~/.voco/cache/. Keys are generated from model name, text, and parameters by default.

Useful for repeated phrases. Not recommended for unique text or privacy-sensitive content and realtime environments.

Plugins

Each plugin is a separate PyPI package with its own dependencies. Install only what you need.

Available Plugins

  • voco-kokoro - Kokoro TTS

Creating Plugins

Plugins register themselves via Python entry points. See CONTRIBUTING.md for the plugin development guide.

# Your plugin structure
voco-myplugin/
├── voco_myplugin/
   └── __init__.py  # Implements BaseAudioModel
└── pyproject.toml   # Defines entry point

Development

See CONTRIBUTING.md for detailed setup and plugin development guide.

git clone https://github.com/yourusername/voco.git
cd voco
pip install -e .
pip install -e plugins/voco-kokoro
python examples/generate_audio.py

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

voco-0.0.4.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

voco-0.0.4-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file voco-0.0.4.tar.gz.

File metadata

  • Download URL: voco-0.0.4.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for voco-0.0.4.tar.gz
Algorithm Hash digest
SHA256 c65337793c450fb91e880c4aeec4b4d7841c6a2d2de024e13e3d899922251e48
MD5 4e6d51d8adf6c2adcdd7d7119efb8142
BLAKE2b-256 520e9e433af4449022044a5a419d11b4f8e595fcc08a08e92493f0e266e2f010

See more details on using hashes here.

File details

Details for the file voco-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: voco-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for voco-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0086a67f97bc15f12b9a9f28d5f93b29e2f6b7d81bcbb6f9e21dcb15ba8ad435
MD5 a7ee588cf4d4f7aebb7c29def92418c5
BLAKE2b-256 d4e6c1a6b7ddc46df7ee6dcb87616c97736f592ba50838a363f41f5c9ccbfb44

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page