mirror of
https://github.com/mudler/LocalAI.git
synced 2026-06-26 17:37:07 -04:00
* feat(vllm): macOS/Metal support via vllm-metal (MLX) Add an additive Apple-Silicon path to the existing vllm Python backend so vLLM runs on macOS via vllm-metal (github.com/vllm-project/vllm-metal). Spike outcome (proven on a real M4 / macOS 26.5, Qwen3-0.6B): - vllm-metal registers through vLLM's platform-plugin entry point (metal -> vllm_metal:register); MetalPlatform activates and runs on the GPU through MLX. - LocalAI's backend.py is UNCHANGED: AsyncEngineArgs(...) -> AsyncLLMEngine.from_engine_args transparently resolves to vLLM 0.23's v1 AsyncLLM MLX engine, and async generate produced correct output. - backend.py is NOT touched: its only empty_cache() call is CUDA-only (guarded by torch.cuda.is_available()), so the benign shutdown-only "Allocator for mps is not a DeviceAllocator" noise comes from vLLM's internal EngineCore teardown, not from our code. Changes (all gated behind a darwin condition; Linux/CUDA/ROCm/Intel paths are byte-for-byte unchanged): - install.sh: darwin branch forces PYTHON_VERSION=3.12 (vllm-metal requirement), creates/activates LocalAI's managed venv via ensureVenv, then reproduces vllm-metal's installer INTO that venv (build vLLM 0.23.0 from the release source tarball against requirements/cpu.txt, then install the prebuilt vllm-metal wheel from its latest GitHub release), and runs runProtogen. installRequirements is skipped on darwin. - backend-matrix.yml: add a vllm includeDarwin entry (mps, python). - index.yaml: add metal capability + concrete metal-vllm / metal-vllm-development child entries mirroring the metal-kitten-tts template. Version coupling: vllm-metal pins vLLM 0.23.0, equal to LocalAI's current vllm pin. Bumping vllm must be coordinated with a supporting vllm-metal release; documented in install.sh and requirements-cublas13-after.txt. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude:opus-4.8 [Claude Code] * chore(vllm): track the darwin vllm-metal pin via the autobumper The Apple Silicon build pinned vLLM 0.23.0 as a hidden string in install.sh while floating the vllm-metal wheel on releases/latest - the two could drift apart silently. Make both a tracked, reproducible pair (VLLM_METAL_VERSION + VLLM_VERSION), fetch the wheel by tag, and add .github/bump_vllm_metal.sh wired into bump_deps.yaml. It tracks vllm-project/vllm-metal (not vllm/vllm latest), reading the coupled vLLM source version from vllm-metal's own installer, and opens a bump PR - mirroring the existing bump_vllm_wheel.sh for the cu130 wheel. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude:opus-4.8 [Claude Code] * chore(vllm): derive the darwin vLLM version, drop the second pin Follow-up: VLLM_VERSION was still a hardcoded string duplicating what VLLM_METAL_VERSION already determines. Derive it at install time from vllm-metal's own installer (vllm_v=) at the pinned tag - one source of truth, no second value to drift. The bumper now touches only VLLM_METAL_VERSION; the derivation is immutable per tag, so builds stay reproducible. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude:opus-4.8 [Claude Code] * fix(vllm): fetch the vllm-metal wheel without the GitHub API The darwin build resolved the wheel URL via api.github.com, whose unauthenticated rate limit (60/hr per IP) 403s on shared macOS runners (observed after the 9-min vLLM source build). Construct the release-asset download URL deterministically from the pinned tag and the cp312/arm64 wheel name instead - no API call, no rate limit. Verified the URL resolves (200). Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude:opus-4.8 [Claude Code] * fix(vllm): fail Score cleanly when the engine returns no prompt_logprobs Audit of the Score path against vllm-metal (MLX on macOS): the engine accepts SamplingParams(prompt_logprobs=1) but returns an all-None prompt_logprobs list rather than computing it, so scoring is not supported there. The old guard treated the truthy [None] list as valid and silently scored every candidate as 0. Detect the all-None case and return UNIMPLEMENTED instead. No-op on Linux/CUDA, which populate real entries. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude:opus-4.8 [Claude Code] --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
193 lines
7.7 KiB
YAML
193 lines
7.7 KiB
YAML
name: Bump Backend dependencies
|
|
on:
|
|
schedule:
|
|
- cron: 0 20 * * *
|
|
workflow_dispatch:
|
|
jobs:
|
|
bump-backends:
|
|
if: github.repository == 'mudler/LocalAI'
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- repository: "ggml-org/llama.cpp"
|
|
variable: "LLAMA_VERSION"
|
|
branch: "master"
|
|
file: "backend/cpp/llama-cpp/Makefile"
|
|
- repository: "ikawrakow/ik_llama.cpp"
|
|
variable: "IK_LLAMA_VERSION"
|
|
branch: "main"
|
|
file: "backend/cpp/ik-llama-cpp/Makefile"
|
|
- repository: "TheTom/llama-cpp-turboquant"
|
|
variable: "TURBOQUANT_VERSION"
|
|
branch: "feature/turboquant-kv-cache"
|
|
file: "backend/cpp/turboquant/Makefile"
|
|
- repository: "antirez/ds4"
|
|
variable: "DS4_VERSION"
|
|
branch: "main"
|
|
file: "backend/cpp/ds4/Makefile"
|
|
- repository: "localai-org/privacy-filter.cpp"
|
|
variable: "PRIVACY_FILTER_VERSION"
|
|
branch: "master"
|
|
file: "backend/cpp/privacy-filter/Makefile"
|
|
- repository: "ggml-org/whisper.cpp"
|
|
variable: "WHISPER_CPP_VERSION"
|
|
branch: "master"
|
|
file: "backend/go/whisper/Makefile"
|
|
- repository: "CrispStrobe/CrispASR"
|
|
variable: "CRISPASR_VERSION"
|
|
branch: "main"
|
|
file: "backend/go/crispasr/Makefile"
|
|
- repository: "mudler/parakeet.cpp"
|
|
variable: "PARAKEET_VERSION"
|
|
branch: "master"
|
|
file: "backend/go/parakeet-cpp/Makefile"
|
|
- repository: "mudler/ced.cpp"
|
|
variable: "CED_VERSION"
|
|
branch: "master"
|
|
file: "backend/go/ced/Makefile"
|
|
- repository: "mudler/depth-anything.cpp"
|
|
variable: "DEPTHANYTHING_VERSION"
|
|
branch: "master"
|
|
file: "backend/go/depth-anything-cpp/Makefile"
|
|
- repository: "leejet/stable-diffusion.cpp"
|
|
variable: "STABLEDIFFUSION_GGML_VERSION"
|
|
branch: "master"
|
|
file: "backend/go/stablediffusion-ggml/Makefile"
|
|
- repository: "mudler/go-piper"
|
|
variable: "PIPER_VERSION"
|
|
branch: "master"
|
|
file: "backend/go/piper/Makefile"
|
|
- repository: "antirez/voxtral.c"
|
|
variable: "VOXTRAL_VERSION"
|
|
branch: "main"
|
|
file: "backend/go/voxtral/Makefile"
|
|
- repository: "ace-step/acestep.cpp"
|
|
variable: "ACESTEP_CPP_VERSION"
|
|
branch: "master"
|
|
file: "backend/go/acestep-cpp/Makefile"
|
|
- repository: "PABannier/sam3.cpp"
|
|
variable: "SAM3_VERSION"
|
|
branch: "main"
|
|
file: "backend/go/sam3-cpp/Makefile"
|
|
- repository: "mudler/rf-detr.cpp"
|
|
variable: "RFDETR_VERSION"
|
|
branch: "main"
|
|
file: "backend/go/rfdetr-cpp/Makefile"
|
|
- repository: "mudler/locate-anything.cpp"
|
|
variable: "LOCATEANYTHING_VERSION"
|
|
branch: "master"
|
|
file: "backend/go/locate-anything-cpp/Makefile"
|
|
- repository: "ServeurpersoCom/qwentts.cpp"
|
|
variable: "QWEN3TTS_CPP_VERSION"
|
|
branch: "master"
|
|
file: "backend/go/qwen3-tts-cpp/Makefile"
|
|
- repository: "ServeurpersoCom/omnivoice.cpp"
|
|
variable: "OMNIVOICE_VERSION"
|
|
branch: "master"
|
|
file: "backend/go/omnivoice-cpp/Makefile"
|
|
- repository: "localai-org/vibevoice.cpp"
|
|
variable: "VIBEVOICE_CPP_VERSION"
|
|
branch: "master"
|
|
file: "backend/go/vibevoice-cpp/Makefile"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Bump dependencies 🔧
|
|
id: bump
|
|
run: |
|
|
bash .github/bump_deps.sh ${{ matrix.repository }} ${{ matrix.branch }} ${{ matrix.variable }} ${{ matrix.file }}
|
|
{
|
|
echo 'message<<EOF'
|
|
cat "${{ matrix.variable }}_message.txt"
|
|
echo EOF
|
|
} >> "$GITHUB_OUTPUT"
|
|
{
|
|
echo 'commit<<EOF'
|
|
cat "${{ matrix.variable }}_commit.txt"
|
|
echo EOF
|
|
} >> "$GITHUB_OUTPUT"
|
|
rm -rfv ${{ matrix.variable }}_message.txt
|
|
rm -rfv ${{ matrix.variable }}_commit.txt
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v8
|
|
with:
|
|
token: ${{ secrets.UPDATE_BOT_TOKEN }}
|
|
push-to-fork: ci-forks/LocalAI
|
|
commit-message: ':arrow_up: Update ${{ matrix.repository }}'
|
|
title: 'chore: :arrow_up: Update ${{ matrix.repository }} to `${{ steps.bump.outputs.commit }}`'
|
|
branch: "update/${{ matrix.variable }}"
|
|
body: ${{ steps.bump.outputs.message }}
|
|
signoff: true
|
|
|
|
bump-vllm-wheel:
|
|
# vLLM's cu130 wheel comes from a per-tag index URL (no /latest/ alias),
|
|
# so the cublas13 requirements file pins both a URL segment and a version
|
|
# constraint. bump_deps.sh handles git-sha-in-Makefile only — this job
|
|
# rewrites both values atomically when a new vLLM stable tag ships.
|
|
if: github.repository == 'mudler/LocalAI'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Bump vLLM cu130 wheel pin 🔧
|
|
id: bump
|
|
run: |
|
|
bash .github/bump_vllm_wheel.sh vllm-project/vllm backend/python/vllm/requirements-cublas13-after.txt VLLM_VERSION
|
|
{
|
|
echo 'message<<EOF'
|
|
cat "VLLM_VERSION_message.txt"
|
|
echo EOF
|
|
} >> "$GITHUB_OUTPUT"
|
|
{
|
|
echo 'commit<<EOF'
|
|
cat "VLLM_VERSION_commit.txt"
|
|
echo EOF
|
|
} >> "$GITHUB_OUTPUT"
|
|
rm -rfv VLLM_VERSION_message.txt VLLM_VERSION_commit.txt
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v8
|
|
with:
|
|
token: ${{ secrets.UPDATE_BOT_TOKEN }}
|
|
push-to-fork: ci-forks/LocalAI
|
|
commit-message: ':arrow_up: Update vllm-project/vllm cu130 wheel'
|
|
title: 'chore: :arrow_up: Update vllm-project/vllm cu130 wheel to `${{ steps.bump.outputs.commit }}`'
|
|
branch: "update/VLLM_VERSION"
|
|
body: ${{ steps.bump.outputs.message }}
|
|
signoff: true
|
|
|
|
bump-vllm-metal:
|
|
# The darwin (Apple Silicon) vLLM build installs vllm-metal, which is locked
|
|
# to a specific vLLM source release. install.sh pins both VLLM_METAL_VERSION
|
|
# (the wheel release) and VLLM_VERSION (the vLLM it builds against); this job
|
|
# tracks vllm-project/vllm-metal and rewrites both atomically. Separate from
|
|
# bump-vllm-wheel because darwin follows vllm-metal, not vllm/vllm latest.
|
|
if: github.repository == 'mudler/LocalAI'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Bump vllm-metal pin 🔧
|
|
id: bump
|
|
run: |
|
|
bash .github/bump_vllm_metal.sh vllm-project/vllm-metal backend/python/vllm/install.sh VLLM_METAL_VERSION
|
|
{
|
|
echo 'message<<EOF'
|
|
cat "VLLM_METAL_VERSION_message.txt"
|
|
echo EOF
|
|
} >> "$GITHUB_OUTPUT"
|
|
{
|
|
echo 'commit<<EOF'
|
|
cat "VLLM_METAL_VERSION_commit.txt"
|
|
echo EOF
|
|
} >> "$GITHUB_OUTPUT"
|
|
rm -rfv VLLM_METAL_VERSION_message.txt VLLM_METAL_VERSION_commit.txt
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v8
|
|
with:
|
|
token: ${{ secrets.UPDATE_BOT_TOKEN }}
|
|
push-to-fork: ci-forks/LocalAI
|
|
commit-message: ':arrow_up: Update vllm-project/vllm-metal (darwin)'
|
|
title: 'chore: :arrow_up: Update vllm-metal (darwin) to `${{ steps.bump.outputs.commit }}`'
|
|
branch: "update/VLLM_METAL_VERSION"
|
|
body: ${{ steps.bump.outputs.message }}
|
|
signoff: true
|