aider/aider/website/docs/llms/openrouter.md
Paul Gauthier e47c2a913a copy
2024-07-06 16:38:20 -03:00

908 B

parent nav_order
Connecting to LLMs 500

OpenRouter

Aider can connect to models provided by OpenRouter: You'll need an OpenRouter API key.

pip install aider-chat

export OPENROUTER_API_KEY=<key> # Mac/Linux
setx   OPENROUTER_API_KEY <key> # Windows

# Or any other open router model
aider --model openrouter/<provider>/<model>

# List models available from OpenRouter
aider --models openrouter/

In particular, Llama3 70B works well with aider, at low cost:

pip install aider-chat

export OPENROUTER_API_KEY=<key> # Mac/Linux
setx   OPENROUTER_API_KEY <key> # Windows

aider --model openrouter/meta-llama/llama-3-70b-instruct

{: .tip } You can access Claude 3.5 Sonnet via OpenRouter, without the tight rate limits that Anthropic applies. Use aider --model openrouter/anthropic/claude-3.5-sonnet