LlamaIndex LLMs Integration: TrustedRouter
TrustedRouter is an OpenAI-compatible LLM router that serves many models behind one endpoint through an open-source, verifiable attested gateway. It does not log prompts or outputs by default.
This package provides a TrustedRouter LLM class for LlamaIndex, implemented as a thin OpenAILike subclass.
Installation
pip install llama-index-llms-trustedrouter
Usage
Set your API key:
export TRUSTEDROUTER_API_KEY=***
from llama_index.llms.trustedrouter import TrustedRouter
llm = TrustedRouter(model="trustedrouter/zdr")
resp = llm.complete("Who is Paul Graham?")
print(resp)
Streaming and chat work like any other OpenAI-like LLM:
from llama_index.core.llms import ChatMessage
resp = llm.chat([ChatMessage(role="user", content="Tell me a joke")])
print(resp)
for chunk in llm.stream_complete("Count to five"):
print(chunk.delta, end="")
Configuration
| Argument | Environment variable | Default |
|---|---|---|
api_key |
TRUSTEDROUTER_API_KEY |
required |
api_base |
TRUSTEDROUTER_API_BASE |
https://api.trustedrouter.com/v1 |
model |
trustedrouter/zdr |
Explicit constructor arguments take precedence over environment variables.
Models
Model routes include trustedrouter/auto, trustedrouter/zdr (zero data retention), and trustedrouter/confidential, plus individually addressable models. See the live catalog at https://trustedrouter.com/v1/models.
Why a separate repository
LlamaIndex no longer accepts new integration packages in its main repository; new integrations are maintained in their own repositories and published to PyPI independently. This package follows that guidance, and the import path is unchanged from any in-tree integration.
License
MIT
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 llama_index_llms_trustedrouter-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_llms_trustedrouter-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4394a9158cbf22944ed7e2ec712af7f7b9014595e96be15e5b9b50ade64de094
|
|
| MD5 |
1719f8205c742271668ebba4f150a110
|
|
| BLAKE2b-256 |
0b85403e9fa1f09f410a090d97cc9e90b57a79f616230145ecfd998b7cb6cefd
|
Provenance
The following attestation bundles were made for llama_index_llms_trustedrouter-0.1.0.tar.gz:
Publisher:
publish.yml on Lore-Hex/llama-index-llms-trustedrouter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_llms_trustedrouter-0.1.0.tar.gz -
Subject digest:
4394a9158cbf22944ed7e2ec712af7f7b9014595e96be15e5b9b50ade64de094 - Sigstore transparency entry: 2386965176
- Sigstore integration time:
-
Permalink:
Lore-Hex/llama-index-llms-trustedrouter@068b37782b6df77c5c99816e8d2606c28dee00f9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Lore-Hex
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@068b37782b6df77c5c99816e8d2606c28dee00f9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file llama_index_llms_trustedrouter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_llms_trustedrouter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5c21950d8b9694f411435fa262945738fcf7e8a6d6ee70ef324fa9f6f7eac27
|
|
| MD5 |
8080951d2f13a0541f0a664b46f4a10e
|
|
| BLAKE2b-256 |
0546fdfb6b2c3f463cea299bb4d4cd6170346c386134b2e71656ba990b534de3
|
Provenance
The following attestation bundles were made for llama_index_llms_trustedrouter-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Lore-Hex/llama-index-llms-trustedrouter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_llms_trustedrouter-0.1.0-py3-none-any.whl -
Subject digest:
c5c21950d8b9694f411435fa262945738fcf7e8a6d6ee70ef324fa9f6f7eac27 - Sigstore transparency entry: 2386965194
- Sigstore integration time:
-
Permalink:
Lore-Hex/llama-index-llms-trustedrouter@068b37782b6df77c5c99816e8d2606c28dee00f9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Lore-Hex
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@068b37782b6df77c5c99816e8d2606c28dee00f9 -
Trigger Event:
workflow_dispatch
-
Statement type: