# LangChain and Hugging Face Endpoints

**URL:** <https://discuss.huggingface.co/t/langchain-and-hugging-face-endpoints/168240>\
**Category:** Beginners\
**Created:** [September 9, 2025, 2:21pm UTC](https://discuss.huggingface.co/t/langchain-and-hugging-face-endpoints/168240 "2025-09-09T14:21:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mondo987](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@Mondo987](https://discuss.huggingface.co/u/Mondo987)\
**Post date:** [September 9, 2025, 2:21pm UTC](https://discuss.huggingface.co/t/langchain-and-hugging-face-endpoints/168240/1 "2025-09-09T14:21:01Z")

</div>

Hi all,

I am trying to replicate an example in Langchain documentation:

`from langchain_huggingface import HuggingFaceEndpoint`

`from langchain.chains import LLMChain`  
`from langchain_core.prompts import PromptTemplate`

`question = "Who won the FIFA World Cup in the year 1994? "`  
`template = """Question: {question}`  
`Answer: Let's think step by step."""`  
`prompt = PromptTemplate.from_template(template)`

`repo_id = "deepseek-ai/DeepSeek-R1-0528"`

`llm = HuggingFaceEndpoint(`  
` repo_id=repo_id,`  
` max_length=128,`  
` temperature=0.5,`  
` huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,`  
` provider="auto", # set your provider here ``hf.co/settings/inference-providers`  
` # provider="hyperbolic",`  
` # provider="nebius",`  
` # provider="together",`  
`)`  
`llm_chain = prompt | llm`  
`print(llm_chain.invoke({"question": question}))`

And receiving error message:  
`ValueError: Model deepseek-ai/DeepSeek-R1-0528 is not supported for task text-generation and provider together. Supported task: conversational.`

I have tried different models with inference provided and text generarion as a task but always receiving the same error message.

Thank you very much for the support!

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [September 9, 2025, 9:52pm UTC](https://discuss.huggingface.co/t/langchain-and-hugging-face-endpoints/168240/2 "2025-09-09T21:52:22Z")

</div>

It seems that [at this point, we need to wrap the function](https://github.com/langchain-ai/langchain/issues/31434#issuecomment-2936308959)…
