Installation¶
liter-llm ships prebuilt native packages for all major languages. No Rust toolchain required unless building from source.
Install¶
API Key Setup¶
liter-llm reads API keys from environment variables. Set the key for the provider(s) you plan to use:
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export GOOGLE_API_KEY="..."
export GROQ_API_KEY="gsk_..."
export MISTRAL_API_KEY="..."
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
You only need the key for the provider you are calling
If you only use OpenAI models, only OPENAI_API_KEY is required. liter-llm resolves the provider from the model prefix (e.g. openai/gpt-4o) and injects the matching key automatically.
You can also pass the key directly at client construction:
Do not hard-code keys in source files
Use environment variables or a secret manager. API keys passed to LlmClient are wrapped in secrecy::SecretString internally and never logged.
Verify Installation¶
Building from Source¶
If prebuilt binaries are not available for your platform, you can build from source. This requires the Rust toolchain (stable 1.75+):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone https://github.com/kreuzberg-dev/liter-llm.git
cd liter-llm
task build
Next Steps¶
- Quick Start -- Make your first API call
- Provider Registry -- Browse all 142 supported providers
- Configuration -- Timeouts, retries, base URL overrides