Batch-first FastAPI service for generating image embeddings with DINOv3. Supports image URLs or base64 payloads, CPU/GPU execution, and Docker/Kubernetes deployment.
- Batch-first embeddings: Always send
images: [...], even for single-image requests - GPU-ready: CUDA 13 base image and
DEVICE=cudatoggle - Secure URL fetch: SSRF protections with denylist/allowlist support
- Ops-friendly: Docker + K8s manifests and health checks
- Docker and Docker Compose
- NVIDIA GPU with CUDA support (optional, but recommended for faster performance)
-
Clone the repository:
git clone <repo-url> cd tool-dinov3-embeddings-api
-
Build and run with Docker:
docker compose up --build
-
Access the application:
- Check health:
curl http://localhost:8000/v1/health
- Request embeddings (single image = batch of 1):
curl -X POST http://localhost:8000/v1/embeddings \ -H "Content-Type: application/json" \ -d '{ "images": [ {"image_url": "https://example.com/image.jpg", "id": "img-1"} ] }'
- For GPU, set
DEVICE=cudaand run with the NVIDIA container runtime. - Use
BATCH_SIZEto cap request size and manage latency.
- Model download time: First start will download the model from Hugging Face.
- URL inputs: Only
http/httpsare allowed, and internal IPs are blocked by default.
See LICENSE.
The AI Service Centre Berlin Brandenburg is funded by the Federal Ministry of Research, Technology and Space under the funding code 01IS22092.

