Unix tools compose - they read stdin, write stdout, and get out of the way. Most LLM tools don't. Simon Willison's llm fixes that by making a language model just another command in your shell: you pipe text into it, you get text out, and every single exchange is quietly logged to a local SQLite database you can query later. It's a CLI and a Python library, and it has become a small standard for scripting with models.
Unix-Philosophy LLMs
The whole tool is built to be piped. Ask a one-off question, or feed it the output of any other command:
# Ask a question
llm "Explain a Drupal render array in one sentence"
# Pipe a file in for review, with a system prompt
cat mymodule.module | llm -s "Review this for security issues"
# Browse your logged history
llm logs -n 5
Plugins for Every Model
llm is provider-agnostic through plugins. Install llm-ollama and you're running fully local models; install a hosted-provider plugin and you're talking to a frontier model with the same command. Switching models is a flag, not a rewrite.
Logged to SQLite, Queryable Forever
This is the feature that quietly changes how you work. Because every prompt and response is stored in SQLite, your AI usage becomes a searchable archive - you can find that answer from three weeks ago, or analyze it with plain SQL. It pairs naturally with Datasette (from the same author) for browsing.
Templates and Embeddings
Saved templates turn a long, reused prompt into a named command, and llm has first-class support for generating and storing embeddings, so you can build small semantic-search tools without leaving the terminal.
Rough Edges and Limitations
- It's terminal-first. If you want a chat GUI, this isn't it - the power is in scripting and piping.
- Plugins vary in polish. The core is solid; some community provider plugins are thinner than others.
- You still manage keys and costs. Hosted models need their API keys configured, and the bill is yours.
- Big pipes, big prompts. Piping a huge file in sends a huge prompt; mind the context window and the token count.
For anyone who lives in the shell, llm turns a language model into a composable building block - and the SQLite log alone is worth the install.
Internal link suggestion: link "fully local models" to the Ollama post, which llm pairs with directly through the llm-ollama plugin.