Metadata-Version: 2.5
Name: local-tts-studio
Version: 1.0.0
Summary: Local Piper text-to-speech studio: single-port web UI + REST + OpenAI-compatible speech API
Project-URL: Homepage, https://github.com/MythGrams/mythgram-agent/tree/main/packages/local-tts
Project-URL: Issues, https://github.com/MythGrams/mythgram-agent/issues
Author: mythgram
License-Expression: MIT
License-File: LICENSE
Keywords: audio,local,openai,piper,speech,tts,voice
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Requires-Python: >=3.10
Requires-Dist: fastapi>=0.115
Requires-Dist: psutil>=6.1
Requires-Dist: uvicorn>=0.34
Provides-Extra: cuda
Requires-Dist: onnxruntime-gpu; extra == 'cuda'
Description-Content-Type: text/markdown

# local-tts-studio

Local Piper **text-to-speech** studio, shipped as a single pip package. One
command starts a server that opens **exactly one port (7878)** and serves:

- **Web UI** — speech studio, voice catalog/downloads, logs, system monitor
  (`http://127.0.0.1:7878/`)
- **REST API** under `/api/*` (used by the web UI itself)
- **OpenAI-compatible speech API** under `/v1/*` (`/v1/audio/speech`) so any
  OpenAI client can point at `http://127.0.0.1:7878/v1`

> PyPI name note: `local-tts` was blocked by PyPI's name-similarity policy, so
> the package is published as `local-tts-studio`. The command stays `local-tts`.

## Install

```bash
pip install local-tts-studio
```

## Run

```bash
local-tts
```

Then open **http://127.0.0.1:7878** in your browser. The web UI, REST API and
OpenAI-compatible API are all served from that single port — no other ports are
opened. Press `Ctrl+C` to stop.

### Options

```bash
local-tts --host 0.0.0.0   # listen on the LAN (default: 127.0.0.1)
local-tts --port 7878      # change the port (default: 7878)
local-tts --version
```

Environment overrides: `LOCAL_TTS_HOST`, `LOCAL_TTS_PORT`, `LOCAL_TTS_DATA_DIR`.

## First-time setup

1. Open the web UI → **Voices & setup**.
2. Click **Install piper** (installs the `piper-tts` engine into the same
   Python environment, done once).
3. Pick a voice from the catalog to download (e.g. `en_US-amy-medium`).
4. Go to **Speech studio**, type text, synthesize.

## Configuration / data locations

Settings, downloaded voices and the voice catalog live in a per-user data
directory (override with `LOCAL_TTS_DATA_DIR`):

| OS      | Path                                                        |
| ------- | ----------------------------------------------------------- |
| Linux   | `~/.local/share/local-tts`                                  |
| macOS   | `~/Library/Application Support/local-tts`                   |
| Windows | `%LOCALAPPDATA%\local-tts`                                  |

## OpenAI-compatible API example

```bash
curl http://127.0.0.1:7878/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"model":"local-tts","voice":"en_US-amy-medium","input":"Hello world"}' \
  --output hello.wav
```

## License

MIT
