Repository navigation
Studio: stop re-fetching every llama.cpp release from the GitHub API - #10461
danielhanchen merged 7 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Review + GitHub Actions reproductionPinned review: I staged fresh upstream
The last row is the guard that a reachable reset is still waited for. The PR's three test files also run in both jobs: 392 passed on the The red Conclusion: the per-release API traffic and the false "no prebuilt" verdict reproduce on |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Confirmed the walk still calls github_release per release in studio/install_llama_prebuilt.py, so a token-less install burns the anonymous API budget and then reports no prebuilt found; reading the assets from the listing looks right and I will get this reviewed. |
Reviewing this change against main with a fake transport that counts real api.github.com requests: the walk drops from 1 + N to 1 request, the parsed checksums and asset maps come out byte identical, and the unslothai#10449 shape (listing fine, every /releases/tags 403) goes from 13 requests plus a false "no usable published llama.cpp releases" to 1 request and all releases resolved. The one behaviour change that showed up: reading assets from the listing judges a release on that snapshot, so a release still being published (sha256 asset not uploaded yet) is now skipped instead of picked up by a fresh per-tag lookup. The walk-back handles it correctly, so this adds a test pinning that it degrades to the next good release rather than failing the resolution. Also two traps next to the code this touches: - _RATE_LIMIT_WAIT_CAP_SECONDS in install_llama_prebuilt.py was a literal copy, but _http_error_retry_delay reads prebuilt_core's global, so editing the copy did nothing. Now that the cap decides whether a 403 is retried at all and not just how long the backoff waits, make it an alias so it cannot drift. - test_fast_path_rejected_checksum_falls_back_to_api stubbed _download_host_resolved_release with a one-argument function while it is called as (repo, tag). The TypeError hit the same broad except that catches PrebuiltFallback, so the test passed without the branch it names ever running.
Reviewed with a base-vs-head differentialI reviewed this by running
The false verdict in row 2 is exactly what #10449 reported, and it reproduces on Validation is not weakened to buy that: dumping the fully parsed I also checked the assumption the change rests on, that the listing's inline 403 classification, every shapeBoth
Every narrowed case falls through to the source build, which is faster than waiting out a reset that is over the 60 s cap, so I am satisfied this is the right trade. Two notes rather than objections: a headerless 403 is GitHub's secondary-limit shape, and retrying it four times over 5.25 s was never going to clear it; and a 429 with a far reset still burns four attempts because 429 stays in CompatibilityNothing to migrate for existing installs: no on-disk metadata format changes, and the installed llama.cpp is untouched. Version skew is not reachable either. The resolution path is upstream of all platform and accelerator selection, and running the two scenarios above across [Linux, WSL, macOS, Windows] x [NVIDIA, AMD, CPU-only] gives identical counts in all 12 combinations: 4/3/3 on
What I pushedOne behaviour change did show up, and it is the only one: reading assets from the listing judges a release on that snapshot, so a release still being published, sha256 asset not uploaded yet, is skipped here where I also fixed two traps sitting next to this code:
Approach and change look right to me. |
Opening comment-reduction pass: 12 added comment lines down to 4, each surviving line naming the mistake the next reader would otherwise make.
|
@codex security review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Cross-platform validation, convergedCodex has approved the head commit. Closing the loop with the cross-platform run, since this touches the installer on every OS. Ran the PR's install test files per OS plus a live Studio Playwright leg on an owned staging repo, so the org queue was spared:
One thing worth recording for whoever reads this later. The first windows-latest leg came back with 21 failures, and none of them were this PR: 18 were The other red job on the staging run, Nothing further from me on this one. |
Fixes #10449.
When the installer looks for a prebuilt llama.cpp release, it already gets the full list of releases and their files from GitHub in one request. It then went back to GitHub once more for every single release to ask for the same files again. That extra request per release was enough to use up the free GitHub API limit on its own, and once the limit was hit, each remaining release was still tried four more times with waits in between. For the report in the issue that meant over a hundred requests and a few minutes of waiting, and the final error said no compatible prebuilt was found, which was not true.
This change reads the file list from the release listing it already has, so the walk through releases now makes one request instead of one per release. A GitHub 403 is only retried when GitHub says the limit resets soon enough to wait for, otherwise it fails right away. Because of that, a rate limit now shows up as a rate limit with the GH_TOKEN hint instead of being reported as a missing prebuilt, and the update check no longer caches a false "no prebuilt" answer for a day.
Tested on a Mac against the real GitHub API without a token: three releases resolved with two requests total, both for the listing pages. The install and backend test suites pass with four new tests covering this.