Skip to content

Introduction

model2vec-serve is a small, fast Rust service that exposes static model2vec embedding models through both OpenAI-compatible and Text Embedding Inference (TEI) compatible HTTP endpoints.

It is designed for teams that want a self-hosted embeddings API without the overhead of a large inference framework.

Why model2vec-serve?

  • Drop-in compatibility: Existing OpenAI or TEI clients can point at this service with only a base-URL (and optional API key) change.
  • Lightweight: Static model2vec models are tiny and run efficiently on CPU, so the container starts quickly and runs with modest resources.
  • Observable: Structured JSON logs with a per-request correlation ID and a Prometheus /metrics endpoint come out of the box.
  • Kubernetes friendly: A Helm chart is included for repeatable cluster deployments, including support for volume-mounted models.

Supported endpoints

EndpointMethodDescription
/v1/embeddingsPOSTOpenAI-compatible embeddings
/embedPOSTTEI-compatible embeddings
/infoGETTEI-compatible model information
/healthGETHealth / readiness probe
/readyGETKubernetes readiness alias
/metricsGETPrometheus metrics
/docsGETInteractive OpenAPI (Scalar) UI

Typical use cases

  • Replace OpenAI embeddings calls in an existing application with a private, on-premise model.
  • Run a local embeddings API for development, evaluation, or CI pipelines.
  • Deploy a small, stateless embeddings service into Kubernetes behind a load balancer.

What’s next?

Powered by model2vec