---
title: "Deploy Embedding Models with Hugging Face Inference Endpoints"
description: "Open-source embedding models such as BAAI/bge-base-en-v1.5 can be deployed on Hugging Face Inference Endpoints using Text Embeddings Inference (TEI), which offers token-based dynamic batching, Flash Attention, Candle and cuBLASLt kernels, safetensors loading, small images for fast boot, and OpenTelemetry/Prometheus support."
url: "https://swe.quest/articles/deploy-embedding-models-with-hugging-face-inference-endpoints-e85e7e272a9c97bc"
canonical: "https://huggingface.co/blog/inference-endpoints-embeddings"
source: "Hugging Face"
published: "2023-10-24"
difficulty: "medium"
kind: "How-to"
reading_minutes: 5
tags: ["inference","rag","ml-platform"]
---

# Deploy Embedding Models with Hugging Face Inference Endpoints

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2023-10-24, 5 min read, How-to. Original: [https://huggingface.co/blog/inference-endpoints-embeddings](https://huggingface.co/blog/inference-endpoints-embeddings)

## Summary

Open-source embedding models such as BAAI/bge-base-en-v1.5 can be deployed on Hugging Face Inference Endpoints using Text Embeddings Inference (TEI), which offers token-based dynamic batching, Flash Attention, Candle and cuBLASLt kernels, safetensors loading, small images for fast boot, and OpenTelemetry/Prometheus support. Deployment is click-through: pick a model, cloud, region and instance, such as an Nvidia A10G instead of the suggested CPU instance. Batch requests are sent over HTTP with \`truncate: true\`, because TEI does not truncate inputs by default. A benchmark at sequence length 512 and batch size 32 reached 450+ req/sec, about $0.00000156 per 1k tokens, which Hugging Face says is 64x cheaper than OpenAI embeddings.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [RAG & retrieval](https://swe.quest/tags/rag.md) (AI & ML)
- [ML platforms](https://swe.quest/tags/ml-platform.md) (AI & ML)

## Prerequisites

- text embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- REST APIs ([easy posts on API design](https://swe.quest/tags/api-design.md?difficulty=easy))

## Keywords

Text Embeddings Inference, Hugging Face Inference Endpoints, BAAI/bge-base-en-v1.5, MTEB, Flash Attention, Nvidia A10G

## Related posts

- [Introducing the Hugging Face Embedding Container for Amazon SageMaker](https://swe.quest/articles/introducing-the-hugging-face-embedding-container-for-amazon-sagemaker-cc289650f9404f51.md): Hugging Face · 2024-06-07 · Medium · 7 min read · Inference & serving, Cloud platforms, RAG & retrieval, Python
  The Hugging Face Embedding Container for Amazon SageMaker, built on Text Embedding Inference (TEI), is now generally available for deploying open embedding models such as Snowflake Arctic Embed and BGE.
- [Deploy LLMs with Hugging Face Inference Endpoints](https://swe.quest/articles/deploy-llms-with-hugging-face-inference-endpoints-3facefc244b0efa0.md): Hugging Face · 2023-07-04 · Medium · 6 min read · Inference & serving, LLMs, Python, JavaScript
  Falcon 40B Instruct can be deployed to Hugging Face Inference Endpoints through the web UI by choosing a repository, cloud, region and instance.
- [Embedding English Wikipedia in under 15 minutes](https://swe.quest/articles/embedding-english-wikipedia-in-under-15-minutes-fa4a10822ac9f853.md): Modal · 2024-01-23 · Medium · 11 min read · Inference & serving, Serverless, RAG & retrieval, Python
  Embedding all of English Wikipedia with the open-source BAAI/bge-small-en-v1.5 model takes about 15 minutes and just over $15 when Hugging Face's Text Embeddings Inference server runs across many parallel GPUs on Modal.
- [Why we’re switching to Hugging Face Inference Endpoints, and maybe you should too](https://swe.quest/articles/why-we-re-switching-to-hugging-face-inference-endpoints-and-maybe-you-should-too-bfdcddeceab350fa.md): Hugging Face · 2023-02-15 · Medium · 6 min read · Inference & serving, ML platforms, Cost optimization, Cloud platforms
  A team moved CPU-based transformer inference off a self-built FastAPI + Docker + AWS ECS/Fargate stack onto Hugging Face Inference Endpoints, collapsing deployment to train, push to Hub, deploy.
- [1 Billion Classifications](https://swe.quest/articles/1-billion-classifications-90168b62de6ffa1b.md): Hugging Face · 2025-02-13 · Medium · 17 min read · Inference & serving, Cost optimization, Performance engineering, Machine learning
  Processing 1B classifications or embeddings on a single-GPU baseline costs about $254 for DistilBERT sentiment classification and $409 for ModernBERT-based gte embeddings on an NVIDIA L4 ($0.8/hr), but roughly $44,500 for ColQwen2 vision embeddings.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
