fabricatio-tei
Integration with HuggingFace Text Embeddings Inference (TEI) for Fabricatio's provider routing system. Register a TEI server as a provider and use it for embedding generation and document reranking through Fabricatio's standard model interfaces.
Requires Python 3.12+.
Installation
pip install fabricatio[tei]
# or
uv pip install fabricatio[tei]
Key Components
Provider Registration (add_tei)
Rust-backed function exposed as fabricatio_tei.rust.add_tei. Registers a TEI server as both an embedding
and reranking provider in Fabricatio's global router.
from fabricatio_tei.rust import add_tei
add_tei("my-tei", "http://localhost:8080")
After registration, the TEI server is available to any agent or workflow that uses UseEmbedding or UseReranker
capabilities from fabricatio-core. Models created through the router will issue requests to the TEI server's
/embed and /rerank endpoints.
Tei Capability Mixin
Abstract base class inheriting UseLLM from fabricatio-core. Provides a tei() method placeholder for
building agents that consume TEI services. Extend this class alongside test roles or other capability mixins.
from fabricatio_tei.capabilities.tei import Tei
from fabricatio_mock.models.mock_role import LLMTestRole
class TeiRole(LLMTestRole, Tei):
"""Test role combining LLM testing with TEI capabilities."""
TeiConfig
Dataclass loaded from Fabricatio's configuration system under the "tei" section. Extend with fields as needed
for your deployment.
from fabricatio_tei.config import tei_config
Supported Endpoints
| Route | Endpoint | Use Case |
|---|---|---|
/embed |
POST with {"inputs": "text"} |
Generate embeddings for text inputs |
/rerank |
POST with {"query": "...", "texts": [...]} |
Rerank documents by relevance to a query |
The TEI provider implements both EmbeddingModel and RerankerModel from the thryd crate, making it
compatible with any Fabricatio workflow that consumes these traits.
Package Structure
fabricatio-tei/
├── python/fabricatio_tei/
│ ├── capabilities/ - Tei abstract base class
│ ├── actions/ - Action definitions
│ ├── models/ - Model definitions
│ ├── workflows/ - Workflow definitions
│ ├── config.py - TeiConfig dataclass
│ └── __init__.py
├── src/ - Rust implementation
│ ├── lib.rs - PyO3 module entry point
│ └── tei.rs - TEI provider, models, and routes
├── Cargo.toml
└── pyproject.toml
Dependencies
fabricatio-core— router, embedding/reranking interfaces, and configuration systemthryd(Rust) — provider and model abstractionsfabricatio-router(Rust) — global provider registry
License
This project is licensed under the MIT License.
Metadata
Release files for fabricatio-tei 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 110.3 MB
Release files / fabricatio_tei-0.1.1-cp314-cp314-win_amd64.whl
| Download URL | fabricatio_tei-0.1.1-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 9.1 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5b5d2a3f365c2425f06f36cb7c16edcea367841bf1b21efd082bb171d76dc76c
|
|
BLAKE2b-256 checksum How to use checksums |
9cec58c5c660e911735dd8c5c36c2c47cadca5ea47a9d8a874d554230e92e5e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_tei-0.1.1-cp314-cp314-manylinux_2_38_x86_64.whl
| Download URL | fabricatio_tei-0.1.1-cp314-cp314-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 9.9 MB |
| Tags | CPython 3.14 Linux glibc 2.38+ x86-64 |
|
SHA-256 checksum How to use checksums |
d356735fdb2c449e35fa58043d302cb715c29ae0a70eca88383ec7bd00a3eea2
|
|
BLAKE2b-256 checksum How to use checksums |
4dc42036d506138ba0e14fcb88b630600298cf3efe0b32a87a73b91ade4793dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_tei-0.1.1-cp314-cp314-manylinux_2_38_aarch64.whl
| Download URL | fabricatio_tei-0.1.1-cp314-cp314-manylinux_2_38_aarch64.whl |
|---|---|
| Size | 8.9 MB |
| Tags | CPython 3.14 Linux glibc 2.38+ ARM64 |
|
SHA-256 checksum How to use checksums |
67df94eb78646278eed2569c57d0d6310d03949126661df2ede707956cee2bb8
|
|
BLAKE2b-256 checksum How to use checksums |
c61a0e5c2395909518cd559b208134808423e353bd8a662f34ca99edaaaa98b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_tei-0.1.1-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | fabricatio_tei-0.1.1-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 8.9 MB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a11ae9be6986eb5c10d5ae0d15d3dfbe93b855baf1e81cae4949caf6e789ba99
|
|
BLAKE2b-256 checksum How to use checksums |
07e3610f0d08edabfa26e45542ed699d7f12d0cf9d6b89bad4200308799bb4f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_tei-0.1.1-cp313-cp313-win_amd64.whl
| Download URL | fabricatio_tei-0.1.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 9.1 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
614605e420370c0c2c776df67ee26ca77a36ec706fd33b9b1565c04e7106c8da
|
|
BLAKE2b-256 checksum How to use checksums |
33e9fcb97f9683e6537627c386d4c79b31e0982928f28c0e8a5cd6179b02e5c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_tei-0.1.1-cp313-cp313-manylinux_2_38_x86_64.whl
| Download URL | fabricatio_tei-0.1.1-cp313-cp313-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 9.9 MB |
| Tags | CPython 3.13 Linux glibc 2.38+ x86-64 |
|
SHA-256 checksum How to use checksums |
86f74ca086b705ccac329bced18ad2e06fc6bc14318483735663f080ffa4b1d4
|
|
BLAKE2b-256 checksum How to use checksums |
227e28230e2298475cd6b33567cbade68906170cf0dbe23eae4d7d793d4f977f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_tei-0.1.1-cp313-cp313-manylinux_2_38_aarch64.whl
| Download URL | fabricatio_tei-0.1.1-cp313-cp313-manylinux_2_38_aarch64.whl |
|---|---|
| Size | 8.9 MB |
| Tags | CPython 3.13 Linux glibc 2.38+ ARM64 |
|
SHA-256 checksum How to use checksums |
97f792f5638107b89085a68dbc0aeb3c8af3857480e249be17e72e008edaaba0
|
|
BLAKE2b-256 checksum How to use checksums |
2c8ac13742ef2fb7c80b5dc8466061b427d423ce4053520a000a978a315eb9de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_tei-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | fabricatio_tei-0.1.1-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 8.9 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7b5ba3425cc91bd2267b7144b2d2b49d2fee899391f648058d69230e21de5375
|
|
BLAKE2b-256 checksum How to use checksums |
486b05146b13b33cf367e9bea24a930ad41b82b0da777f25a86c98e0cfa577b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_tei-0.1.1-cp312-cp312-win_amd64.whl
| Download URL | fabricatio_tei-0.1.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 9.1 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
21429a1b875b49993225b67b26adf09b581144116e1b6bcad8a862ef34476f06
|
|
BLAKE2b-256 checksum How to use checksums |
1595d1cb30666f96a2dd937c62c5741552980c9b634275e844d97e36b8ec6ebe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_tei-0.1.1-cp312-cp312-manylinux_2_38_x86_64.whl
| Download URL | fabricatio_tei-0.1.1-cp312-cp312-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 9.9 MB |
| Tags | CPython 3.12 Linux glibc 2.38+ x86-64 |
|
SHA-256 checksum How to use checksums |
6b6dbb4049c7e4da06c2bd1c7ae6fec37065bd5834579c6e2f9efbfc2e97a9a1
|
|
BLAKE2b-256 checksum How to use checksums |
657234d5f8c3896c8bc3399ecfdb0e7a6ee00ffeadec0bb4b4acab0c81e49393
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_tei-0.1.1-cp312-cp312-manylinux_2_38_aarch64.whl
| Download URL | fabricatio_tei-0.1.1-cp312-cp312-manylinux_2_38_aarch64.whl |
|---|---|
| Size | 8.9 MB |
| Tags | CPython 3.12 Linux glibc 2.38+ ARM64 |
|
SHA-256 checksum How to use checksums |
260336c49410b7502e50233096c2c3ced90c3a15bea84c1632bff8d620581446
|
|
BLAKE2b-256 checksum How to use checksums |
a6128f61d2c0a5e10ae489541759e24f4b0ea9b63dcc3d5c03ddbec183a3d885
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fabricatio_tei-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | fabricatio_tei-0.1.1-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 8.9 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f79a6da61af313d367f0608191a33689ec09ccb36f5ff350c3a32ca2b613a32d
|
|
BLAKE2b-256 checksum How to use checksums |
767e3c609ed7ad3739dd77e52e6578667d573f3d08f19b0af1d102e1311ae6ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|