An extension of fabricatio
Project description
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.
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 Distributions
Built Distributions
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 fabricatio_tei-0.1.1-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: fabricatio_tei-0.1.1-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 9.1 MB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b5d2a3f365c2425f06f36cb7c16edcea367841bf1b21efd082bb171d76dc76c
|
|
| MD5 |
9c1ed8658d7ac6c9052bc1f25775857f
|
|
| BLAKE2b-256 |
9cec58c5c660e911735dd8c5c36c2c47cadca5ea47a9d8a874d554230e92e5e9
|
File details
Details for the file fabricatio_tei-0.1.1-cp314-cp314-manylinux_2_38_x86_64.whl.
File metadata
- Download URL: fabricatio_tei-0.1.1-cp314-cp314-manylinux_2_38_x86_64.whl
- Upload date:
- Size: 9.9 MB
- Tags: CPython 3.14, manylinux: glibc 2.38+ x86-64
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d356735fdb2c449e35fa58043d302cb715c29ae0a70eca88383ec7bd00a3eea2
|
|
| MD5 |
c28a69a38efda06c9bdb5bc0fbf39227
|
|
| BLAKE2b-256 |
4dc42036d506138ba0e14fcb88b630600298cf3efe0b32a87a73b91ade4793dd
|
File details
Details for the file fabricatio_tei-0.1.1-cp314-cp314-manylinux_2_38_aarch64.whl.
File metadata
- Download URL: fabricatio_tei-0.1.1-cp314-cp314-manylinux_2_38_aarch64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.14, manylinux: glibc 2.38+ ARM64
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67df94eb78646278eed2569c57d0d6310d03949126661df2ede707956cee2bb8
|
|
| MD5 |
d3d4d5421f2af696f952a5c1b242fbfa
|
|
| BLAKE2b-256 |
c61a0e5c2395909518cd559b208134808423e353bd8a662f34ca99edaaaa98b8
|
File details
Details for the file fabricatio_tei-0.1.1-cp314-cp314-macosx_11_0_arm64.whl.
File metadata
- Download URL: fabricatio_tei-0.1.1-cp314-cp314-macosx_11_0_arm64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.14, macOS 11.0+ ARM64
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a11ae9be6986eb5c10d5ae0d15d3dfbe93b855baf1e81cae4949caf6e789ba99
|
|
| MD5 |
6562eca690f298a2913d0e47c4b57a73
|
|
| BLAKE2b-256 |
07e3610f0d08edabfa26e45542ed699d7f12d0cf9d6b89bad4200308799bb4f5
|
File details
Details for the file fabricatio_tei-0.1.1-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: fabricatio_tei-0.1.1-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 9.1 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
614605e420370c0c2c776df67ee26ca77a36ec706fd33b9b1565c04e7106c8da
|
|
| MD5 |
84450de4381f0268a66675c151783972
|
|
| BLAKE2b-256 |
33e9fcb97f9683e6537627c386d4c79b31e0982928f28c0e8a5cd6179b02e5c7
|
File details
Details for the file fabricatio_tei-0.1.1-cp313-cp313-manylinux_2_38_x86_64.whl.
File metadata
- Download URL: fabricatio_tei-0.1.1-cp313-cp313-manylinux_2_38_x86_64.whl
- Upload date:
- Size: 9.9 MB
- Tags: CPython 3.13, manylinux: glibc 2.38+ x86-64
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86f74ca086b705ccac329bced18ad2e06fc6bc14318483735663f080ffa4b1d4
|
|
| MD5 |
2ba6eb0f78ad10dc3a5fcaca75a7e470
|
|
| BLAKE2b-256 |
227e28230e2298475cd6b33567cbade68906170cf0dbe23eae4d7d793d4f977f
|
File details
Details for the file fabricatio_tei-0.1.1-cp313-cp313-manylinux_2_38_aarch64.whl.
File metadata
- Download URL: fabricatio_tei-0.1.1-cp313-cp313-manylinux_2_38_aarch64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.13, manylinux: glibc 2.38+ ARM64
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97f792f5638107b89085a68dbc0aeb3c8af3857480e249be17e72e008edaaba0
|
|
| MD5 |
049fb4fb2aeeb6f1ddfae0a4b9fe5504
|
|
| BLAKE2b-256 |
2c8ac13742ef2fb7c80b5dc8466061b427d423ce4053520a000a978a315eb9de
|
File details
Details for the file fabricatio_tei-0.1.1-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: fabricatio_tei-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b5ba3425cc91bd2267b7144b2d2b49d2fee899391f648058d69230e21de5375
|
|
| MD5 |
683e3ffca9573769043b360808ad999e
|
|
| BLAKE2b-256 |
486b05146b13b33cf367e9bea24a930ad41b82b0da777f25a86c98e0cfa577b3
|
File details
Details for the file fabricatio_tei-0.1.1-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: fabricatio_tei-0.1.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 9.1 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21429a1b875b49993225b67b26adf09b581144116e1b6bcad8a862ef34476f06
|
|
| MD5 |
795b4e79e6c45ee58c0fa012628be348
|
|
| BLAKE2b-256 |
1595d1cb30666f96a2dd937c62c5741552980c9b634275e844d97e36b8ec6ebe
|
File details
Details for the file fabricatio_tei-0.1.1-cp312-cp312-manylinux_2_38_x86_64.whl.
File metadata
- Download URL: fabricatio_tei-0.1.1-cp312-cp312-manylinux_2_38_x86_64.whl
- Upload date:
- Size: 9.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.38+ x86-64
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b6dbb4049c7e4da06c2bd1c7ae6fec37065bd5834579c6e2f9efbfc2e97a9a1
|
|
| MD5 |
08630f0c76ac10b713361ff5f31e54e3
|
|
| BLAKE2b-256 |
657234d5f8c3896c8bc3399ecfdb0e7a6ee00ffeadec0bb4b4acab0c81e49393
|
File details
Details for the file fabricatio_tei-0.1.1-cp312-cp312-manylinux_2_38_aarch64.whl.
File metadata
- Download URL: fabricatio_tei-0.1.1-cp312-cp312-manylinux_2_38_aarch64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.38+ ARM64
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
260336c49410b7502e50233096c2c3ced90c3a15bea84c1632bff8d620581446
|
|
| MD5 |
354990219c0de40109f521b28458cee7
|
|
| BLAKE2b-256 |
a6128f61d2c0a5e10ae489541759e24f4b0ea9b63dcc3d5c03ddbec183a3d885
|
File details
Details for the file fabricatio_tei-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: fabricatio_tei-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f79a6da61af313d367f0608191a33689ec09ccb36f5ff350c3a32ca2b613a32d
|
|
| MD5 |
78a5e5eba05d413cf1d632a0497667d2
|
|
| BLAKE2b-256 |
767e3c609ed7ad3739dd77e52e6578667d573f3d08f19b0af1d102e1311ae6ef
|