Skip to main content

LLM

GitHub repo PyPI Changelog Tests License Discord Homebrew

A CLI tool and Python library for interacting with OpenAI, Anthropic’s Claude, Google’s Gemini, Qwen, Gemma, Kimi, DeepSeek, Mistral, and dozens of other Large Language Models, both via remote APIs and with models that can be installed and run on your own machine.

Watch Language models on the command-line on YouTube for a demo or read the accompanying detailed notes.

With LLM you can:

Quick start

First, install LLM using pip or Homebrew or pipx or uv:

pip install llm

Or with Homebrew (see warning note):

brew install llm

Or with pipx:

pipx install llm

Or with uv

uv tool install llm

Use LLM to run prompts or start chats against an arbitrary OpenAI-compatible Chat Completions endpoint, such as LM Studio. With uvx, you can do this without installing LLM first:

uvx llm openai endpoint http://localhost:1234/v1 \
  -m google/gemma-4-12b \
  "What is the capital of France?"

uvx llm openai endpoint http://localhost:1234/v1 \
  -m google/gemma-4-12b \
  --chat

Add --key your-api-key if the endpoint requires authentication. See Run against an endpoint without configuring it for more options.

If you have an OpenAI API key key you can run this:

# Paste your OpenAI API key into this
llm keys set openai

# Run a prompt (with the default gpt-5.6-luna model)
llm "Ten fun names for a pet pelican"

# Extract text from an image
llm "extract text" -a scanned-document.jpg

# Use a system prompt against a file
cat myfile.py | llm -s "Explain this code"

Run prompts against Gemini or Anthropic with their respective plugins:

llm install llm-gemini
llm keys set gemini
# Paste Gemini API key here
llm -m gemini-3.5-flash 'Tell me fun facts about Mountain View'

llm install llm-anthropic
llm keys set anthropic
# Paste Anthropic API key here
llm -m claude-sonnet-5 'Impress me with wild facts about turnips'

You can also install a plugin to access models that can run on your local device. If you use Ollama:

# Install the plugin
llm install llm-ollama

# Download and run a prompt against the Orca Mini 7B model
ollama pull llama3.2:latest
llm -m llama3.2:latest 'What is the capital of France?'

To start an interactive chat with a model, use llm chat:

llm chat -m gpt-4.1
Chatting with gpt-4.1
Type 'exit' or 'quit' to exit
Type '!multi' to enter multiple lines, then '!end' to finish
Type '!edit' to open your default editor and modify the prompt.
Type '!fragment <my_fragment> [<another_fragment> ...]' to insert one or more fragments
> Tell me a joke about a pelican
Why don't pelicans like to tip waiters?

Because they always have a big bill!

Project news

For everything else, see the llm tag on my blog.

Contents

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm-0.35.tar.gz (154.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm-0.35-py3-none-any.whl (145.7 kB view details)

Uploaded Python 3

File details

Details for the file llm-0.35.tar.gz.

File metadata

  • Download URL: llm-0.35.tar.gz
  • Upload date:
  • Size: 154.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for llm-0.35.tar.gz
Algorithm Hash digest
SHA256 2ee0955b2e372408813ce966f3d03ad2c7419b85a547880c53797d31d3a3fdb6
MD5 3217f31fb93b444780c62e3b304a88b4
BLAKE2b-256 b568baeda27122a280940c5e9ae7291b821fa96ea23f50a00f568e9cff0c3aac

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm-0.35.tar.gz:

Publisher: publish.yml on simonw/llm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm-0.35-py3-none-any.whl.

File metadata

  • Download URL: llm-0.35-py3-none-any.whl
  • Upload date:
  • Size: 145.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for llm-0.35-py3-none-any.whl
Algorithm Hash digest
SHA256 9dad1c92487161c1b7c9bddb5dfffd3dc6d4497dd52697c3d36b3a87948874b2
MD5 be6f9689fdcffe17132324bcca88cf37
BLAKE2b-256 e48fc1b86ef3db8b64c3256d6cb2afd328044152b26e4fc41c35c3d5b177ed66

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm-0.35-py3-none-any.whl:

Publisher: publish.yml on simonw/llm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.35 This release

2 files

0.34

2 files

0.33

2 files

0.32.1

2 files

0.32

2 files

0.31.1

2 files

0.31

2 files

0.30

2 files

0.29

2 files

0.28

2 files

0.27.1

2 files

0.27

2 files

0.26

2 files

0.25

2 files

0.24.2

2 files

0.24.1

2 files

0.24

2 files

0.23

2 files

0.22

2 files

0.21

2 files

0.20

2 files

0.19.1

2 files

0.19

2 files

0.18

2 files

0.17.1

2 files

0.17

2 files

0.16

2 files

0.15

2 files

0.14

2 files

0.13.1

2 files

0.13

2 files

0.12

2 files

0.11.2

2 files

0.11.1

2 files

0.11

2 files

0.10

2 files

0.9

2 files

0.8.1

2 files

0.8

2 files

0.7.1

2 files

0.7

2 files

0.6.1

2 files

0.6

2 files

0.5

2 files

0.4.1

2 files

0.4

2 files

0.3

2 files

0.2

2 files

0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page