Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

text-embeddings-inference

> AI 编程
Open source

A blazing fast inference solution for text embeddings models

5.0K stars0 likes1 views
WebsiteGitHub

About

A blazing fast inference solution for text embeddings models

Table of contents

  • Get Started
    • Supported Models
    • Docker
    • Docker Images
    • API Documentation
    • Using a private or gated model
    • Air gapped deployment
    • Using Re-rankers models
    • Using Sequence Classification models
    • Using SPLADE pooling
    • Distributed Tracing
    • gRPC
  • Local Install
    • Apple Silicon (Homebrew)
  • Docker Build
    • ARM64 / aarch64
  • AMD Instinct GPUs (ROCm)
  • Examples

Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5. TEI implements many features such as:

  • No model graph compilation step
  • Metal support for local execution on Macs
  • Small docker images and fast boot times. Get ready for true serverless!
  • Token based dynamic batching
  • Optimized transformers code for inference using Flash Attention, Candle and cuBLASLt
  • Safetensors weight loading
  • ONNX weight loading
  • Production ready (distributed tracing with Open Telemetry, Prometheus metrics)

Get Started

Supported Models

Text Embeddings

Text Embeddings Inference currently supports Nomic, BERT, CamemBERT, XLM-RoBERTa models with absolute positions, JinaBERT model with Alibi positions and Mistral, Alibaba GTE, Qwen2 models with Rope positions, MPNet, ModernBERT, Qwen3, and Gemma3.

Below are some examples of the currently supported models:

MTEB Rank Model Size Model Type Model ID
2 7.57B (Very Expensive) Qwen3 Qwen/Qwen3-Embedding-8B
3 4.02B (Very Expensive) Qwen3 Qwen/Qwen3-Embedding-4B
4 509M Qwen3 Qwen/Qwen3-Embedding-0.6B
6 7.61B (Very Expensive) Qwen2 Alibaba-NLP/gte-Qwen2-7B-instruct
7 560M XLM-RoBERTa intfloat/multilingual-e5-large-instruct
8 308M Gemma3 google/embeddinggemma-300m (gated)
15 1.78B (Expensive) Qwen2 Alibaba-NLP/gte-Qwen2-1.5B-instruct
18 7.11B (Very Expensive) Mistral Salesforce/SFR-Embedding-2_R
35 568M XLM-RoBERTa Snowflake/snowflake-arctic-embed-l-v2.0
41 305M Alibaba GTE Snowflake/snowflake-arctic-embed-m-v2.0
52 335M BERT WhereIsAI/UAE-Large-V1
58 137M NomicBERT nomic-ai/nomic-embed-text-v1
79 137M NomicBERT nomic-ai/nomic-embed-text-v1.5
103 109M MPNet sentence-transformers/all-mpnet-base-v2
N/A 475M-A305M NomicBERT nomic-ai/nomic-embed-text-v2-moe
N/A 434M Alibaba GTE Alibaba-NLP/gte-large-en-v1.5
N/A 396M ModernBERT answerdotai/ModernBERT-large
N/A 340M Qwen3 voyageai/voyage-4-nano
N/A 137M JinaBERT jinaai/jina-embeddings-v2-base-en
N/A 137M JinaBERT jinaai/jina-embeddings-v2-base-code

To explore the list of best performing text embeddings models, visit the Massive Text Embedding Benchmark (MTEB) Leaderboard.

Sequence Classification and Re-Ranking

Text Embeddings Inference currently supports CamemBERT, and XLM-RoBERTa Sequence Classification models with absolute positions.

Below are some examples of the currently supported models:

Task Model Type Model ID
Re-Ranking XLM-RoBERTa BAAI/bge-reranker-large
Re-Ranking XLM-RoBERTa BAAI/bge-reranker-base
Re-Ranking GTE Alibaba-NLP/gte-multilingual-reranker-base
Re-Ranking ModernBert Alibaba-NLP/gte-reranker-modernbert-base
Sentiment Analysis RoBERTa SamLowe/roberta-base-go_emotions

Docker

bash
model=Qwen/Qwen3-Embedding-0.6B
volume=$PWD/data # share a volume with the Docker container to avoid downloading weights every run

