Metadata-Version: 2.4
Name: kittensynth
Version: 0.1.0
Summary: KittenTTS synthesis frontend backed by kitteng2p and OnnxVoice
Author: kittensynth contributors
License: Apache-2.0
Project-URL: Repository, https://github.com/buchwandler/kittensynth
Project-URL: Homepage, https://github.com/buchwandler/kittensynth
Keywords: tts,kitten,kittentts,onnx,onnxruntime,speech
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: Apache Software License
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 :: Multimedia :: Sound/Audio :: Speech
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: numpy>=1.23
Requires-Dist: kitteng2p<0.2,>=0.0
Requires-Dist: onnxvoice<0.3,>=0.2
Provides-Extra: cpu
Requires-Dist: onnxvoice[cpu]<0.3,>=0.2; extra == "cpu"
Provides-Extra: gpu
Requires-Dist: onnxvoice[gpu]<0.3,>=0.2; extra == "gpu"
Provides-Extra: bundled-g2p
Requires-Dist: kitteng2p[bundled]<0.2,>=0.1; extra == "bundled-g2p"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-cov>=5; extra == "dev"
Requires-Dist: ruff<0.17,>=0.16; extra == "dev"
Requires-Dist: mypy>=1.11; extra == "dev"
Requires-Dist: build>=1; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"
Requires-Dist: packaging>=24; extra == "dev"
Requires-Dist: tomli>=2; python_version < "3.11" and extra == "dev"
Dynamic: license-file

# kittensynth

KittenTTS synthesis layer built on **kitteng2p + OnnxVoice**.

This MVP follows the same repository/package shape as PiperSynth/PiperG2P:

```text
pyproject.toml
kittensynth/
tests/
docs/
```

There is **no `src/` layer** and no hard-coded package version.

## Architecture

```text
prepared speakable English
        |
        v
kitteng2p
  - eSpeak
  - Kitten phoneme tokenization
  - Kitten v0.8 token IDs
        |
        v
kittensynth
  - voice alias/style row
  - speed-prior policy
        |
        v
onnxvoice
  - catalogs/install/cache/integrity
  - ORT providers/sessions
  - Kitten graph ABI
        |
        v
float32 waveform
```

`kittensynth` has **no direct eSpeak or phonemizer dependency**. That is now entirely owned by
`kitteng2p`.

## Required OnnxVoice contract

A future/updated OnnxVoice release must register:

```text
system = kitten
```

and expose:

```python
runtime.infer(token_ids, style=style, speed=effective_speed)
```

The installation contains at least:

```text
role=model
role=voices
```

with 24 kHz metadata and Kitten voice aliases/speed priors.

## Managed model

```python
from kittensynth import KittenVoice

with KittenVoice.from_pretrained("nano-0.8-int8") as model:
    result = model.synthesize_prepared(
        "Hello from KittenSynth.",
        voice="Jasper",
    )
    result.save_wav("hello.wav")
```

## Local model

```python
from kittensynth import KittenVoice

with KittenVoice.from_local(
    model_path="kitten_tts_nano_v0_8.onnx",
    voices_path="voices.npz",
    config_path="config.json",
) as model:
    result = model.synthesize_prepared("Local synthesis.", voice="Bella")
    result.save_wav("local.wav")
```

## Prepared-text boundary

Like PiperG2P/PiperSynth, this MVP expects prepared speakable text. Written-form semantic expansion
(numbers, currencies, dates, URLs, abbreviations) stays outside the engine.

That keeps these packages independent:

```text
semantic preparation -> kitteng2p -> kittensynth -> onnxvoice
```

## Voice selection

The current v0.8 aliases are:

```text
Bella   -> expr-voice-2-f
Jasper  -> expr-voice-2-m
Luna    -> expr-voice-3-f
Bruno   -> expr-voice-3-m
Rosie   -> expr-voice-4-f
Hugo    -> expr-voice-4-m
Kiki    -> expr-voice-5-f
Leo     -> expr-voice-5-m
```

The style row is selected exactly as upstream v0.8:

```python
min(len(text), style_rows - 1)
```

## Dynamic versioning

Both `kitteng2p` and `kittensynth` use the same Git-tag-driven `setuptools-scm` pattern:

```bash
git tag v0.1.0
python -m build
```

The source-ZIP fallback is `0.1.dev0`; installed `__version__` comes from distribution metadata.

## Development

For sibling checkout development:

```bash
python -m pip install -e ../kitteng2p
python -m pip install -e ".[dev]"
python -m pytest
```

Real synthesis remains blocked until OnnxVoice contains the Kitten adapter/catalog parser.
