Skip to content

Commit f8bd0bc

Browse files
authored
ci: download pre-built wheels for llama-cpp-python on macOS (#2235)
* ci: add extra index for llama-cpp-python MacOs * retry * fix * fix pyproject * retry * again * improvements * typos
1 parent 270e12b commit f8bd0bc

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

.github/workflows/llama_cpp.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,22 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
os: [ubuntu-latest, macos-latest, windows-latest]
34-
python-version: ["3.9", "3.13"]
33+
include:
34+
- os: ubuntu-latest
35+
python-version: "3.9"
36+
- os: ubuntu-latest
37+
python-version: "3.13"
38+
- os: windows-latest
39+
python-version: "3.9"
40+
- os: windows-latest
41+
python-version: "3.13"
42+
43+
# on macOS, we test with 3.10 and 3.12 because pre-built wheels are only available for these Python versions
44+
# and installing from source might fail due to missing dependencies (CMake fails with "OpenMP not found")
45+
- os: macos-latest
46+
python-version: "3.10"
47+
- os: macos-latest
48+
python-version: "3.12"
3549

3650
steps:
3751
- name: Support longpaths

integrations/llama_cpp/pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ classifiers = [
2828
]
2929
dependencies = ["haystack-ai>=2.16.1", "llama-cpp-python>=0.2.87"]
3030

31+
# On macOS GitHub runners, we use a custom index to download pre-built wheels.
32+
# Installing from source might fail due to missing dependencies (CMake fails with "OpenMP not found")
33+
[tool.uv]
34+
index-strategy = "unsafe-best-match" # this ensures that packages are not only searched in the below index but also in PyPI
35+
[[tool.uv.index]]
36+
name = "llama-cpp-python-macos"
37+
url = "https://abetlen.github.io/llama-cpp-python/whl/metal/"
38+
3139
[project.urls]
3240
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/llama_cpp#readme"
3341
Issues = "https://github.com/deepset-ai/haystack-core-integrations/issues"

0 commit comments

Comments
 (0)