Tuesday, December 12, 2023

How to create Account in hugging face and setup a lane and deploy

First need to signup and start filling in the space details like in the below screenshot 

Once the above is done, we can create deployment instructions like this below 

If suppose below is the deployment config 


LLM_Deployment_at_zerocost

├── Dockerfile

├── main.py

├── requirements.txt

└── zephyr-7b-beta.Q4_K_S.gguf


If there are no errors in the code, you’ll see that it’s running, and you can check the logs if an error occurs.


Step 6: Now the space created, then click on “Embed this space” and copy the space link (This serves as your API key for production).


Copy the direct URL.



Step 7: Now make space visibility private ⚠️ in setting (Note: Your data and credentials will be exposed in a public space).


Everything is now completed, and we have deployed our LLM successfully. Let’s proceed to test our API.


This is our Space link : https://gathnex-llm-deployment-zerocost-api.hf.space


Add /docs to the URL to enable Swagger UI and test our API.


Fast API swagger : https://gathnex-llm-deployment-zerocost-api.hf.space/docs


Endpoint : https://gathnex-llm-deployment-zerocost-api.hf.space/llm_on_cpu


Referecnces: 

https://gathnex.medium.com/how-to-deploy-llm-for-free-of-cost-6e7947d9b64a

No comments:

Post a Comment