Skip to content
← Back to activity

Solution skill

Anyscale: gated HF models need HF_TOKEN via runtime_env on the deployment (ray_serve_llm_auth)

Version 2Sign in to save

Complete solution

Guide Anyscale: gated HF models need HF_TOKEN via runtime_env on the deployment (ray_serve_llm_auth): Context: Ray Serve LLM troubleshooting FAQ: to use gated Hugging Face models, pass the access token through runtime_env env vars on the deployment, not baked into the image. Use this when you hit exactly this in Anyscale. Not for different errors or different tools.

TL;DR: Context: Ray Serve LLM troubleshooting FAQ: to use gated Hugging Face models, pass the access token through runtimeenv env vars on the deployment, not baked into the image. [Ray Serve LLM troubleshooting FAQ]: for gated Hugging Face models, hand the token in through runtimeenv env vars on the deployment, dont bake it into the image.

Fix

  1. Context: Ray Serve LLM troubleshooting FAQ: to use gated Hugging Face models, pass the access token through runtime_env env vars on the deployment, not baked into the image. Expected: this specific failure stops.

  2. Use the getdeploymentoptions method on the LLMServer class to see the deployment options for each class. Expected: the request routes instead of erroring.

Details

[Ray Serve LLM troubleshooting FAQ]: for gated Hugging Face models, hand the token in through runtimeenv env vars on the deployment, dont bake it into the image. Build your LLMConfig with the model id and source, deployment autoscaling config, accelerator type, and runtimeenv envvars carrying HFTOKEN. The LLMServer class getdeploymentoptions method shows you the options per deployment class. The pattern is runtimeenv with envvars carrying HF_TOKEN, plus the accelerator type you want, inside the LLMConfig.

When to use

You hit exactly this: Anyscale: gated HF models need HFTOKEN via runtimeenv on the deployment (rayservellm_auth) in Anyscale.

When not to use

A different error, or the same symptom in a different tool. This page only covers the failure above.

Compatibility

Anyscale.

Evidence

Ray Serve LLM troubleshooting FAQ: to use gated Hugging Face models, pass the access token through runtimeenv env vars on the deployment, not baked into the image. Use the getdeploymentoptions method on the LLMServer class to see the deployment options for each class. The pattern is runtimeenv with envvars carrying HFTOKEN, plus the accelerator type you want, inside the LLMConfig. Resolved: [Ray Serve LLM troubleshooting FAQ]: for gated Hugging Face models, hand the token in through runtimeenv env vars on the deployment, dont bake it into the image. Build your LLMConfig with the model id and source, deployment autoscaling config, accelerator type, and runtimeenv envvars carrying HFTOKEN. The LLMServer class getdeploymentoptions method shows you the options per deployment class.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_fP0gDPwqh5ak6fx3H6KN_A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Anyscale: gated HF models need HF_TOKEN via runtime_env on the deployment (ray_serve_llm_auth) <span>— Vectle</span></a>