A command-line interface for interacting with large language models through OpenRouter.
This tool was mostly built using LLMs: ChatGPT 4o and Claude 3.5 Sonnet via Aider.
- Get an API key from OpenRouter
- Store your API key in the macOS Keychain:
security add-generic-password -s "OPENROUTER_API_KEY" -a "$USER" -w "<your-api-key>"- Make sure you have jq installed
Basic usage:
llm "your question here"Use Gemini model:
llm -g "your question here"Use Claude 3.5 Sonnet:
llm -c "your question here"Use DeepSeek R1:
llm -r1 "your question here"- Direct access to powerful language models from the command line
- Automatic token usage and cost tracking
- Support for multiple models:
- Meta's Llama 3.3 70B (default)
- Google's Gemini 2.0 Flash
- Anthropic's Claude 3.5 Sonnet
- DeepSeek R1
- Secure API key storage using macOS Keychain
The tool provides:
- The model's response
- Statistics including:
- Input tokens used
- Output tokens generated
- Generation time
- Total cost