-
Notifications
You must be signed in to change notification settings - Fork 282
Support Huggingface Inference API #140
Comments
the Huggingface_hub integration via langchain might provide an alternate route. |
Here is some typescript / nextjs code snippets: Create a new file in the pages/api directory. huggingface.ts:
Call this API route from your Next.js pages or components like this:
|
@sjdthree https://huggingface.co/spaces/ysharma/Explore_llamav2_with_TGI |
Yes, I like it! I see Replicate.com as similar to Huggingface with a limited free tier then pay-for-speed / performance, etc. Is there a tier difference I'm missing? I would strongly support options! so all three: hf, replicate and llama api. How best to architect to handle these? |
I have no differences in understanding.
Let's support multiple options. On our demo page, we should enable trying Llama2 with Replicate.
The LLM calls are made using LangChain, and both HF and Replicate are supported. The selected model from the UI is passed as |
Thank you for checking it right away. It's defined in The |
Ok sounds good. Did you want me to make the changes and post a PR for your review? |
I'm glad to hear that! It would be extremely helpful! |
In addition to openai, i would like to add the ability to call a model via huggingface inference API
This would allow the deployer to select from all the models on hf, including the new well-performing open source version of Llama, Llama2
It needs the huggingface api key, similar to openai.
Here is sample (untested) code using axios to fetch results from a "gpt2" model via huggingface API:
The text was updated successfully, but these errors were encountered: