Skip to content

Commit 3c3f477

Browse files
authored
feat(mlx-audio): Add mlx-audio backend (#6138)
* feat(mlx-audio): Add mlx-audio backend Signed-off-by: Ettore Di Giacinto <[email protected]> * improve loading Signed-off-by: Ettore Di Giacinto <[email protected]> * CI tests Signed-off-by: Ettore Di Giacinto <[email protected]> * fix: set C_INCLUDE_PATH to point to python install Signed-off-by: Ettore Di Giacinto <[email protected]> --------- Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent f8a8cf3 commit 3c3f477

File tree

12 files changed

+1869
-1148
lines changed

12 files changed

+1869
-1148
lines changed

.github/workflows/backend.yml

Lines changed: 1162 additions & 1148 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,10 @@ backends/mlx-vlm:
388388
BACKEND=mlx-vlm $(MAKE) build-darwin-python-backend
389389
./local-ai backends install "ocifile://$(abspath ./backend-images/mlx-vlm.tar)"
390390

391+
backends/mlx-audio:
392+
BACKEND=mlx-audio $(MAKE) build-darwin-python-backend
393+
./local-ai backends install "ocifile://$(abspath ./backend-images/mlx-audio.tar)"
394+
391395
backend-images:
392396
mkdir -p backend-images
393397

backend/index.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,23 @@
159159
- vision-language
160160
- LLM
161161
- MLX
162+
- &mlx-audio
163+
name: "mlx-audio"
164+
uri: "quay.io/go-skynet/local-ai-backends:latest-metal-darwin-arm64-mlx-audio"
165+
icon: https://avatars.githubusercontent.com/u/102832242?s=200&v=4
166+
urls:
167+
- https://github.com/Blaizzy/mlx-audio
168+
mirrors:
169+
- localai/localai-backends:latest-metal-darwin-arm64-mlx-audio
170+
license: MIT
171+
description: |
172+
Run Audio Models with MLX
173+
tags:
174+
- audio-to-text
175+
- audio-generation
176+
- text-to-audio
177+
- LLM
178+
- MLX
162179
- &rerankers
163180
name: "rerankers"
164181
alias: "rerankers"
@@ -415,6 +432,11 @@
415432
uri: "quay.io/go-skynet/local-ai-backends:master-metal-darwin-arm64-mlx-vlm"
416433
mirrors:
417434
- localai/localai-backends:master-metal-darwin-arm64-mlx-vlm
435+
- !!merge <<: *mlx-audio
436+
name: "mlx-audio-development"
437+
uri: "quay.io/go-skynet/local-ai-backends:master-metal-darwin-arm64-mlx-audio"
438+
mirrors:
439+
- localai/localai-backends:master-metal-darwin-arm64-mlx-audio
418440
- !!merge <<: *kitten-tts
419441
name: "kitten-tts-development"
420442
uri: "quay.io/go-skynet/local-ai-backends:master-kitten-tts"

backend/python/common/libbackend.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,11 @@ function installRequirements() {
384384
requirementFiles+=("${EDIR}/requirements-${BUILD_PROFILE}-after.txt")
385385
fi
386386

387+
# This is needed to build wheels that e.g. depends on Python.h
388+
if [ "x${PORTABLE_PYTHON}" == "xtrue" ]; then
389+
export C_INCLUDE_PATH="${C_INCLUDE_PATH:-}:$(_portable_dir)/include/python${PYTHON_VERSION}"
390+
fi
391+
387392
for reqFile in ${requirementFiles[@]}; do
388393
if [ -f "${reqFile}" ]; then
389394
echo "starting requirements install for ${reqFile}"

backend/python/mlx-audio/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.PHONY: mlx-audio
2+
mlx-audio:
3+
bash install.sh
4+
5+
.PHONY: run
6+
run: mlx-audio
7+
@echo "Running mlx-audio..."
8+
bash run.sh
9+
@echo "mlx run."
10+
11+
.PHONY: test
12+
test: mlx-audio
13+
@echo "Testing mlx-audio..."
14+
bash test.sh
15+
@echo "mlx tested."
16+
17+
.PHONY: protogen-clean
18+
protogen-clean:
19+
$(RM) backend_pb2_grpc.py backend_pb2.py
20+
21+
.PHONY: clean
22+
clean: protogen-clean
23+
rm -rf venv __pycache__

0 commit comments

Comments
 (0)