Skip to main content
Let’s load the Hugging Face Embedding class.

Hugging Face inference providers

We can also access embedding models via the Inference Providers, which let’s us use open source models on scalable serverless infrastructure. First, we need to get a read-only API key from Hugging Face.
Now we can use the HuggingFaceInferenceAPIEmbeddings class to run open source embedding models via Inference Providers.

Hugging Face hub

We can also generate embeddings locally via the Hugging Face Hub package, which requires us to install huggingface_hub