# How to use llm model's api?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-use-llm-models-api%2F115961%3E%5C
**Category:** Beginners\
**Created:** [November 6, 2024, 8:41am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-use-llm-models-api%2F115961 "2024-11-06T08:41:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![riddhi810](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@riddhi810](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Friddhi810)%5C
**Post date:** [November 6, 2024, 8:41am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-use-llm-models-api%2F115961%2F1 "2024-11-06T08:41:42Z")

</div>

Hello,

I’m working with a RAG system that uses a Hugging Face model. However, the Llama models are too large to load locally. Is there a way to use the model’s API instead of loading it directly, and if so, how?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [November 6, 2024, 8:48am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-use-llm-models-api%2F115961%2F2 "2024-11-06T08:48:25Z")

</div>

> **[Serverless Inference API](https://huggingface.co/docs/api-inference/index)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> **[Inference Endpoints](https://huggingface.co/docs/inference-endpoints/index)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

There are two main ways to do this. The **Serverless Inference API** is free to use, but it’s difficult to use it reliably. The **Endpoint API** is stable, but it’s not free.  
There are also other services that use HF models with other companies’ APIs, but I don’t know much about them.  
There is a Playground where you can actually use the Inference API, so you can try it out there.

> **[Inference Playground - a Hugging Face Space by huggingface](https://huggingface.co/spaces/huggingface/inference-playground)**
>
> Discover amazing ML apps made by the community

---

<div class="post-metadata">

**Author:** ![Applegoat782](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/applegoat782/32/34904_2.png) [@Applegoat782](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FApplegoat782)%5C
**Post date:** [November 14, 2024, 6:42pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-use-llm-models-api%2F115961%2F3 "2024-11-14T18:42:47Z")

</div>

[deleted for posting spam content]
