Skip to content

Commit 823fc25

Browse files
fix(kokoro): add CPU backend fallback (#11161)
Publish the existing Kokoro CPU profile for amd64 and arm64 and use it as the default gallery capability so Vulkan-only and CPU hosts can install the backend. Assisted-by: Codex:gpt-5 Co-authored-by: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com>
1 parent 366db11 commit 823fc25

4 files changed

Lines changed: 77 additions & 1 deletion

File tree

.github/backend-matrix.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,34 @@ include:
6666
dockerfile: "./backend/Dockerfile.python"
6767
context: "./"
6868
ubuntu-version: '2404'
69+
- build-type: ''
70+
cuda-major-version: ""
71+
cuda-minor-version: ""
72+
platforms: 'linux/amd64'
73+
platform-tag: 'amd64'
74+
tag-latest: 'auto'
75+
tag-suffix: '-cpu-kokoro'
76+
runs-on: 'ubuntu-latest'
77+
base-image: "ubuntu:24.04"
78+
skip-drivers: 'true'
79+
backend: "kokoro"
80+
dockerfile: "./backend/Dockerfile.python"
81+
context: "./"
82+
ubuntu-version: '2404'
83+
- build-type: ''
84+
cuda-major-version: ""
85+
cuda-minor-version: ""
86+
platforms: 'linux/arm64'
87+
platform-tag: 'arm64'
88+
tag-latest: 'auto'
89+
tag-suffix: '-cpu-kokoro'
90+
runs-on: 'ubuntu-24.04-arm'
91+
base-image: "ubuntu:24.04"
92+
skip-drivers: 'true'
93+
backend: "kokoro"
94+
dockerfile: "./backend/Dockerfile.python"
95+
context: "./"
96+
ubuntu-version: '2404'
6997
- build-type: ''
7098
cuda-major-version: ""
7199
cuda-minor-version: ""

backend/index.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,6 +1455,7 @@
14551455
alias: "kokoro"
14561456
name: "kokoro"
14571457
capabilities:
1458+
default: "cpu-kokoro"
14581459
nvidia: "cuda12-kokoro"
14591460
intel: "intel-kokoro"
14601461
amd: "rocm-kokoro"
@@ -5186,11 +5187,22 @@
51865187
- !!merge <<: *kokoro
51875188
name: "kokoro-development"
51885189
capabilities:
5190+
default: "cpu-kokoro-development"
51895191
nvidia: "cuda12-kokoro-development"
51905192
intel: "intel-kokoro-development"
51915193
amd: "rocm-kokoro-development"
51925194
nvidia-l4t: "nvidia-l4t-kokoro-development"
51935195
metal: "metal-kokoro-development"
5196+
- !!merge <<: *kokoro
5197+
name: "cpu-kokoro"
5198+
uri: "quay.io/go-skynet/local-ai-backends:latest-cpu-kokoro"
5199+
mirrors:
5200+
- localai/localai-backends:latest-cpu-kokoro
5201+
- !!merge <<: *kokoro
5202+
name: "cpu-kokoro-development"
5203+
uri: "quay.io/go-skynet/local-ai-backends:master-cpu-kokoro"
5204+
mirrors:
5205+
- localai/localai-backends:master-cpu-kokoro
51945206
- !!merge <<: *kokoro
51955207
name: "cuda12-kokoro-development"
51965208
uri: "quay.io/go-skynet/local-ai-backends:master-gpu-nvidia-cuda-12-kokoro"

core/gallery/backends_test.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,42 @@ var _ = Describe("Runtime capability-based backend selection", func() {
3232
os.RemoveAll(tempDir)
3333
})
3434

35+
It("keeps the Kokoro CPU fallback installable from the backend gallery", func() {
36+
backends, err := ReadConfigFile[[]*GalleryBackend](filepath.Join("..", "..", "backend", "index.yaml"))
37+
Expect(err).NotTo(HaveOccurred())
38+
39+
byName := make(map[string]*GalleryBackend, len(*backends))
40+
for _, backend := range *backends {
41+
byName[backend.Name] = backend
42+
}
43+
44+
Expect(byName).To(HaveKey("kokoro"))
45+
Expect(byName["kokoro"].CapabilitiesMap).To(HaveKeyWithValue("default", "cpu-kokoro"))
46+
Expect(byName).To(HaveKey("cpu-kokoro"))
47+
Expect(byName["cpu-kokoro"].URI).To(Equal("quay.io/go-skynet/local-ai-backends:latest-cpu-kokoro"))
48+
49+
type matrixEntry struct {
50+
Backend string `yaml:"backend"`
51+
Platforms string `yaml:"platforms"`
52+
PlatformTag string `yaml:"platform-tag"`
53+
TagSuffix string `yaml:"tag-suffix"`
54+
}
55+
type backendMatrix struct {
56+
Include []matrixEntry `yaml:"include"`
57+
}
58+
59+
matrix, err := ReadConfigFile[backendMatrix](filepath.Join("..", "..", ".github", "backend-matrix.yml"))
60+
Expect(err).NotTo(HaveOccurred())
61+
62+
var cpuArchitectures []string
63+
for _, entry := range matrix.Include {
64+
if entry.Backend == "kokoro" && entry.TagSuffix == "-cpu-kokoro" {
65+
cpuArchitectures = append(cpuArchitectures, entry.Platforms+"/"+entry.PlatformTag)
66+
}
67+
}
68+
Expect(cpuArchitectures).To(ConsistOf("linux/amd64/amd64", "linux/arm64/arm64"))
69+
})
70+
3571
It("ListSystemBackends prefers optimal alias candidate", func() {
3672
// Arrange two installed backends sharing the same alias
3773
must := func(err error) { Expect(err).NotTo(HaveOccurred()) }

docs/content/reference/compatibility-table.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ All backends listed here can be installed on demand from the [Backend Gallery]({
5555
|---------|-------------|-------------|
5656
| [piper](https://github.com/rhasspy/piper) | Fast neural TTS | CPU, Metal |
5757
| [Coqui TTS](https://github.com/idiap/coqui-ai-TTS) | TTS with 1100+ languages and voice cloning | CUDA 12, ROCm, Intel SYCL, Metal |
58-
| [Kokoro](https://huggingface.co/hexgrad/Kokoro-82M) | Lightweight TTS (82M params) | CUDA 12/13, ROCm, Intel SYCL, Metal, Jetson L4T |
58+
| [Kokoro](https://huggingface.co/hexgrad/Kokoro-82M) | Lightweight TTS (82M params) | CPU, CUDA 12/13, ROCm, Intel SYCL, Metal, Jetson L4T |
5959
| [Kokoros](https://huggingface.co/hexgrad/Kokoro-82M) | Pure Rust Kokoro TTS via ONNX | CPU |
6060
| [Chatterbox](https://github.com/resemble-ai/chatterbox) | Production-grade TTS with emotion control | CPU, CUDA 12/13, Metal, Jetson L4T |
6161
| [VibeVoice](https://github.com/microsoft/VibeVoice) | Real-time TTS with voice cloning | CPU, CUDA 12/13, ROCm, Intel SYCL, Metal, Jetson L4T |

0 commit comments

Comments
 (0)