diff --git a/.github/backend-matrix.yml b/.github/backend-matrix.yml index 387fbdc20..2ae8a26af 100644 --- a/.github/backend-matrix.yml +++ b/.github/backend-matrix.yml @@ -66,6 +66,34 @@ include: dockerfile: "./backend/Dockerfile.python" context: "./" ubuntu-version: '2404' + - build-type: '' + cuda-major-version: "" + cuda-minor-version: "" + platforms: 'linux/amd64' + platform-tag: 'amd64' + tag-latest: 'auto' + tag-suffix: '-cpu-kokoro' + runs-on: 'ubuntu-latest' + base-image: "ubuntu:24.04" + skip-drivers: 'true' + backend: "kokoro" + dockerfile: "./backend/Dockerfile.python" + context: "./" + ubuntu-version: '2404' + - build-type: '' + cuda-major-version: "" + cuda-minor-version: "" + platforms: 'linux/arm64' + platform-tag: 'arm64' + tag-latest: 'auto' + tag-suffix: '-cpu-kokoro' + runs-on: 'ubuntu-24.04-arm' + base-image: "ubuntu:24.04" + skip-drivers: 'true' + backend: "kokoro" + dockerfile: "./backend/Dockerfile.python" + context: "./" + ubuntu-version: '2404' - build-type: '' cuda-major-version: "" cuda-minor-version: "" diff --git a/backend/index.yaml b/backend/index.yaml index 57e9ac5fc..2d002d690 100644 --- a/backend/index.yaml +++ b/backend/index.yaml @@ -1455,6 +1455,7 @@ alias: "kokoro" name: "kokoro" capabilities: + default: "cpu-kokoro" nvidia: "cuda12-kokoro" intel: "intel-kokoro" amd: "rocm-kokoro" @@ -5186,11 +5187,22 @@ - !!merge <<: *kokoro name: "kokoro-development" capabilities: + default: "cpu-kokoro-development" nvidia: "cuda12-kokoro-development" intel: "intel-kokoro-development" amd: "rocm-kokoro-development" nvidia-l4t: "nvidia-l4t-kokoro-development" metal: "metal-kokoro-development" +- !!merge <<: *kokoro + name: "cpu-kokoro" + uri: "quay.io/go-skynet/local-ai-backends:latest-cpu-kokoro" + mirrors: + - localai/localai-backends:latest-cpu-kokoro +- !!merge <<: *kokoro + name: "cpu-kokoro-development" + uri: "quay.io/go-skynet/local-ai-backends:master-cpu-kokoro" + mirrors: + - localai/localai-backends:master-cpu-kokoro - !!merge <<: *kokoro name: "cuda12-kokoro-development" uri: "quay.io/go-skynet/local-ai-backends:master-gpu-nvidia-cuda-12-kokoro" diff --git a/core/gallery/backends_test.go b/core/gallery/backends_test.go index a3339861c..1b7e059be 100644 --- a/core/gallery/backends_test.go +++ b/core/gallery/backends_test.go @@ -32,6 +32,42 @@ var _ = Describe("Runtime capability-based backend selection", func() { os.RemoveAll(tempDir) }) + It("keeps the Kokoro CPU fallback installable from the backend gallery", func() { + backends, err := ReadConfigFile[[]*GalleryBackend](filepath.Join("..", "..", "backend", "index.yaml")) + Expect(err).NotTo(HaveOccurred()) + + byName := make(map[string]*GalleryBackend, len(*backends)) + for _, backend := range *backends { + byName[backend.Name] = backend + } + + Expect(byName).To(HaveKey("kokoro")) + Expect(byName["kokoro"].CapabilitiesMap).To(HaveKeyWithValue("default", "cpu-kokoro")) + Expect(byName).To(HaveKey("cpu-kokoro")) + Expect(byName["cpu-kokoro"].URI).To(Equal("quay.io/go-skynet/local-ai-backends:latest-cpu-kokoro")) + + type matrixEntry struct { + Backend string `yaml:"backend"` + Platforms string `yaml:"platforms"` + PlatformTag string `yaml:"platform-tag"` + TagSuffix string `yaml:"tag-suffix"` + } + type backendMatrix struct { + Include []matrixEntry `yaml:"include"` + } + + matrix, err := ReadConfigFile[backendMatrix](filepath.Join("..", "..", ".github", "backend-matrix.yml")) + Expect(err).NotTo(HaveOccurred()) + + var cpuArchitectures []string + for _, entry := range matrix.Include { + if entry.Backend == "kokoro" && entry.TagSuffix == "-cpu-kokoro" { + cpuArchitectures = append(cpuArchitectures, entry.Platforms+"/"+entry.PlatformTag) + } + } + Expect(cpuArchitectures).To(ConsistOf("linux/amd64/amd64", "linux/arm64/arm64")) + }) + It("ListSystemBackends prefers optimal alias candidate", func() { // Arrange two installed backends sharing the same alias must := func(err error) { Expect(err).NotTo(HaveOccurred()) } diff --git a/docs/content/reference/compatibility-table.md b/docs/content/reference/compatibility-table.md index b3e94c87d..4ac4cec77 100644 --- a/docs/content/reference/compatibility-table.md +++ b/docs/content/reference/compatibility-table.md @@ -55,7 +55,7 @@ All backends listed here can be installed on demand from the [Backend Gallery]({ |---------|-------------|-------------| | [piper](https://github.com/rhasspy/piper) | Fast neural TTS | CPU, Metal | | [Coqui TTS](https://github.com/idiap/coqui-ai-TTS) | TTS with 1100+ languages and voice cloning | CUDA 12, ROCm, Intel SYCL, Metal | -| [Kokoro](https://huggingface.co/hexgrad/Kokoro-82M) | Lightweight TTS (82M params) | CUDA 12/13, ROCm, Intel SYCL, Metal, Jetson L4T | +| [Kokoro](https://huggingface.co/hexgrad/Kokoro-82M) | Lightweight TTS (82M params) | CPU, CUDA 12/13, ROCm, Intel SYCL, Metal, Jetson L4T | | [Kokoros](https://huggingface.co/hexgrad/Kokoro-82M) | Pure Rust Kokoro TTS via ONNX | CPU | | [Chatterbox](https://github.com/resemble-ai/chatterbox) | Production-grade TTS with emotion control | CPU, CUDA 12/13, Metal, Jetson L4T | | [VibeVoice](https://github.com/microsoft/VibeVoice) | Real-time TTS with voice cloning | CPU, CUDA 12/13, ROCm, Intel SYCL, Metal, Jetson L4T |