docker run --gpus all -p 8080:80 -v $volume:/data --pull always ghcr.io/huggingface/text-embeddings-inference:cuda-1.9 --model-id $model

And then you can make requests like

bash
curl 127.0.0.1:8080/embed \
    -X POST \
    -d '{"inputs":"What is Deep Learning?"}' \
    -H 'Content-Type: application/json'

Note: To use GPUs, you need to install the NVIDIA Container Toolkit. NVIDIA drivers on your machine need to be compatible with CUDA version 12.2 or higher.

To see all options to serve your models:

…

Docker Images

Text Embeddings Inference ships with multiple Docker images that you can use to target a specific backend:

Architecture Platform Image
CPU x86_64 ghcr.io/huggingface/text-embeddings-inference:cpu-1.9
CPU aarch64 ghcr.io/huggingface/text-embeddings-inference:cpu-arm64-1.9
Volta x86_64 NOT SUPPORTED
Turing (T4, RTX 2000 series, ...) x86_64 ghcr.io/huggingface/text-embeddings-inference:turing-1.9 (experimental)
Ampere 8.0 (A100, A30) x86_64 ghcr.io/huggingface/text-embeddings-inference:1.9
Ampere 8.6 (A10, A40, ...) x86_64 ghcr.io/huggingface/text-embeddings-inference:86-1.9
Ada Lovelace (RTX 4000 series, ...) x86_64 ghcr.io/huggingface/text-embeddings-inference:89-1.9
Hopper (H100) x86_64 ghcr.io/huggingface/text-embeddings-inference:hopper-1.9
Blackwell 10.0 (B200, GB200, ...) x86_64 ghcr.io/huggingface/text-embeddings-inference:100-1.9 (experimental)
Blackwell 12.0 (GeForce RTX 50X0, ...) x86_64 ghcr.io/huggingface/text-embeddings-inference:120-1.9 (experimental)
Blackwell 12.1 (DGX Spark GB10, ...) multi ghcr.io/huggingface/text-embeddings-inference:121-1.9 (experimental)

Warning: Flash Attention is turned off by default for the Turing image as it suffers from precision issues. You can turn Flash Attention v1 ON by using the USE_FLASH_ATTENTION=True environment variable.

API documentation

You can consult the OpenAPI documentation of the text-embeddings-inference REST API using the /docs route. The Swagger UI is also available at: https://huggingface.github.io/text-embeddings-inference.

Using a private or gated model

You have the option to utilize the HF_TOKEN environment variable for configuring the token employed by text-embeddings-inference. This allows you to gain access to protected resources.

For example:

  1. Go to https://huggingface.co/settings/tokens
  2. Copy your CLI READ token
  3. Export HF_TOKEN=<your CLI READ token>

or with Docker:

bash
model=<your private model>
volume=$PWD/data # share a volume with the Docker container to avoid downloading weights every run
token=<your CLI READ token>

docker run --gpus all -e HF_TOKEN=$token -p 8080:80 -v $volume:/data --pull always ghcr.io/huggingface/text-embeddings-inference:cuda-1.9 --model-id $model

Air gapped deployment

To deploy Text Embeddings Inference in an air-gapped environment, first download the weights and then mount them inside the container using a volume.

For example:

bash
# (Optional) create a `models` directory
mkdir models
cd models

# Make sure you have git-lfs installed (https://git-lfs.com)
git lfs install
git clone https://huggingface.co/Qwen/Qwen3-Embedding-0.6B

# Set the models directory as the volume path
volume=$PWD

# Mount the models directory inside the container with a volume and set the model ID
docker run --gpus all -p 8080:80 -v $volume:/data --pull always ghcr.io/huggingface/text-embeddings-inference:cuda-1.9 --model-id /data/Qwen3-Embedding-0.6B

Using Re-rankers models

text-embeddings-inference v0.4.0 added support for CamemBERT, RoBERTa, XLM-RoBERTa, and GTE Sequence Classification models. Re-rankers models are Sequence Classification cross-encoders models with a single class that scores the similarity between a query and a text.

See this blogpost by the LlamaIndex team to understand how you can use re-rankers models in your RAG pipeline to imp

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustaiembeddingshuggingfacellm

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.