# Deploy an ML model and make it accessible as an API

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-an-ml-model-and-make-it-accessible-as-an-api%2F114319%3E%5C
**Category:** Beginners\
**Created:** [October 28, 2024, 9:05am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-an-ml-model-and-make-it-accessible-as-an-api%2F114319 "2024-10-28T09:05:03Z")\
**Posts on this page:** 11\
**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:** [October 28, 2024, 9:05am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-an-ml-model-and-make-it-accessible-as-an-api%2F114319%2F1 "2024-10-28T09:05:03Z")

</div>

Hello,

Can anyone recommend a cost-effective platform to deploy our RAG model and make it available as an API for ongoing use?

---

<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:** [October 28, 2024, 11:35am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-an-ml-model-and-make-it-accessible-as-an-api%2F114319%2F2 "2024-10-28T11:35:02Z")

</div>

Would it be something like this?

> **[Advanced RAG on Hugging Face documentation using LangChain - Hugging Face...](https://huggingface.co/learn/cookbook/advanced_rag)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> **[Build an Agentic RAG using HuggingFace Transformers Agent](https://medium.com/the-ai-forum/build-an-agentic-rag-using-huggingface-transformer-agent-ec741f09ddcc)**
>
> Introduction

> **[Implementing RAG with Langchain and Hugging Face](https://medium.com/@akriti.upadhyay/implementing-rag-with-langchain-and-hugging-face-28e3ea66c5f7)**
>
> Using Open Source for Information Retrieval

---

<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:** [October 28, 2024, 12:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-an-ml-model-and-make-it-accessible-as-an-api%2F114319%2F3 "2024-10-28T12:10:47Z")

</div>

Yes, I’m implementing this, but instead of deploying it as a web app or chatbot, I want to use it purely as an API.

---

<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:** [October 28, 2024, 12:14pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-an-ml-model-and-make-it-accessible-as-an-api%2F114319%2F4 "2024-10-28T12:14:59Z")

</div>

If so, the cheapest way is to deploy it as a web app and use it from the Gradio client.  
The Endpoint API is probably faster and smarter, but there is a fee.

> **[Hub API Endpoints](https://huggingface.co/docs/hub/api)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> **[Getting Started With The Python Client](https://www.gradio.app/guides/getting-started-with-the-python-client)**
>
> A Step-by-Step Gradio Tutorial

---

<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:** [October 28, 2024, 12:18pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-an-ml-model-and-make-it-accessible-as-an-api%2F114319%2F5 "2024-10-28T12:18:02Z")

</div>

can we make an API using LangServe and use that API in c# code …???

---

<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:** [October 28, 2024, 12:20pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-an-ml-model-and-make-it-accessible-as-an-api%2F114319%2F6 "2024-10-28T12:20:08Z")

</div>

Gradio can be used from curl, for example, so of course you can get by with C#…  
About Endpoint, I’ve never used Endpoint, but maybe you can?

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

---

<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:** [October 28, 2024, 12:25pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-an-ml-model-and-make-it-accessible-as-an-api%2F114319%2F7 "2024-10-28T12:25:33Z")

</div>

Yes, Thanks

But do you have any idea about Lang Serve using which we can create an Fast API and also use it as an REST API, actually i am not sure about this want some guidance on this

---

<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:** [October 28, 2024, 12:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-an-ml-model-and-make-it-accessible-as-an-api%2F114319%2F8 "2024-10-28T12:32:18Z")

</div>

> **[GitHub - langchain-ai/langserve: LangServe 🦜️🏓](https://github.com/langchain-ai/langserve)**
>
> LangServe 🦜️🏓

I don’t know anything about Lang Serve, but from my search, it seems to be intended for use with Cloud Run and the like. Or maybe Amazon AWS?  
I’m not familiar with cloud services…  
As for FastAPI, the backend of Gradio should also be FastAPI, so it should be basically the same for HF.

---

<div class="post-metadata">

**Author:** ![mahmutc](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mahmutc/32/64626_2.png) [@mahmutc](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmahmutc)%5C
**Post date:** [October 28, 2024, 12:37pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-an-ml-model-and-make-it-accessible-as-an-api%2F114319%2F9 "2024-10-28T12:37:34Z")

</div>

I hope this will give some extra information:

> **[🦜️🏓 LangServe | 🦜️🔗 LangChain](https://python.langchain.com/docs/langserve/#endpoints)**
>
> Release Notes

---

<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:** [October 28, 2024, 12:37pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-an-ml-model-and-make-it-accessible-as-an-api%2F114319%2F10 "2024-10-28T12:37:56Z")

</div>

Thanks, this information helps me a lot.

---

<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:** [October 29, 2024, 12:38am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploy-an-ml-model-and-make-it-accessible-as-an-api%2F114319%2F11 "2024-10-29T00:38:37Z")

</div>

Closed on October 29, 2024, 12:38am UTC

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