Config-driven launcher for Hugging Face Text Embeddings Inference services
Project description
tei-serving
tei-serving is a config-driven launcher for Hugging Face Text Embeddings Inference (TEI). It wraps the TEI router with a small Python entrypoint that reads YAML, validates settings, and starts TEI with the generated CLI arguments.
What it does
Current capabilities:
- Load an embedder or reranker YAML config.
- Convert typed settings into TEI command-line arguments.
- Start the TEI router process with the configured model unchanged.
Core files:
src/tei_serving/__init__.py: runner implementation.src/tei_serving/settings.py: config models and CLI serialization.src/tei_serving/main.py: CLI entrypoint.
Requirements
- Python
>=3.12,<3.13for local development. - Docker for the production image.
- A TEI base image containing
text-embeddings-router. - GPU runtime when serving CUDA TEI images.
Installation
Production dependencies:
make install
Development environment:
make dev-install
Equivalent uv command:
uv sync --group dev --all-extras
Configuration
Embedder example:
kind: embedder
model:
model-id: /models/testb
dtype: float32
pooling: cls
server:
hostname: 0.0.0.0
port: 8082
batching:
max-batch-tokens: 16384
max-client-batch-size: 32
Reranker example:
kind: reranker
model:
model-id: BAAI/bge-reranker-base
dtype: float16
server:
hostname: 0.0.0.0
port: 8081
batching:
max-batch-tokens: 16384
max-client-batch-size: 32
Running
Local CLI, assuming TEI is available on PATH:
tei-serving --config configs/embedder.yaml
Equivalent:
python -m tei_serving.main --config configs/embedder.yaml
Docker build:
docker build -t tei-serving:local .
Docker run with a mounted config:
docker run --gpus all --rm \
-v /absolute/path/to/config.yaml:/config/config.yaml:ro \
-v /absolute/path/to/models:/models:ro \
tei-serving:local \
--config /config/config.yaml
Model Serving
The runner passes the configured model-id directly to TEI for both embedder and reranker configs. It does not copy local model directories, download Hugging Face snapshots, or rewrite SentenceTransformers metadata before startup.
Development
make format
make lint
make type-check
make security
make test
make test-cov
make ci
Repository Layout
src/tei_serving/
__init__.py # runner implementation
exceptions.py # package exceptions
main.py # CLI entrypoint
settings.py # Pydantic settings and CLI serialization
configs/
embedder.yaml # example embedder config
reranker.yaml # example reranker config
tests/
unit/ # unit tests for settings and runner behavior
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tei_serving-1.2.0.tar.gz.
File metadata
- Download URL: tei_serving-1.2.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7e794ef159884845cca49a362b358d997ccb3dbd7f596590cd66d1c939f8eb7
|
|
| MD5 |
2924ce8ef8953163df31821e7415c109
|
|
| BLAKE2b-256 |
963327a816a976154eea189cc4b6acaaaf42458704b13ad444f854f00b175d5f
|
File details
Details for the file tei_serving-1.2.0-py3-none-any.whl.
File metadata
- Download URL: tei_serving-1.2.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6116ba026f7feb85e515cbcd477e4c8a9e38e63da27225dd36407e773ac4a2d0
|
|
| MD5 |
f1eeafeae5d91e315877029e5947ac6e
|
|
| BLAKE2b-256 |
65cc5f136141aaeaec4ec0470fe82b0d80485835f5e2c93ea29905c9b0197414
|