Sign inSign up

xeze/embedding-api

By xeze

Updated 3 months ago

Sentence embedding API. Any HuggingFace model via env var. CPU + GPU.

Image
Machine learning & AI
0

1.2K

xeze/embedding-api repository overview

xeze/embedding-api

Sentence embedding server. Any HuggingFace model via env var. Normalized vectors out.


Tags

TagHardwareBase
latestCPUpython:3.11-slim-bookworm
gpuNVIDIA CUDA 12.4nvidia/cuda:12.4.1-base-ubuntu22.04

docker-compose

CPU

services:
  embedding-api:
    image: xeze/embedding-api:latest
    environment:
      - EMBEDDING_MODEL_NAME=${EMBEDDING_MODEL_NAME}
    ports:
      - "8000:8000"
    volumes:
      - hf-cache:/root/.cache/huggingface

volumes:
  hf-cache:

GPU

services:
  embedding-api:
    image: xeze/embedding-api:gpu
    environment:
      - EMBEDDING_MODEL_NAME=${EMBEDDING_MODEL_NAME}
    ports:
      - "8000:8000"
    volumes:
      - hf-cache:/root/.cache/huggingface
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]

volumes:
  hf-cache:
# .env
EMBEDDING_MODEL_NAME=BAAI/bge-small-en-v1.5

Notes

  • EMBEDDING_MODEL_NAME is required — container exits immediately if not set
  • Model downloads on first run, cached in volume after
  • GPU requires NVIDIA Container Toolkit
  • Batch your texts — 100 in one request beats 100 single calls

Tag summary

Content type

Image

Digest

sha256:3dc563637

Size

405.4 MB

Last updated

3 months ago

docker pull xeze/embedding-api