1{
2 buildPythonPackage,
3 fetchFromGitHub,
4 fetchPypi,
5 hatchling,
6 huggingface-hub,
7 lib,
8 loguru,
9 misaki,
10 numpy,
11 pytestCheckHook,
12 torch,
13 transformers,
14}:
15
16buildPythonPackage {
17 pname = "kokoro";
18 version = "0-unstable-2025-06-16";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "hexgrad";
23 repo = "kokoro";
24 rev = "2668b2e279d0f94977995230e523b0183763f30e";
25 hash = "sha256-slXbn0W1632Hak6Z0ofF0gyavxRLoxS4fyPQLHSapjA=";
26 };
27
28 build-system = [
29 hatchling
30 ];
31
32 dependencies = [
33 huggingface-hub
34 loguru
35 misaki
36 numpy
37 torch
38 transformers
39 ]
40 ++ misaki.optional-dependencies.en; # kokoro depends on misaki[en]
41
42 nativeCheckInputs = [ pytestCheckHook ];
43
44 disabledTests = [
45 # See https://github.com/hexgrad/kokoro/issues/225
46 "test_different_window_sizes"
47 "test_stft_reconstruction"
48 ];
49
50 pythonImportsCheck = [
51 "kokoro"
52 ];
53
54 meta = {
55 description = "Open-weight TTS model with 82 million parameters";
56 homepage = "https://github.com/hexgrad/kokoro";
57 license = lib.licenses.asl20;
58 maintainers = with lib.maintainers; [ samuela ];
59 };
60}