Deploy Text Embeddings Inference

Hugging Face Text Embeddings Inference 1.9 on CPU with an API key.

Deploy Text Embeddings Inference

Deploy and Host Text Embeddings Inference on Railway

Text Embeddings Inference (TEI) is Hugging Face's high-performance server for text embedding and reranker models. It serves models such as BGE, GTE, E5, Nomic and sentence-transformers through a simple REST API and an OpenAI-compatible embeddings endpoint, with dynamic batching and fast tokenization, which makes it a drop-in backend for RAG pipelines.

About Hosting Text Embeddings Inference

This template deploys TEI v1.9.4 using the CPU image, with BAAI/bge-small-en-v1.5 as the default model. The model is downloaded from Hugging Face on first start into a Railway volume, so restarts reuse the cache. Every request needs the generated API key as a bearer token. The service listens on IPv4 and IPv6, so other Railway services can use the private URL. The default model produces 384-dimension vectors and uses roughly 500 MB of memory. Change MODEL_ID for another embedding or reranker model, and size memory accordingly. Add replicas to scale throughput horizontally.

Common Use Cases

  • Embeddings for RAG, semantic search and clustering without an external API
  • An OpenAI-compatible /v1/embeddings endpoint for LangChain, LlamaIndex and others
  • Reranking search results with a cross-encoder model

Dependencies for Text Embeddings Inference Hosting

  • ghcr.io/huggingface/text-embeddings-inference:cpu-1.9.4 (official image)
  • A Railway volume at /data for the model cache

Deployment Dependencies

Implementation Details

ServiceImageNetworkingStorage
teitext-embeddings-inference:cpu-1.9.4public domain on 80; private IPv4/IPv6volume at /data
curl "$TEI_URL/v1/embeddings" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" \
  -d '{"input": ["hello world"], "model": "bge"}'

OpenAI SDKs work with base_url = "$TEI_URL/v1" and the API key.

VariableDefaultPurpose
MODEL_IDBAAI/bge-small-en-v1.5Hugging Face model to serve
API_KEYgeneratedRequired bearer token
HOSTNAME::Bind address; do not remove, Docker otherwise sets it to the container hostname
HF_TOKENunsetAdd for gated or private models

Notes:

  • The first start downloads the model; the health check allows up to 10 minutes.
  • Larger models (for example BAAI/bge-m3) need several GB of RAM.

This is a community-maintained deployment package and does not imply affiliation with or endorsement by the Text Embeddings Inference project or its maintainers.

Why Deploy Text Embeddings Inference on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Text Embeddings Inference on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
116
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
7
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
79