Skip to main content

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

llama_index_llms_trustedrouter-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_llms_trustedrouter-0.1.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_llms_trustedrouter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4394a9158cbf22944ed7e2ec712af7f7b9014595e96be15e5b9b50ade64de094
MD5 1719f8205c742271668ebba4f150a110
BLAKE2b-256 0b85403e9fa1f09f410a090d97cc9e90b57a79f616230145ecfd998b7cb6cefd

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llama_index_llms_trustedrouter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_llms_trustedrouter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5c21950d8b9694f411435fa262945738fcf7e8a6d6ee70ef324fa9f6f7eac27
MD5 8080951d2f13a0541f0a664b46f4a10e
BLAKE2b-256 0546fdfb6b2c3f463cea299bb4d4cd6170346c386134b2e71656ba990b534de3

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page