Skip to content

valohai/conduit

Repository files navigation

Valohai Conduit

License: MIT

A local proxy that sits between your code and LLM providers, recording billable usage. Point SDK's base URL at Conduit, and get detailed tracking with zero code changes.

Single binary, written in Rust.

Install

Conduit is available through:

You can confirm that Conduit is installed with:

conduit --help

# Usage: conduit [OPTIONS] [COMMAND]
#
# Commands:
#   proxy      Run the proxy server [default command]
#   dashboard  Open the terminal-based dashboard
#   help       Print this message or the help of the given subcommand(s)

Usage

Once Conduit is running, point your SDK's base URL at it. The URL is http://<proxy-address>/<provider_key> where <provider_key> matches a [providers.<key>] section in your conduit.toml.

Set the base URL environment variable for your provider SDK:

# NB: OpenAI-like providers also need the `/v1` path suffix:
export OPENAI_BASE_URL=http://localhost:8080/openai/v1
export ANTHROPIC_BASE_URL=http://localhost:8080/anthropic

Most SDKs automatically pick up the above env vars with no code changes needed.

Alternatively, pass the base API url directly, e.g. with common Python SDKs:

client = OpenAI(base_url="http://localhost:8080/openai/v1")
client = Anthropic(base_url="http://localhost:8080/anthropic")

See examples/ for complete Python usage examples.

Development

See the contributing guide to get started.

About

⚡️ local proxy for LLM token usage across providers, written in Rust

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages