LLM puts the power of large language models directly in your terminal. In the next five minutes you’ll install the tool, authenticate with OpenAI, run your first prompt, try piping files through a system prompt, start an interactive chat session, and extend LLM with a plugin to access Anthropic or Gemini models — no boilerplate, no SDK setup.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/simonw/LLM/llms.txt
Use this file to discover all available pages before exploring further.
LLM’s default model is gpt-4o-mini — OpenAI’s fastest and most cost-effective model. You can change this at any time with
llm models default <model-id>.Install LLM
Install LLM with Verify the installation:You should see output like
pip, pipx, uv, or Homebrew. pip is the simplest:llm, version 0.32.Set your OpenAI API key
LLM needs an API key to call OpenAI. Get one from platform.openai.com/api-keys, then store it:You’ll be prompted to paste it:The key is saved to a local
keys.json file and used automatically from here on. Run llm keys path to see where it is stored.Run your first prompt
Pass a prompt as a quoted string directly to Example output:LLM streams the response in real time. Every prompt and response is automatically logged to a local SQLite database — run
llm:llm logs to browse your history.Pipe a file through a system prompt
LLM reads from standard input, so you can pipe any file directly into it. Use Example output for a short Python file:
-s to supply a system prompt that tells the model what to do with the content:Start an interactive chat session
Use Type
llm chat to open a persistent, multi-turn conversation with a model. Type messages at the > prompt; the model remembers the full conversation history:exit or quit to end the session. Use !multi to paste multi-line input, and !edit to open your $EDITOR for longer prompts.Install a plugin and use Anthropic or Gemini
LLM’s plugin system lets you add support for any model provider. Install a plugin with Run a prompt with Claude:Google Gemini:Run a prompt with Gemini:Local models with Ollama:If you have Ollama installed and running locally:This runs entirely on your own machine — no API key required.
llm install, then set its API key and start using the new models immediately.Anthropic (Claude models):What’s Next?
You’ve covered the core workflow. Here are some directions to explore:- System prompts & templates — Save reusable system prompts as named templates with
llm --saveand apply them withllm -t <template>. - Structured output — Extract typed JSON from any text using
--schema. Great for data pipelines and automation. - Embeddings — Generate vector embeddings and run semantic similarity searches with
llm embedandllm similar. - Tools — Grant models the ability to call Python functions during a prompt with the
--toolflag. - Log browsing — Search and replay your full prompt history with
llm logsor open it in Datasette.