Embedding Service

High-performance text embedding service with caching

Category
embedding
Version
1.0.0
Deployment formats
Docker Compose, Helm (Kubernetes), Terraform (local Docker), Terraform (AWS)
Maintainer
Hugging Face
Tags
Embeddings, Hugging Face, Semantic Search, API, FastAPI

Source code

Overview

High-performance text embedding service using Hugging Face models. Supports batch processing, caching, and horizontal scaling. Perfect for semantic search and similarity matching.

Requirements

  • Docker installed
  • 4GB RAM minimum
  • First run downloads model (130MB - 1.3GB depending on model)

Quick start

Quick Start (Docker)

  1. Start the service:
   docker-compose up -d
  1. Wait for model download (first run: ~1.3GB for bge-large)
  1. Test the API:
   curl http://localhost:8080/embed \
     -X POST \
     -H "Content-Type: application/json" \
     -d '{"inputs": "What is machine learning?"}'
  1. Batch embeddings:
   curl http://localhost:8080/embed \
     -X POST \
     -H "Content-Type: application/json" \
     -d '{"inputs": ["First text", "Second text"]}'

Model Options:

  • BAAI/bge-small-en-v1.5 - Fast (130MB)
  • BAAI/bge-base-en-v1.5 - Balanced (440MB)
  • BAAI/bge-large-en-v1.5 - Best quality (1.3GB)

Environment variables

  • MODEL_ID – Hugging Face model ID for embeddings

docker-compose.yml

version: "3.8"

services:
  embeddings:
    image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
    container_name: text-embeddings
    ports:
      - "8080:80"
    environment:
      - MODEL_ID=BAAI/bge-large-en-v1.5
    volumes:
      - models:/data
    restart: unless-stopped
    # For GPU support, use this image instead:
    # image: ghcr.io/huggingface/text-embeddings-inference:1.5

volumes:
  models:

All AI stacks