Back to services

LLM

Access large language models from the command-line

View alternatives to LLM
Suggest edit
Open source
Self-hostable
Apache-2.0
Recent reviews

Alternatives

Tech stack

No tech stack added yet. Sign in to suggest some

Note: Fetching the official website failed this time, so the following content has been compiled from what is known about the project. Some details may change as new versions are released. Please refer to the official documentation for the latest information.

Introduction

LLM is an open-source project by Simon Willison, the creator of Datasette. It includes a command-line tool and a Python library for interacting with large language models. Its goal is to give you one consistent way to call models from different providers, as well as local models, right from the terminal, and to save every interaction so you can search and analyze it later.

Key Features

  • Unified model access: OpenAI models are supported by default, and after installing plugins you can also use remote models such as Anthropic Claude and Google Gemini.
  • Local model support: Plugins let you connect to solutions such as Ollama and run open-source models on your own machine.
  • Plugin system: There are many community plugins that extend models, commands and other functionality.
  • SQLite logging: Prompts and responses are written to a SQLite database by default. You can view them with llm logs, or browse and analyze them with Datasette.
  • Chat mode: llm chat lets you hold multi-turn conversations in the terminal.
  • Pipe integration: Standard input is supported, for example cat file.py | llm -s "Explain this code", so it fits easily into shell workflows.
  • Templates and system prompts: Frequently used prompts can be saved as templates and reused.
  • Embeddings: You can generate and store text embeddings and run similarity searches.
  • Multimodal attachments: Models that support them can accept attachments such as images as input.

Target Users and Use Cases

It suits developers, data analysts and anyone comfortable with the command line. Typical uses include asking quick questions in the terminal, batch-processing text in scripts, and comparing the output of different models. Because all records are stored in SQLite, it is also a good fit for people who want to keep and review their AI interactions over the long term.

Installation and Usage

You can install it with any of the following:

pip install llm
# or
pipx install llm
# or
brew install llm

Set an API key and run a prompt:

llm keys set openai
llm "给我讲一个关于鹈鹕的笑话"

Install a plugin (using Anthropic as an example):

llm install llm-anthropic

Technical Requirements

  • A Python environment is required
  • Using remote models requires an API key from the corresponding provider
  • Running local models requires the appropriate plugin and sufficient local hardware resources

Notable Characteristics

  • Open-source and actively developed; the author often introduces new features on his blog
  • Can be used as a command-line tool or embedded in your own programs as a Python library
  • Works well with the Datasette ecosystem, making it easy to analyze interaction data