SuperAPIAI Directory

text-embeddings-inference

github.com · AI developer platforms

Inference for text-embeddings in Rust, HFOIL Licence.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS · Linux · API

About this tool

Text Embeddings Inference (TEI) is an open-source toolkit developed by Hugging Face for deploying and serving high-performance inference services for open-source text embedding and sequence classification models.

Purpose

TEI is aimed at scenarios that require efficient extraction of text vector representations, and can provide an inference backend for RAG pipelines, semantic search, text classification, and more. It supports the most popular embedding models, including FlagEmbedding, Ember, GTE, and E5.

Main Capabilities

  • No model graph compilation step required.
  • Supports Metal acceleration for local execution on Mac.
  • Small Docker image and fast startup time, suitable for serverless scenarios.
  • Token-based dynamic batching.
  • Transformers inference code optimized with Flash Attention, Candle, and cuBLASLt.
  • Supports Safetensors weight loading.
  • Supports ONNX weight loading.
  • Production-ready: supports OpenTelemetry distributed tracing and Prometheus metrics.
  • Supports SPLADE pooling (for Bert and Distilbert MaskedLM architectures).
  • Provides a gRPC API as an alternative to the default HTTP API for high-performance deployments.

Supported Models

TEI currently supports Nomic, BERT, CamemBERT, XLM-RoBERTa (absolute positions), JinaBERT (Alibi positions), Mistral, Alibaba GTE, Qwen2 (Rope positions), MPNet, ModernBERT, Qwen3, and Gemma3. For sequence classification, it supports CamemBERT and XLM-RoBERTa (absolute positions). Reranking models are sequence classification cross-encoders with a single class that score query-text similarity.

Usage

It can be deployed via Docker (multiple images are provided for different backends), or installed locally.

Running Docker on GPU requires the NVIDIA Container Toolkit, and the NVIDIA driver must be compatible with CUDA 12.2 or higher.

For the API, you can consult the REST API's OpenAPI documentation (/docs route), with Swagger UI located at https://huggingface.github.io/text-embeddings-inference。可使用 HF_TOKEN environment variable to access protected resources.

Private or gated models: in https://huggingface.co/settings/tokens copy the CLI READ token, then export HF_TOKEN=<your CLI READ token>, or configure it when using Docker.

Air-gapped deployment: first download the weights, then mount them into the container via a volume.

After SPLADE pooling is enabled, you can use the /embed_sparse endpoint to obtain sparse embeddings.

Reranking: you can rank similarity using a query and a list of texts.

Sequence classification: after deployment, you can use the predict endpoint to obtain classification results such as sentiment corresponding to the input.

Distributed tracing: set the OTLP collector address via the --otlp-endpoint parameter.

gRPC: enable it by adding the -grpc tag to any TEI Docker image. The API protobuf definitions can be found in the repository.

On Apple Silicon (M1/M2/M3/M4), you can install a prebuilt binary via Homebrew and start it with Metal acceleration.

Local installation: first install Rust, then you can start TEI on CPU. Some machines may need the OpenSSL library and gcc; run the corresponding commands on Linux. GPUs with CUDA compute capability lower than 7.5 are not supported (V100, Titan V, GTX 1000 series, etc.). CUDA and the NVIDIA driver must be installed (the driver must be compatible with CUDA 12.2 or higher), and the NVIDIA binaries must be added to PATH.

Docker build: the CPU container can be built directly; the CUDA container needs to know the compute capability of the runtime GPU in order to choose the corresponding build; on an ARM64 host without an NVIDIA GPU, use the CPU Dockerfile (CPU-core-only inference, Metal/MPS is not supported under Docker); on an ARM64 host with an NVIDIA GPU, use Dockerfile-cuda and specify the corresponding compute capability and --platform linux/arm64.

AMD Instinct GPUs (MI200, MI300 series) are supported via ROCm; see the AMD Instinct GPU guide for full instructions.

Applicable Scenarios

Suitable for scenarios such as production deployments requiring high-performance text embedding inference, RAG pipelines, semantic search, text reranking, and sequence classification.

Restrictions

  • GPU requires CUDA compute capability 7.5 or above, and the driver must be compatible with CUDA 12.2+.
  • Flash Attention is disabled by default in the Turing image due to precision issues; Flash Attention v1 can be enabled via USE_FLASH_ATTENTION=True.
  • ARM64 Docker does not support Metal/MPS.
  • The license is HFOIL.

Pricing

Not yet available.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools