# Gateway Problem

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgateway-problem%2F132423%3E%5C
**Category:** Beginners\
**Created:** [December 20, 2024, 11:22am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgateway-problem%2F132423 "2024-12-20T11:22:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoseLuisNeves](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@JoseLuisNeves](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJoseLuisNeves)%5C
**Post date:** [December 20, 2024, 11:22am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgateway-problem%2F132423%2F1 "2024-12-20T11:22:12Z")

</div>

I bought huggingface pro. I am trying to use the model microsoft/Phi-3-mini-128k-instruct on HuggingFace’s Serverless API since yesterday through the following code:

response = self.client.chat.completions.create(  
model=self.model\_name,  
messages=[{“role”: “user”, “content”: prompt}],  
temperature=0,  
max\_tokens=300  
)  
However, I keep having the same errors:  
 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/f/a/fa04e85145cabc1369320ed8cf93dfebce83e328.png)  
and  
504 Server Error: Gateway Time-out for url: [/static-proxy?url=https%3A%2F%2Fapi-inference.huggingface.co%2Fmodels%2Fmicrosoft%2FPhi-3-mini-128k-instruct%2Fv1%2Fchat%2Fcompletions%5D(https%3A%2F%2Fapi-inference.huggingface.co%2Fmodels%2Fmicrosoft%2FPhi-3-mini-128k-instruct%2Fv1%2Fchat%2Fcompletions)

I tried other models such as meta-llama/Llama-3.2-1B and I keep having the same problem. In the midst of the errors, there were like one or two sucessful requests. Is this normal?

---

<div class="post-metadata">

**Author:** ![gregstone](https://avatars.discourse-cdn.com/v4/letter/g/958977/32.png) [@gregstone](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fgregstone)%5C
**Post date:** [January 5, 2025, 7:07pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgateway-problem%2F132423%2F2 "2025-01-05T19:07:10Z")

</div>

I am getting the same thing.

---

<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:** [January 7, 2025, 6:55pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgateway-problem%2F132423%2F3 "2025-01-07T18:55:46Z")

</div>

Hi @JoseLuisNeves The model microsoft/Phi-3-mini-128k-instruct is not loaded on the serverless API, but you can use this model with [Inference Endpoints](https://huggingface.co/docs/inference-endpoints/index). Inference Endpoints allows you to easily [deploy your models](/static-proxy?url=https%3A%2F%2Fendpoints.huggingface.co%2Fnew) on dedicated, fully-managed infrastructure, and will give you the flexibility to quickly create endpoints on CPU or GPU resources. It’s [billed](https://huggingface.co/docs/inference-endpoints/pricing) by compute uptime vs character usage.
