explaingit

simonw/llm

11,856PythonAudience · developerComplexity · 2/5Setup · easy

TLDR

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.

Mindmap

mindmap
  root((simonw/llm))
    What it does
      Prompt any AI model
      Terminal interface
      Auto-save to SQLite
    Supported models
      OpenAI GPT
      Anthropic Claude
      Google Gemini
      Local via plugins
    Features
      Embeddings
      Structured schemas
      Fragment context
      Tool use
    Audience
      Developers
      CLI power users
    Extend
      Plugin system
      Ollama local models
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Send a prompt to any supported AI model from your terminal without opening a browser or writing code

USE CASE 2

Pipe a text file into an AI model to summarize or analyze it in a single shell command

USE CASE 3

Search through your full history of past AI conversations stored automatically in a local SQLite database

USE CASE 4

Extract structured JSON data from unstructured text using a schema definition and the llm CLI

Tech stack

PythonSQLite

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

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.

Copy-paste prompts

Prompt 1
Write a bash one-liner using the llm CLI that reads every markdown file in a folder, summarizes each one, and saves all summaries to a single output file
Prompt 2
How do I install the Ollama plugin for llm and run a local Llama model entirely on my own machine?
Prompt 3
Show me how to define a JSON schema with llm to extract structured product data from a pile of raw text descriptions
Prompt 4
Set up llm to use Claude as the default model and start an interactive multi-turn chat session from the terminal
Prompt 5
How do I query my llm conversation history SQLite database to find all sessions where I asked about a specific topic?
Open on GitHub → Explain another repo

← simonw on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.