LLM

A CLI and Python library for OpenAI, Claude, Gemini, local and other models: prompts, chats, tools, embeddings and a SQLite log

CLIMedium risk

simonw/llm

Install

pipx install llm

Also: pip install llm, uv tool install llm, brew install llm.

This is third-party code. Review the repository files before installing.

What it does

LLM runs prompts against language models from the terminal and from Python. Models come through plugins: remote APIs such as Gemini and Anthropic, and local ones such as Ollama. Every prompt and response is logged to SQLite so you can revisit and analyze history. It can build embeddings, extract structured data by schema from text and images, and let models call tools. Output pipes cleanly, so LLM is often used in scripts and by agents.

Who it is for. For developers and analysts who want one terminal interface to many models for scripts and experiments.

Good fit when

  • You need a model call inside a shell script or pipeline
  • You want to compare models and keep a history
  • You need quick embeddings or schema-based extraction

Not a fit when

  • You need an agent that edits code in the project itself
  • You want a graphical chat client

Example request

Use llm to run every file in the logs folder through a model and list the errors it finds

Limitations

Cloud models need provider keys, and OpenAI, Anthropic and Gemini APIs do not work from Russia without a VPN. Local models via plugins need no external services. The Homebrew install has caveats noted in the docs.

How to disable. Uninstall the same way you installed: pip uninstall llm, pipx uninstall llm, uv tool uninstall llm or brew uninstall llm.

Security check

  • Sends data to external model providers
  • Stores API keys and prompt history locally

README in short

The README lists capabilities: command-line prompts, SQLite logging, embeddings, schema extraction and tool calling. Install via pip, Homebrew, pipx or uv, or run without install via uvx against an OpenAI-compatible endpoint. It shows setting keys, installing Gemini, Anthropic and Ollama plugins and starting a chat. Full docs are at llm.datasette.io. Apache-2.0 licensed.

FAQ

Can I use local models?

Yes, via plugins such as llm-ollama or by pointing at an OpenAI-compatible endpoint like LM Studio.

Where is history stored?

In a SQLite database managed by LLM, which you can search and report on.

Editors’ pick

Open-source personal AI assistant on your own machine: answers in Telegram, Slack, Discord and WhatsApp, extended with skills and plugins

CLIHigh risk389.7K
Editors’ pick

A self-improving agent from Nous Research with a TUI, messaging gateway, cron jobs and skills it writes itself

CLIHigh risk245.5K
Editors’ pick

An open source coding agent for the terminal and desktop with build and plan modes

CLIHigh risk207.4K
Editors’ pick

Open prompt library with a Claude Code plugin, MCP server and CLI: search, fetch and improve prompts and skills from an agent

PluginMedium risk170.3K