A TTS that fits in your CPU (and pocket)
Python
[project]
name = "pocket-tts"
requires-python = ">= 3.10,<3.15"
description = "Kyutai's pocket-sized text-to-speech!"
version = "4.0.1"
readme = "README.md"
dependencies = [
"numpy>=2",
# I tried 2.4.0 but the generated audio is wrong, so 2.5+ is needed.
"torch>=2.5.0",
"pydantic>=2",
"sentencepiece>=0.2.1",
"tokenizers>=0.21",
"safetensors>=0.4.0",
"typer>=0.10.0",
"typing_extensions>=4.10.0",
"fastapi>=0.100",
"uvicorn>=0.13.0",
"python-multipart>=0.0.21",
"scipy>=1.5.0",
"einops>=0.4.0",
"huggingface_hub>=0.13.0",
"requests>=2.20.0",
]
[project.optional-dependencies]
audio = ["soundfile>=0.12.0"]
quantize = ["torchao>=0.16.0"]
[dependency-groups]
# Also covers training the models in training/ (see training/README.md) and
# scoring with training/eval/librispeech.py. Inference needs none of this.
dev = [
"coverage>=7.6.12",
"jiwer>=3.0",
"line-profiler>=5.0.0",
"mkdocs>=1.6.1",
"mkdocs-autolinks-plugin>=0.7.1",
"mkdocs-material>=9.7.1",
"mkdocstrings-python>=2.0.1",
"pytest>=9.0.2",
"pytest-xdist>=3.8.0",
"pyyaml>=6.0",
"soundfile",
"sphn>=0.1.4",
"torchaudio",
# scripts/align_data.py: wav2vec2 CTC forced alignment of the manifests
"transformers>=4.40",
"tqdm>=4.60",
"utmos-pytorch>=0.1.0",
"whisper-normalizer>=0.0.10",
"ty>=0.0.77",
]
[tool.ruff]
line-length = 100
[tool.ruff.lint]
extend-select = ["ANN"]
[tool.ruff.lint.flake8-annotations]
suppress-none-returning = true
[tool.ruff.format]
line-ending = "lf"
# avoid having a trailing comma changing
# the behavior of the formatter
skip-magic-trailing-comma = true
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["pocket_tts"]
[project.scripts]
pocket-tts = "pocket_tts.main:cli_app"
[tool.uv]
exclude-newer = "7 days"
# System python distribution can have header files missing, so we use only the python
# distributions provided by uv which have everything included.
python-preference = "only-managed"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ty.src]
# The example notebook imports IPython, which is not a dependency.
exclude = ["docs/"]
[tool.ty.rules]
missing-type-argument = "error"
[[tool.ty.overrides]]
# The torch.ao fallback is deliberately on a deprecated API (see the module docstring).
include = ["pocket_tts/quantization.py"]
[tool.ty.overrides.rules]
deprecated = "ignore"