# Inference endpoint, gated repo 401 error

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Finference-endpoint-gated-repo-401-error%2F97341%3E%5C
**Category:** Inference Endpoints on the Hub\
**Created:** [July 15, 2024, 3:08am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Finference-endpoint-gated-repo-401-error%2F97341 "2024-07-15T03:08:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RedFoxPanda](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/redfoxpanda/32/29358_2.png) [@RedFoxPanda](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FRedFoxPanda)%5C
**Post date:** [July 15, 2024, 3:08am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Finference-endpoint-gated-repo-401-error%2F97341%2F1 "2024-07-15T03:08:22Z")

</div>

I’m using the inference endpoints website to host a fine tuned model. Initialization fails and tells me that I don’t have authorization to gated repos, yet I should have access.

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/0/d/0d8f6fe2f5f89a6d5f27686cde614ecea97d0a0a.png)

I’ve tried mistral and llama fine tuned models. I’ve tried AWS and Google server options.

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/9/1/918dd56b37be4de5d0097e5561687e4cb8927144.png)

I do have an “access token” associated with my hugging face account so that I can pay for services like CPUs/GPUs, inference endpoint servers, etc.

![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/7/d/7d2faf35999639c4fbe92dd0e07c0e8fc0b66280.png)

---

<div class="post-metadata">

**Author:** ![meganariley](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/meganariley/32/56966_2.png) [@meganariley](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmeganariley)%5C
**Post date:** [July 19, 2024, 6:53pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Finference-endpoint-gated-repo-401-error%2F97341%2F2 "2024-07-19T18:53:22Z")

</div>

Hi @RedFoxPanda In Inference Endpoints, you now have the ability to add an env variable to your endpoint, which is needed if you’re deploying a fine-tuned gated model like Meta-Llama-3-8B-Instruct.

We have some additional documentation on [environment variables](https://huggingface.co/docs/huggingface_hub/en/package_reference/environment_variables) but the one you’d likely need is [HF\_TOKEN](https://huggingface.co/docs/huggingface_hub/en/package_reference/environment_variables#hftoken). You can add the HF\_TOKEN as the key and your [user access token](https://huggingface.co/docs/hub/security-tokens) as the value. User access tokens can be generated in the [settings](https://huggingface.co/settings/tokens) of your account.

Please let me know if you have additional questions!

---

<div class="post-metadata">

**Author:** ![RedFoxPanda](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/redfoxpanda/32/29358_2.png) [@RedFoxPanda](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FRedFoxPanda)%5C
**Post date:** [July 24, 2024, 5:36pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Finference-endpoint-gated-repo-401-error%2F97341%2F4 "2024-07-24T17:36:50Z")

</div>

![test](https://us1.discourse-cdn.com/hellohellohello/original/3X/8/a/8a14aa22919c2412154f9d85c072bd587ba8be54.jpeg)

This did work. I then had some type of error due to not having enough memory and I upgraded to a higher level gpu/cpu for the cloud computer. “Running” status is now present. Thanks.

---

<div class="post-metadata">

**Author:** ![meganariley](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/meganariley/32/56966_2.png) [@meganariley](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmeganariley)%5C
**Post date:** [July 24, 2024, 10:03pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Finference-endpoint-gated-repo-401-error%2F97341%2F5 "2024-07-24T22:03:43Z")

</div>

@RedFoxPanda I’m glad to hear it! Thanks for letting me know. 🤗

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsystem)%5C
**Post date:** [July 25, 2024, 10:04am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Finference-endpoint-gated-repo-401-error%2F97341%2F6 "2024-07-25T10:04:04Z")

</div>

Closed on July 25, 2024, 10:04am UTC

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
