From d61d2b08e99e311976d6622a991de7603034b174 Mon Sep 17 00:00:00 2001 From: elvischenv <219235043+elvischenv@users.noreply.github.com> Date: Mon, 16 Mar 2026 20:09:27 +0800 Subject: [PATCH] [Build] Fix API rate limit exceeded when using `VLLM_USE_PRECOMPILED=1` (#36229) Signed-off-by: elvischenv <219235043+elvischenv@users.noreply.github.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> --- setup.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index d5782a81d8..a809c66c83 100644 --- a/setup.py +++ b/setup.py @@ -657,13 +657,18 @@ class precompiled_wheel_utils: def get_base_commit_in_main_branch() -> str: try: # Get the latest commit hash of the upstream main branch. - resp_json = subprocess.check_output( - [ - "curl", - "-s", - "https://api.github.com/repos/vllm-project/vllm/commits/main", + curl_cmd = [ + "curl", + "-s", + "https://api.github.com/repos/vllm-project/vllm/commits/main", + ] + github_token = os.getenv("GH_TOKEN", os.getenv("GITHUB_TOKEN")) + if github_token: + curl_cmd += [ + "-H", + f"Authorization: token {github_token}", ] - ).decode("utf-8") + resp_json = subprocess.check_output(curl_cmd).decode("utf-8") upstream_main_commit = json.loads(resp_json)["sha"] print(f"Upstream main branch latest commit: {upstream_main_commit}")