Contributing
Prerequisites
- Rust toolchain — rustup.rs
- Docker Desktop, or another reachable Postgres database
- An Anthropic API key (for end-to-end testing)
Run the server locally
1. Clone and buildlitellm-rust, and the binary is lite.
2. Create a config
config.yaml.example ships with local provider entries. The api_key,
master_key, and database_url fields read from environment variables by
default:
postgres:5432 and from your host as 127.0.0.1:${POSTGRES_PORT:-15432}.
Start only the database when you want to run the Rust gateway directly:
http://localhost:4000 by default.
5. Verify
/v1/messages (Anthropic-native protocol). There is no
/v1/chat/completions (OpenAI-compat) route yet.
Run tests
tests/ spin up a local wiremock server — no real
API calls needed. Postgres-backed tests are skipped unless TEST_DATABASE_URL
is set. To run them against the compose database:
Add a provider
Drop a new folder undersrc/sdk/providers/:
build.rs auto-discovers the folder and wires it in. No other files need
editing. See src/sdk/providers/anthropic/anthropic_messages/ for a reference implementation.