llm
Access large language models from the command-line
A command-line tool and Python library for sending prompts to dozens of AI models from your terminal, with automatic conversation history saved to a local SQLite database and a plugin system for adding more models.
LLM is a command-line tool and Python library for sending prompts to AI language models directly from your terminal. It supports OpenAI's GPT models, Anthropic's Claude, Google's Gemini, Meta's Llama, and dozens of others, both through remote APIs and through models you can run on your own machine.
You install it with a single command via pip, Homebrew, pipx, or uv. After saving your API keys, you type a question and get a response in your terminal. You can pipe the contents of a file as input, attach images for the model to analyze, or open an interactive back-and-forth chat session with any supported model.
Every prompt and response is automatically saved to a local SQLite database, so you can search through past conversations or pull them into other tools. The tool also handles embeddings, which are numeric representations of text that make it possible to compare documents or find similar content.
A plugin system lets the community add support for more models, including those that run entirely on your local device through tools like Ollama. Installing a plugin is a single command, after which the new model shows up alongside the built-in ones.
Beyond plain prompts, you can define output schemas to extract structured data from text or images, load large documents as context using fragments, and give models access to tools that let them take actions such as reading files or running code. The README covers installation, API key management, chat mode, embeddings, schemas, and the plugin architecture for developers who want to build their own integrations.
Where it fits
- Send a prompt to any supported AI model from your terminal without opening a browser or writing code
- Pipe a text file into an AI model to summarize or analyze it in a single shell command
- Search through your full history of past AI conversations stored automatically in a local SQLite database
- Extract structured JSON data from unstructured text using a schema definition and the llm CLI