From a834acf90a0f92960324c1cb08929975336a2342 Mon Sep 17 00:00:00 2001 From: mtrujillo <42344046+trujillm@users.noreply.github.com> Date: Wed, 15 Oct 2025 17:27:30 -0400 Subject: [PATCH 1/4] add logic to check login for HF --- .../vllm-inference-service/templates/inference-service.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/all/vllm-inference-service/templates/inference-service.yaml b/charts/all/vllm-inference-service/templates/inference-service.yaml index 8d63b817..358be306 100644 --- a/charts/all/vllm-inference-service/templates/inference-service.yaml +++ b/charts/all/vllm-inference-service/templates/inference-service.yaml @@ -37,7 +37,8 @@ spec: import os token = os.environ.get("HF_TOKEN") model = os.environ.get("MODEL_ID") - login(token=token) + if token: + login(token=token) snapshot_download( repo_id=model, local_dir="/cache/models" From 0859d8c9db2109bfff61985d2eb567226f17deee Mon Sep 17 00:00:00 2001 From: mtrujillo <42344046+trujillm@users.noreply.github.com> Date: Sun, 19 Oct 2025 19:42:21 -0400 Subject: [PATCH 2/4] update check for hf_token --- .../vllm-inference-service/templates/inference-service.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/all/vllm-inference-service/templates/inference-service.yaml b/charts/all/vllm-inference-service/templates/inference-service.yaml index 358be306..2aa29318 100644 --- a/charts/all/vllm-inference-service/templates/inference-service.yaml +++ b/charts/all/vllm-inference-service/templates/inference-service.yaml @@ -35,10 +35,13 @@ spec: python - <<'PY' from huggingface_hub import snapshot_download, login import os - token = os.environ.get("HF_TOKEN") + token = os.environ.get("HF_TOKEN", "").strip() model = os.environ.get("MODEL_ID") if token: + print("HF_TOKEN found, logging in to Hugging Face...") login(token=token) + else: + print("No HF_TOKEN found, downloading model without authentication...") snapshot_download( repo_id=model, local_dir="/cache/models" From f59f8490c0bb20b440add98a89abfec40888507f Mon Sep 17 00:00:00 2001 From: mtrujillo <42344046+trujillm@users.noreply.github.com> Date: Sun, 19 Oct 2025 19:59:48 -0400 Subject: [PATCH 3/4] add optional for secret --- .../all/vllm-inference-service/templates/inference-service.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/all/vllm-inference-service/templates/inference-service.yaml b/charts/all/vllm-inference-service/templates/inference-service.yaml index 2aa29318..f537d553 100644 --- a/charts/all/vllm-inference-service/templates/inference-service.yaml +++ b/charts/all/vllm-inference-service/templates/inference-service.yaml @@ -55,6 +55,7 @@ spec: secretKeyRef: name: huggingface-secret key: hftoken + optional: true - name: MODEL_ID value: {{ .Values.global.model.vllm | quote }} volumeMounts: From 2575da4f1517cbad53375c5b257394cc4e7385fb Mon Sep 17 00:00:00 2001 From: mtrujillo <42344046+trujillm@users.noreply.github.com> Date: Mon, 20 Oct 2025 08:29:55 -0400 Subject: [PATCH 4/4] updating login logic check --- .../templates/inference-service.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/charts/all/vllm-inference-service/templates/inference-service.yaml b/charts/all/vllm-inference-service/templates/inference-service.yaml index f537d553..d7da50ee 100644 --- a/charts/all/vllm-inference-service/templates/inference-service.yaml +++ b/charts/all/vllm-inference-service/templates/inference-service.yaml @@ -35,13 +35,15 @@ spec: python - <<'PY' from huggingface_hub import snapshot_download, login import os - token = os.environ.get("HF_TOKEN", "").strip() + raw_token = os.environ.get("HF_TOKEN", "") + token = raw_token.strip() model = os.environ.get("MODEL_ID") - if token: - print("HF_TOKEN found, logging in to Hugging Face...") - login(token=token) + if not token or not token.startswith("hf_"): + print("[HF] HF_TOKEN empty or invalid format; skipping login") + os.environ.pop("HF_TOKEN", None) else: - print("No HF_TOKEN found, downloading model without authentication...") + print("[HF] HF_TOKEN present; attempting login") + login(token=token) snapshot_download( repo_id=model, local_dir="/cache/models"