# Gated and private Hugging Face repos

> Accept the model's terms on Hugging Face, add a Hugging Face read token to BitsRun once, and deploy as usual; the files are copied into your private storage first.

Source: https://bitsrun.com/docs/models/gated-repos/
Updated: 2026-11-09

Some repos are **gated**: the author, for example Meta for Llama or Google for Gemma, asks you to accept their terms before you can download. **Private** repos are visible only to their owner or organization. BitsRun can deploy both with your Hugging Face token.

## Steps

1. Sign in at huggingface.co and open the model page. Select the button to accept the terms. Some authors review requests, so access may take a while.
2. Create a **read** token at [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens) with the account that accepted the terms.
3. In the BitsRun dashboard, open **API keys**, scroll to **Hugging Face token**, paste it and select **Save token**.
4. Deploy the repo as usual, for example `hf:meta-llama/Llama-3.1-8B-Instruct`.

In the terminal:

```bash
bitsrun hf-token set
bitsrun deploy hf:meta-llama/Llama-3.1-8B-Instruct
```

`bitsrun hf-token set` asks for the token without showing it. In scripts, pipe it in: `echo "$HF_TOKEN" | bitsrun hf-token set`.

## What happens after you deploy

1. BitsRun checks your token can read the repo.
2. It copies the model files into your private storage. The endpoint card shows **Copying the model** with progress. Large models take a few minutes.
3. When the copy finishes, the endpoint turns ready by itself and wakes on the first request (or starts at once if you ticked **Start it when the copy finishes**).

Requests are refused while the copy runs, and no GPU time is billed. The copy counts toward your [model storage](https://bitsrun.com/docs/billing/storage/), so you need a positive balance to start one. You can have 2 copies running at once.

## How we handle your token

- We check it with Hugging Face before saving it.
- It is stored encrypted and never shown again. The dashboard only shows its last characters.
- It is used only to read and copy the repos you deploy.
- Remove it any time with **Remove** on the API keys page or `bitsrun hf-token rm`. Models you already copied stay in your storage.

## What can go wrong

| Message | What to do |
|---|---|
| "This Hugging Face repo is gated" | Accept the terms on the repo page, add your token, then deploy again. |
| "Your Hugging Face account does not have access to this repo yet." | The author has not approved your request yet. Wait for their email, then deploy again. |
| "Hugging Face did not accept this token." | Create a new read token and paste it again. |
| "We are copying this model into your private storage." | A copy of this model is already running. Deploy again when it is ready. |
| "You already have 2 models copying into your storage." | Wait for one to finish. |
| "We could not copy this model from Hugging Face." | Select **Try again** on the card (parts already copied are not charged again), or run `bitsrun retry <endpoint>`. |
