LLM CLI
One command line for every LLM: prompts, embeddings, tools, and a logged SQLite history.
About
LLM is a CLI tool and Python library by Simon Willison that provides a unified interface for interacting with large language models. Run llm "explain this error", pipe output through models with cat error.log | llm "what went wrong?", or open interactive chats — every prompt and response is automatically logged to a local SQLite database for later review, search, and analysis.
A plugin architecture (100+ plugins) covers OpenAI, Anthropic Claude, Google Gemini, Meta Llama, and dozens more, via remote APIs or locally-run models through plugins like llm-ollama. It also includes embeddings generation and semantic search, reusable prompt templates, fragments, model aliases, tool use (function calling), and structured output via JSON schemas — making it a lightweight RAG and agent-building toolkit from the terminal. Limitations: it is a power-user tool with a learning curve around plugins and templates; and API costs still accrue per call like any other client.
What it can do
- Unified CLI for OpenAI, Claude, Gemini, Llama, and more
- Prompt/response logging to SQLite
- Embeddings, semantic search, and templates
- Tool use and structured JSON output
Setup
pip install llm (or brew/pipx/uv), then llm keys set openai to configure provider keys.
Prerequisites
Python 3.8+; API keys for the providers you want to use.
Use cases
Works with
Trust score — 8/10
Scored 8/10 (verified tier, metrics-v1). Evidence: Verified via vendor site/docs/GitHub and reputable coverage, wave 69; Trending score 75/100 from researcher assessment.
★ 11,508 GitHub stars
Sources
Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.