# How to Use HuggingFace free Embedding models

**URL:** <https://discuss.huggingface.co/t/how-to-use-huggingface-free-embedding-models/109700>\
**Category:** Beginners\
**Created:** [October 1, 2024, 8:08pm UTC](https://discuss.huggingface.co/t/how-to-use-huggingface-free-embedding-models/109700 "2024-10-01T20:08:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulinhok14](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/paulinhok14/32/32301_2.png) [@paulinhok14](https://discuss.huggingface.co/u/paulinhok14)\
**Post date:** [October 1, 2024, 8:08pm UTC](https://discuss.huggingface.co/t/how-to-use-huggingface-free-embedding-models/109700/1 "2024-10-01T20:08:13Z")

</div>

Hi, I’m new at the platform, and trying to build a RAG app with my word doc as knowledge base and llama as LLM model.

In order to embed text, I’m struggling with a free model implementation, such as HuggingFaceEmbeddings, but most documentation I have access to is a little bit confusing regard importation and newest version.

Some sources:  
from langchain\_huggingface import HuggingFaceEmbeddings  
Another ones:  
from langchain.embeddings import HuggingFaceEmbeddings

Are there a “source of truth” material in which I can check in order to finish my project?

Thank you!

---

<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:** [October 1, 2024, 8:41pm UTC](https://discuss.huggingface.co/t/how-to-use-huggingface-free-embedding-models/109700/2 "2024-10-01T20:41:17Z")

</div>

Apparently it is both libraries by a third party and maybe both are real.  
I am not familiar with Embedding or LangChain, so we will wait for someone more knowledgeable to come by.  
I found a couple of official HF introductory articles.

> **[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.

> **[Getting Started With Embeddings](https://huggingface.co/blog/getting-started-with-embeddings)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

---

<div class="post-metadata">

**Author:** ![Chahnwoo](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@Chahnwoo](https://discuss.huggingface.co/u/Chahnwoo)\
**Post date:** [October 2, 2024, 2:56am UTC](https://discuss.huggingface.co/t/how-to-use-huggingface-free-embedding-models/109700/3 "2024-10-02T02:56:43Z")

</div>

Personally, I’ve felt that LangChain has pretty fast-paced updates, some of which change the internal structure of the library itself (for example, where the classes are located). Typically, they will indicate that a particular class is deprecated, and suggest alternatives on their official API documentation.

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/4/8/48620d462fb1613cf1e79a8be1a726daee99b469.png)

[HuggingFaceEmbeddings documentation](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.huggingface.HuggingFaceEmbeddings.html)

I would say it depends on which version of LangChain you use; depending on your version, it may be the case that both work, or only one of the two works. I would recommend updating the library and sticking to the newest implementations, unless you run into bugs.

---

<div class="post-metadata">

**Author:** ![swtb](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@swtb](https://discuss.huggingface.co/u/swtb)\
**Post date:** [October 7, 2024, 9:41am UTC](https://discuss.huggingface.co/t/how-to-use-huggingface-free-embedding-models/109700/4 "2024-10-07T09:41:43Z")

</div>

Personally I recommend Chroma db for RAG apps as it handles conversion of any BERT encoder models to embedding models through mean pooling the embedding layer. Plus it has support for many 3rd parties including SentenceTransformers and Huggingface Transformers. It also supports conditional (By metadata) retrieval.
