mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-06-01 10:51:39 +02:00
f6794b76e2929ccb985adc28052504e8c4f7494a
Explorer Proxy
This is a lightweight Docker service which sits between the user and the LLM Provider (OpenAI, Anthropic, etc) and pushes the resultant agent traces to the Invariant Explorer which lets you visualize and explore traces.
OpenAI
You can make requests to OpenAI while pushing traces to the Invariant Explorer.
First get an API key by following the steps here.
Then you can use a custom http_client and base_url while setting up the OpenAI client object.
A dataset with the given name will be created if it already doesn't exist.
from httpx import Client
from openai import OpenAI
client = OpenAI(
http_client=Client(
headers={
"Invariant-Authorization": "Bearer <invariant-api-key>"
},
),
base_url="https://explorer.invariantlabs.ai/api/v1/proxy/<add-your-dataset-name-here>/openai",
)
# Make API requests to OpenAI as usual.
Anthropic
Coming Soon!
Description
Languages
Python
98.1%
Shell
1.9%