Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 8 additions & 19 deletions .github/workflows/llama_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ on:
- "integrations/llama_cpp/**"
- "!integrations/llama_cpp/*.md"
- ".github/workflows/llama_cpp.yml"

defaults:
run:
working-directory: integrations/llama_cpp
Expand All @@ -29,6 +28,8 @@ concurrency:
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
TEST_MATRIX_OS: '["ubuntu-latest", "windows-latest", "macos-latest"]'
TEST_MATRIX_PYTHON: '["3.10", "3.14"]'

jobs:
compute-test-matrix:
Expand All @@ -37,26 +38,13 @@ jobs:
run:
working-directory: .
outputs:
matrix: ${{ steps.set.outputs.matrix }}
os: ${{ steps.set.outputs.os }}
python-version: ${{ steps.set.outputs.python-version }}
steps:
- id: set
run: |
if [ "${{ github.event_name }}" = "push" ]; then
echo 'matrix=[{"os":"ubuntu-latest","python-version":"3.10"}]' >> "$GITHUB_OUTPUT"
else
MATRIX='['
MATRIX+='{"os":"ubuntu-latest","python-version":"3.10"},'
MATRIX+='{"os":"ubuntu-latest","python-version":"3.14"},'
MATRIX+='{"os":"windows-latest","python-version":"3.10"},'
MATRIX+='{"os":"windows-latest","python-version":"3.14"},'
# On macOS, pre-built wheels for 3.14 are not available and installing from source
# might fail due to missing dependencies (CMake fails with "OpenMP not found").
# We test with 3.12 instead because pre-built wheels are available for this version.
MATRIX+='{"os":"macos-latest","python-version":"3.10"},'
MATRIX+='{"os":"macos-latest","python-version":"3.12"}'
MATRIX+=']'
echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT"
fi
echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> "$GITHUB_OUTPUT"
echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> "$GITHUB_OUTPUT"

run:
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
Expand All @@ -68,7 +56,8 @@ jobs:
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.compute-test-matrix.outputs.matrix) }}
os: ${{ fromJSON(needs.compute-test-matrix.outputs.os) }}
python-version: ${{ fromJSON(needs.compute-test-matrix.outputs.python-version) }}

steps:
- name: Support longpaths
Expand Down
12 changes: 3 additions & 9 deletions integrations/llama_cpp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,9 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = ["haystack-ai>=2.22.0", "llama-cpp-python>=0.2.87"]

# On macOS GitHub runners, we use a custom index to download pre-built wheels.
# Installing from source might fail due to missing dependencies (CMake fails with "OpenMP not found")
[tool.uv]
index-strategy = "unsafe-best-match" # this ensures that packages are not only searched in the below index but also in PyPI
[[tool.uv.index]]
name = "llama-cpp-python-macos"
url = "https://abetlen.github.io/llama-cpp-python/whl/metal/"
dependencies = [
"haystack-ai>=2.22.0", "llama-cpp-python>=0.2.87"
]

[project.urls]
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/llama_cpp#readme"
Expand Down
Loading