Skip to content

Fix llama.cpp Studio update failures on GitHub API rate limits (#9970) - #9980

Merged
oobabooga merged 13 commits into
unslothai:mainfrom
Souravrajvi0:feat/llama-update-rate-limit-8196
Sep 1, 2026
Merged

oobabooga merged 13 commits into
unslothai:mainfrom
Souravrajvi0:feat/llama-update-rate-limit-8196

Conversation

@Souravrajvi0

@Souravrajvi0 Souravrajvi0 commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #9970

Root cause

  1. Studio in-app update pins --published-release-tag, which always used the GitHub API to resolve release metadata.
  2. Without GH_TOKEN / GITHUB_TOKEN, unauthenticated calls hit HTTP 403 rate limits.
  3. Installer exits 2 (EXIT_FALLBACK). On Windows, the in-app updater does not source-build (unlike setup.ps1), so the update fails.
  4. The UI showed a garbled PATH dump because stream_installer kept only the last 1500 chars of stdout, hiding the real prebuilt fallback reason: ... set GH_TOKEN line.

Fix

  1. Route pinned release-tag updates through the existing download-host CDN path (no api.github.com in the common case).
  2. Prefer actionable installer lines (prebuilt fallback reason, rate-limit hints) over raw stdout tail.
  3. Map installer exit 2 to a clear rate-limit message in the updater.

Testing

  • 18 targeted pytest cases pass (CDN routing, error formatting, updater message).
  • Reproduced original failure mode (mocked 403 + PATH tail) before fix; verified behavior after.

…thai#9970)

Route pinned release-tag updates through the download-host CDN path so
in-app updates avoid api.github.com entirely. When the prebuilt installer
still fails, surface the fallback reason instead of a truncated PATH dump,
and map exit 2 to an actionable rate-limit message in the updater.
@Souravrajvi0

Souravrajvi0 commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Reproduced on my side. Pinned --published-release-tag was going through api.github.com, 403 without a token, and the UI only showed the tail of stdout (PATH dump) instead of the rate limit line.

Fix: route pinned tags through the CDN path we already use for latest, and pull the fallback reason before truncating the error. Tests included.

@Souravrajvi0 Souravrajvi0 mentioned this pull request Aug 29, 2026
4 tasks
@danielhanchen

Copy link
Copy Markdown
Member

Confirmed the pinned --published-release-tag path in studio/install_llama_prebuilt.py still returns before the download-host fast path, so in-app updates always go through api.github.com, and the tail-only error hides the 403 line. Will get this reviewed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-01T19:22:34.994039Z 923950f Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 5c1c2036b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 276a93985f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@oobabooga

Copy link
Copy Markdown
Member

Reviewed and pushed one commit to this branch (5c1c203) for the two points Codex raised:

  • stream_installer now records the actionable installer lines as they stream and format_installer_failure_message reads those before the tail. The 80-line tail was not enough to hold the reason on a Linux CUDA host, where the system report adds the selection log, up to 20 lines of nvidia-smi and the full ldd listing after it. Regression test runs a real installer process that prints the fallback reason followed by 300 report lines.
  • The reason line is matched by prefix pattern instead of the [llama-prebuilt] prefix alone, and the rate-limit text says "prebuilt releases". prebuilt_core raises the same "GitHub API returned 403" message for both installers, and whisper_cpp_update shares stream_installer, so a whisper.cpp update was reporting a llama.cpp failure.

I checked the CDN routing separately: the in-app updater runs the install path, so a pinned tag now reaches iter_resolved_published_releases and the download-host fast path. macOS (allow_download_host_fast_path = False), a non-default --published-repo, UNSLOTH_LLAMA_DISABLE_DOWNLOAD_HOST_RESOLVE, and any CDN rejection still fall through to pinned_published_release_bundle, so the API path keeps its old behavior. Note that resolve_published_release, used by --resolve-install-tag and --resolve-source-build, still goes through the API for a pinned tag; that is outside the update flow this PR fixes.

Backend CI is red on two tests unrelated to this change (tests/test_torchao_select.py::test_skips_torchao_on_windows_rocm and tests/studio/install/test_install_manifest_damage.py::test_an_unimportable_helper_forces_the_dependency_pass[absent-keeps-the-fast-path]); both fail the same way on main. The Core jobs hit the 35 minute job timeout, which is also happening on main. Everything else on the head commit is green.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: ff571fc580

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@oobabooga

Copy link
Copy Markdown
Member

Verified the routing change end to end on a Linux CUDA host, with every api.github.com request answered 403 rate limit exceeded at the HTTP layer (the failure in #9970):

  • Pre-PR code, --llama-tag latest --published-release-tag b10679-mix-67dfc8b: 4 API attempts, then prebuilt fallback reason: ... GitHub API returned 403 ... and exit 2, byte for byte the reproduction in the issue.
  • This branch, same command: 0 api.github.com requests, install completes, marker records release_tag=b10679-mix-67dfc8b, so the updater's pin assertion holds. Same result for the update-over-existing-install path with a newer pin. The installed llama-server runs and serves completions on the GPU.

Routing edge cases, all with the API blocked: macOS walk-back (allow_download_host_fast_path=False), UNSLOTH_LLAMA_DISABLE_DOWNLOAD_HOST_RESOLVE=1, and a non-default --published-repo still take the API path, so the escape hatches behave as before. A pin that does not exist on the CDN falls back to the API. A pin that does not match the requested tag raises the same targeted upstream tag ... but requested ... fallback, now without an API call. Unpinned latest and unpinned non-latest are unchanged.

Also compared CDN-resolved and API-resolved bundles for five real releases (b10715, b10679, b10639, b10360, b10333): identical release tag, upstream tag, source commit, artifact set and checksum set. The one difference is an extra llama.cpp-source-commit-*.tar.gz in the API asset list on b10360, which nothing reads through bundle.assets (source archive URLs are built from the checksum payload).

Three follow-up commits on top of the original change:

  • 5c1c2036b keeps the verdict line out of the 80-line tail.
  • 83c75a1c1 reports the last verdict line rather than an earlier rate-limit retry, and keeps retry lines in a separate bucket so they cannot crowd the verdict out.
  • ff571fc58 requires GitHub evidence before giving GH_TOKEN advice (the huggingface.co validation-model 429 also exits 2), and covers GitHub's 429 rate-limit status.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 1, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 1, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 1, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 1, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 1, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 1, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 1, 2026
@oobabooga

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 0eaa7463ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@oobabooga

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 923950f9f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@oobabooga

Copy link
Copy Markdown
Member

Thanks @Souravrajvi0. I verified the routing change with every api.github.com request forced to fail: on main the pinned update stops after four attempts and exits 2, on this branch it installs with zero API calls, and the marker and llama-server binary come out identical to the API path.

I pushed four follow-ups on top of your commit, covering the two Codex rounds and my own review: keeping the installer's verdict out of the bounded output tail, reporting that verdict rather than an earlier rate-limit retry, recognizing GitHub's 429 alongside 403, and only claiming a GitHub rate limit on GitHub evidence so a huggingface.co failure or an already-authenticated run gets advice it can act on.

Asset selection is unchanged across fourteen host shapes (CUDA, ROCm, Vulkan, CPU, Windows, macOS), and macOS still takes the old API path. I exercised the update flow live in Studio for the success case and three failure shapes; no AMD hardware was available, though the ROCm host shapes resolve identically on both paths and the PR changes no detection or selection code.

@oobabooga
oobabooga merged commit 1a7e11b into unslothai:main Sep 1, 2026
60 of 62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] llama update failed

3 participants