René's URL Explorer Experiment


Title: Improve installation DX: prebuilt wheels for 3.13/3.14/3.14t + declarative backend selection · Issue #2136 · abetlen/llama-cpp-python · GitHub

Open Graph Title: Improve installation DX: prebuilt wheels for 3.13/3.14/3.14t + declarative backend selection · Issue #2136 · abetlen/llama-cpp-python

X Title: Improve installation DX: prebuilt wheels for 3.13/3.14/3.14t + declarative backend selection · Issue #2136 · abetlen/llama-cpp-python

Description: Problem Installing llama-cpp-python with a GPU backend requires setting CMAKE_ARGS as an environment variable at build time: CMAKE_ARGS="-DGGML_METAL=on" pip install llama-cpp-python This creates pain across the ecosystem: Not declarable...

Open Graph Description: Problem Installing llama-cpp-python with a GPU backend requires setting CMAKE_ARGS as an environment variable at build time: CMAKE_ARGS="-DGGML_METAL=on" pip install llama-cpp-python This creates p...

X Description: Problem Installing llama-cpp-python with a GPU backend requires setting CMAKE_ARGS as an environment variable at build time: CMAKE_ARGS="-DGGML_METAL=on" pip install llama-cpp-python This...

Opengraph URL: https://github.com/abetlen/llama-cpp-python/issues/2136

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve installation DX: prebuilt wheels for 3.13/3.14/3.14t + declarative backend selection","articleBody":"## Problem\n\nInstalling `llama-cpp-python` with a GPU backend requires setting `CMAKE_ARGS` as an environment variable at build time:\n\n```bash\nCMAKE_ARGS=\"-DGGML_METAL=on\" pip install llama-cpp-python\n```\n\nThis creates pain across the ecosystem:\n\n1. **Not declarable in `pyproject.toml`** — Every downstream project needs custom Makefiles or install scripts with GPU auto-detection logic (macOS → Metal, nvidia-smi → CUDA, rocminfo → ROCm, fallback → OpenBLAS). This is duplicated across hundreds of projects.\n\n2. **Cache invalidation is broken** — `pip` and `uv` cache wheels by package version, not by `CMAKE_ARGS`. A cached OpenBLAS wheel silently gets reused when Metal or CUDA is requested. Workaround: `--no-cache`, which defeats caching entirely.\n\n3. **GPU prebuilt wheels stop at Python 3.12** — The Metal wheel CI ([`build-wheels-metal.yaml`](https://github.com/abetlen/llama-cpp-python/blob/main/.github/workflows/build-wheels-metal.yaml)) is hardcoded to `CIBW_BUILD: \"cp39-* cp310-* cp311-* cp312-*\"`. The CUDA wheel CI ([`build-wheels-cuda.yaml`](https://github.com/abetlen/llama-cpp-python/blob/main/.github/workflows/build-wheels-cuda.yaml)) has its matrix pinned to Python 3.9-3.12. CPU-only wheels include 3.13 (via default cibuildwheel config in [`build-and-release.yaml`](https://github.com/abetlen/llama-cpp-python/blob/main/.github/workflows/build-and-release.yaml)), but the arm64 job there also pins to cp38-cp312. No workflow produces 3.14 or free-threaded (3.13t/3.14t) wheels. Python 3.13 has been stable since Oct 2024, 3.14 since Oct 2025. Free-threaded builds are increasingly important — vLLM, llguidance, and the broader no-GIL ecosystem depend on them.\n\nCurrent state of published wheel indexes:\n\n| Index | cp313 | cp314 | Free-threaded |\n|-------|-------|-------|---------------|\n| CPU (`/whl/cpu/`) | ✅ | ❌ | ❌ |\n| Metal (`/whl/metal/`) | ❌ | ❌ | ❌ |\n| CUDA (`/whl/cu1xx/`) | ❌ | ❌ | ❌ |\n\n## Proposed changes\n\n### 1. Expand prebuilt wheel matrix (highest impact, smallest change)\n\nUpdate `CIBW_BUILD` in Metal/CUDA workflows and add free-threaded support. This is the single highest-impact change — it eliminates source builds for most users.\n\n**`build-wheels-metal.yaml`:**\n\nUpgrade `cibuildwheel` from `v2.22.0` to `v3.x` ([3.0 added cp314/cp314t support](https://cibuildwheel.pypa.io/en/stable/changelog/)). In cibuildwheel 3.0, cp314t is built by default (free-threading is no longer experimental in 3.14), and cp313t requires `CIBW_ENABLE: cpython-freethreading`.\n\n```diff\n-        uses: pypa/cibuildwheel@v2.22.0\n+        uses: pypa/cibuildwheel@v3.0.0\n         env:\n-          CIBW_BUILD: \"cp39-* cp310-* cp311-* cp312-*\"\n+          CIBW_BUILD: \"cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*\"\n+          CIBW_ENABLE: cpython-freethreading\n```\n\n**`build-and-release.yaml`** — same cibuildwheel upgrade, and update the `build_wheels_arm64` job:\n\n```diff\n-          CIBW_BUILD: \"cp38-* cp39-* cp310-* cp311-* cp312-*\"\n+          CIBW_BUILD: \"cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*\"\n+          CIBW_ENABLE: cpython-freethreading\n```\n\n**`build-wheels-cuda.yaml`** — uses a different build system (`python -m build --wheel` with a PowerShell matrix). The `pyver` matrix would need `\"3.13\", \"3.14\"` added.\n\nWith prebuilt wheels, any downstream project can use `uv`'s declarative index support:\n\n```toml\n# pyproject.toml — zero Makefile, zero CMAKE_ARGS\n[project]\ndependencies = [\"llama-cpp-python~=0.3\"]\n\n[tool.uv.sources]\nllama-cpp-python = [\n  { index = \"llama-metal\", marker = \"sys_platform == 'darwin'\" },\n  { index = \"llama-cpu\",   marker = \"sys_platform == 'linux'\" },\n]\n\n[[tool.uv.index]]\nname = \"llama-metal\"\nurl = \"https://abetlen.github.io/llama-cpp-python/whl/metal\"\nexplicit = true\n\n[[tool.uv.index]]\nname = \"llama-cpu\"\nurl = \"https://abetlen.github.io/llama-cpp-python/whl/cpu\"\nexplicit = true\n```\n\n### 2. Document `--config-settings` as the source-build path\n\nSince the build backend is `scikit-build-core`, cmake args can be passed via the standard PEP 517 config-settings interface:\n\n```bash\npip install llama-cpp-python -C cmake.args=\"-DGGML_METAL=on\"\n# or with uv:\nuv pip install llama-cpp-python -C cmake.args=\"-DGGML_METAL=on\"\n```\n\nThis is cleaner than the `CMAKE_ARGS` env var — it's the standard PEP 517 mechanism, more explicit, and discoverable. It's already supported via scikit-build-core but not documented in the README or install docs.\n\n### 3. (Future) Adopt PEP 817 Wheel Variants\n\n[PEP 817](https://peps.python.org/pep-0817/) (draft, Dec 2025) introduces a standard mechanism for GPU/accelerator wheel variants. PyTorch 2.9 already ships experimental variant-enabled wheels. Once PEP 817 is accepted and tool support lands, `llama-cpp-python` could publish variant wheels that are auto-selected by the installer:\n\n```bash\n# Future: just works, installer picks Metal/CUDA/CPU automatically\npip install llama-cpp-python\n```\n\nThis is mentioned for context only — the actionable items are (1) and (2) above.\n\n## Ecosystem context\n\n- **Quansight offered funded engineering help** for free-threaded support in #2103 (via vLLM ecosystem work) — awaiting maintainer signal\n- **~470K monthly PyPI downloads** ([pypistats](https://pypistats.org/packages/llama-cpp-python)) — every project using this beyond toy scripts hits this install wall\n- **How others solved it:** PyTorch uses per-backend index URLs + PEP 817 variants; ONNX Runtime publishes separate PyPI packages per backend (`onnxruntime-gpu`, `onnxruntime-silicon`)\n\n## Related\n\n**Wheel matrix gaps (same root cause):**\n- #2103 — Pre-built wheels for Python 3.14 and 3.14 free-threaded\n- #2130 — Pre-built CPU-only wheel for Windows (cp313)\n- #2068 — Where can I download wheel for CUDA 12.8?\n- #2091 — CUDA 12.8 wheel request\n\n**Wheel variants / long-term packaging:**\n- #2092 — Add support for experimental wheel variants (wheelnext)\n- #1506 — Multi-arch support for pre-built CPU wheel (by @abetlen)\n- [Discussion #1875](https://github.com/abetlen/llama-cpp-python/discussions/1875) — Automating pre-building of wheels for all platforms\n\n**Downstream impact of missing wheels:**\n- #2118 — Installation deadlock on Hugging Face Spaces (musl/glibc mismatch)\n- #2113 — No working wheels for Debian/Ubuntu\n\nHappy to submit a PR for (1) and (2).","author":{"url":"https://github.com/clemlesne","@type":"Person","name":"clemlesne"},"datePublished":"2026-03-07T17:13:39Z","url":"https://github.com/abetlen/llama-cpp-python/issues/2136"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c63d3c3a-0069-9ec3-654c-e8af6eb93523
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9418:3EC783:2B47C5:38041C:6AFF97FD
html-safe-nonce08de1783d1e794b08071ec1454cdddf3b5d71bd1828db8d57df4b25b0c3a4165
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDE4OjNFQzc4MzoyQjQ3QzU6MzgwNDFDOjZBRkY5N0ZEIiwidmlzaXRvcl9pZCI6IjU5OTQ4OTY0NzI4NzU3MDIyNjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf0ef4304b47486016687fc223d0172f53257951c52886b67f089715de01868d0
hovercard-subject-tagissue:4038960837
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/abetlen/llama-cpp-python/2136/issue_layout
twitter:imagehttps://opengraph.githubassets.com/da22f406b23de731bd23b4a4598f0ef8593fe00edfcb3b115a7705b4f3e95399/abetlen/llama-cpp-python/issues/2136
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/da22f406b23de731bd23b4a4598f0ef8593fe00edfcb3b115a7705b4f3e95399/abetlen/llama-cpp-python/issues/2136
og:image:altProblem Installing llama-cpp-python with a GPU backend requires setting CMAKE_ARGS as an environment variable at build time: CMAKE_ARGS="-DGGML_METAL=on" pip install llama-cpp-python This creates p...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameclemlesne
hostnamegithub.com
expected-hostnamegithub.com
None2c75d045e8c84b51e2ac680086a6dd1eeaf2bc15b82137d22ee5106835d6256c
turbo-cache-controlno-preview
go-importgithub.com/abetlen/llama-cpp-python git https://github.com/abetlen/llama-cpp-python.git
octolytics-dimension-user_id6826477
octolytics-dimension-user_loginabetlen
octolytics-dimension-repository_id617868717
octolytics-dimension-repository_nwoabetlen/llama-cpp-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id617868717
octolytics-dimension-repository_network_root_nwoabetlen/llama-cpp-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release525b66d22c4f7e6bb8b62934bec198964f7e8b93
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/abetlen/llama-cpp-python/issues/2136#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fabetlen%2Fllama-cpp-python%2Fissues%2F2136
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fabetlen%2Fllama-cpp-python%2Fissues%2F2136
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=abetlen%2Fllama-cpp-python
Reloadhttps://github.com/abetlen/llama-cpp-python/issues/2136
Reloadhttps://github.com/abetlen/llama-cpp-python/issues/2136
Reloadhttps://github.com/abetlen/llama-cpp-python/issues/2136
abetlenhttps://github.com/abetlen
llama-cpp-pythonhttps://github.com/abetlen/llama-cpp-python
Codehttps://github.com/abetlen/llama-cpp-python
Issues600 (600)https://github.com/abetlen/llama-cpp-python/issues
Pull requests122 (122)https://github.com/abetlen/llama-cpp-python/pulls
Discussionshttps://github.com/abetlen/llama-cpp-python/discussions
Actionshttps://github.com/abetlen/llama-cpp-python/actions
Projectshttps://github.com/abetlen/llama-cpp-python/projects
Security and quality1 (1)https://github.com/abetlen/llama-cpp-python/security
Insightshttps://github.com/abetlen/llama-cpp-python/pulse
https://github.com/abetlen/llama-cpp-python
New issuehttps://github.com/login?return_to=https://github.com/abetlen/llama-cpp-python/issues/2136
New issuehttps://github.com/login?return_to=https://github.com/abetlen/llama-cpp-python/issues/2136
Improve installation DX: prebuilt wheels for 3.13/3.14/3.14t + declarative backend selectionhttps://github.com/abetlen/llama-cpp-python/issues/2136#top
https://github.com/clemlesne
clemlesnehttps://github.com/clemlesne
on Mar 7, 2026https://github.com/abetlen/llama-cpp-python/issues/2136#issue-4038960837
build-wheels-metal.yamlhttps://github.com/abetlen/llama-cpp-python/blob/main/.github/workflows/build-wheels-metal.yaml
build-wheels-cuda.yamlhttps://github.com/abetlen/llama-cpp-python/blob/main/.github/workflows/build-wheels-cuda.yaml
build-and-release.yamlhttps://github.com/abetlen/llama-cpp-python/blob/main/.github/workflows/build-and-release.yaml
3.0 added cp314/cp314t supporthttps://cibuildwheel.pypa.io/en/stable/changelog/
PEP 817https://peps.python.org/pep-0817/
Pre-built wheels for Python 3.14 and 3.14 free-threaded #2103https://github.com/abetlen/llama-cpp-python/issues/2103
pypistatshttps://pypistats.org/packages/llama-cpp-python
Pre-built wheels for Python 3.14 and 3.14 free-threaded #2103https://github.com/abetlen/llama-cpp-python/issues/2103
Pre-built CPU-only wheel for Windows (cp313) for version 0.3.16+ (Gemma 3 support) #2130https://github.com/abetlen/llama-cpp-python/issues/2130
Where can I download wheel for Cuda 12.8? Trying to install llama.cpp to use with ComfyUI custom nodes. #2068https://github.com/abetlen/llama-cpp-python/issues/2068
cu128 wheel #2091https://github.com/abetlen/llama-cpp-python/issues/2091
Add support for experimental wheel variants (i.e., wheelnext) #2092https://github.com/abetlen/llama-cpp-python/issues/2092
Multi-arch support for pre-built cpu wheel #1506https://github.com/abetlen/llama-cpp-python/issues/1506
@abetlenhttps://github.com/abetlen
Discussion #1875https://github.com/abetlen/llama-cpp-python/discussions/1875
[Deployment Issue] Installation deadlock on Hugging Face Spaces (CPU): Wheels fail (musl/glibc mismatch) & Source builds timeout #2118https://github.com/abetlen/llama-cpp-python/issues/2118
Please add support or tell me if there are ANY wheels for llama.cpp that can run on debian/ubuntu #2113https://github.com/abetlen/llama-cpp-python/issues/2113
Sign up for freehttps://github.com/signup?return_to=https://github.com/abetlen/llama-cpp-python/issues/2136
Sign in to commenthttps://github.com/login?return_to=https://github.com/abetlen/llama-cpp-python/issues/2136
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.