llm
Access large language models from the command-line
File Explorer
- cog.yml
- publish.yml
- stable-docs.yml
- test.yml
- dependabot.yml
- FUNDING.yml
- base.html
- cli.md
- index.md
- python-api.md
- storage.md
- writing-plugins.md
- llm_markov.py
- pyproject.toml
- advanced-model-plugins.md
- directory.md
- index.md
- installing-plugins.md
- plugin-hooks.md
- plugin-utilities.md
- tutorial-model-plugin.md
- .gitignore
- aliases.md
- changelog.md
- conf.py
- contributing.md
- fragments.md
- help.md
- index.md
- logging.md
- Makefile
- openai-models.md
- other-models.md
- python-api.md
- related-tools.md
- requirements.txt
- schemas.md
- setup.md
- templates.md
- tools.md
- usage.md
- __init__.py
- default_tools.py
- openai_models.py
- __init__.py
- __main__.py
- cli.py
- embeddings.py
- embeddings_migrations.py
- errors.py
- hookspecs.py
- logs.py
- migrations.py
- models.py
- parts.py
- plugins.py
- py.typed
- serialization.py
- templates.py
- tools.py
- utils.py
- test_responses_basic_non_streaming.yaml
- test_responses_basic_streaming.yaml
- test_responses_interleaved_reasoning_between_tool_calls.yaml
- test_responses_round_trips_encrypted_reasoning.yaml
- test_responses_tool_use.yaml
- test_responses_tool_use_streaming.yaml
- test_tool_use_basic.yaml
- test_tool_use_chain_of_two_calls.yaml
- test_tools_streaming_variant_a.yaml
- test_tools_streaming_variant_b.yaml
- test_tools_streaming_variant_c.yaml
- test_tools_streaming_variant_d.yaml
- conftest.py
- test-llm-load-plugins.sh
- test_aliases.py
- test_async.py
- test_async_parity.py
- test_attachments.py
- test_chat.py
- test_chat_templates.py
- test_cli_openai_models.py
- test_cli_options.py
- test_cli_streaming.py
- test_embed.py
- test_embed_cli.py
- test_encode_decode.py
- test_fragments_cli.py
- test_keys.py
- test_llm.py
- test_llm_logs.py
- test_logs_store.py
- test_migrate.py
- test_openai_endpoint.py
- test_openai_messages.py
- test_openai_responses.py
- test_options_parameter.py
- test_parts.py
- test_pause_resume.py
- test_plugins.py
- test_serialization.py
- test_templates.py
- test_tools.py
- test_tools_streaming.py
- test_utils.py
- .gitignore
- .readthedocs.yaml
- AGENTS.md
- Justfile
- LICENSE
- MANIFEST.in
- mypy.ini
- pyproject.toml
- pytest.ini
- README.md
- ruff.toml
# Installation Guide
pythonSetup Steps
pip install llm
Install the llm package using pip.
llm keys set openai
Configure your OpenAI API key.
llm "Ten fun names for a pet pelican"
Run a prompt using the installed LLM tool.
Video Guides
Language models on the command-line
Key Commands
pip install llm
Install llm using the Python package manager.
llm keys set openai
Save your OpenAI API key securely.
llm "Hello world"
Send a prompt to the large language model.
llm chat -m gpt-4.1
Start an interactive chat session with a model.
llm install llm-gemini
Install a plugin for additional features.
# Use via CDN
jsDelivrjsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.
Release Timeline
Actively MaintainedCommand Glossary
Commands referenced in this DOCs, explained below.
brew install
View Details ▼
brew install
Install a Homebrew formula or cask.
brew install {{formula|cask}}
Install a formula/cask:
brew install {{[-s|--build-from-source]}} {{formula}}
Build and install a formula from source (dependencies will still be installed from bottles):
brew install {{[-n|--dry-run]}} {{formula|cask}}
Download the manifest, print what would be installed but don't actually install anything:
llm
View Details ▼
llm
Interact with Large Language Models (LLMs) via remote APIs and models that can be installed and run on your machine.
llm keys set openai
Set up an OpenAI API Key:
llm "{{Ten fun names for a pet pelican}}"
Run a prompt:
cat {{path/to/file.py}} | llm {{[-s|--system]}} "{{Explain this code}}"
Run a system prompt against a file:
ollama
View Details ▼
ollama
A large language model runner.
For a list of available models, see <https://ollama.com/library>.
ollama serve
Start the daemon required to run other commands:
ollama run {{model}}
Run a model and chat with it (will automatically download the model if it's not downloaded):
ollama run {{model}} --think=false "{{prompt}}"
Run a model with a single prompt and thinking turned off:
pip install
View Details ▼
pip install
Install Python packages.
pip install {{package1 package2 ...}}
Install one or more packages:
pip install {{package1 package2 ...}} {{[-U|--upgrade]}}
Upgrade all specified packages to the latest version, installing any that are not already present:
pip install {{package}}=={{version}}
Install a specific version of a package:
pip
View Details ▼
pip
Python package manager.
Some subcommands such as `install` have their own usage documentation.
pip install {{package}}
Install a package (see `pip install` for more install examples):
pip install --user {{package}}
Install a package to the user's directory instead of the system-wide default location:
pip install {{[-U|--upgrade]}} {{package}}
Upgrade a package:
pipx
View Details ▼
pipx
Install and run Python applications in isolated environments.
pipx run {{pycowsay}} {{moo}}
Run an app in a temporary virtual environment:
pipx install {{package}}
Install a package in a virtual environment and add entry points to path:
pipx uninstall {{package}}
Uninstall a package:
sphinx-build
View Details ▼
sphinx-build
Sphinx documentation generator.
sphinx-build {{[-b|--builder]}} {{html|epub|text|latex|man|...}} {{path/to/source_directory}} {{path/to/build_directory}}
Build documentation:
sphinx-build {{[-b|--builder]}} {{html}} {{path/to/docs_directory}} {{path/to/build_directory}}
Build documentations intended for readthedocs.io (requires the sphinx-rtd-theme pip package):
uv tool
View Details ▼
uv tool
Install and run commands provided by Python packages.
uv tool run {{command}}
Run a command from a package, without installing it:
uv tool install {{package}}
Install a Python package system-wide:
uv tool upgrade {{package}}
Upgrade an installed Python package:
uvx
View Details ▼
uvx
This command is an alias of `uv tool run`.
tldr uv tool
View documentation for the original command:
