2023-06-17 12:33:12 +00:00
# LLM
2023-06-15 16:51:12 +00:00
2023-06-17 17:03:05 +00:00
[](https://pypi.org/project/llm/)
[](https://llm.datasette.io/en/stable/changelog.html)
[](https://github.com/simonw/llm/actions?query=workflow%3ATest)
2023-07-03 20:11:33 +00:00
[](https://github.com/simonw/llm/blob/main/LICENSE)
2023-07-12 01:56:38 +00:00
[](https://datasette.io/discord-llm)
2023-06-17 17:03:05 +00:00
2023-06-15 16:51:12 +00:00
A command-line utility for interacting with Large Language Models, such as OpenAI's GPT series.
2023-06-17 17:01:48 +00:00
## Quick start
2023-06-15 16:51:12 +00:00
2023-07-12 03:00:47 +00:00
You'll need an [OpenAI API key ](https://platform.openai.com/account/api-keys ) for this:
2023-06-17 17:01:48 +00:00
```bash
# Install LLM
2023-06-15 16:51:12 +00:00
pip install llm
2023-06-17 17:01:48 +00:00
# Or use: brew install simonw/llm/llm
# Paste your OpenAI API key into this:
2023-06-15 16:51:12 +00:00
llm keys set openai
2023-06-17 17:01:48 +00:00
# Run a prompt
2023-06-15 16:51:12 +00:00
llm "Ten fun names for a pet pelican"
2023-07-12 03:00:47 +00:00
# Run a system prompt against a file
cat myfile.py | llm -s "Explain this code"
2023-06-15 16:51:12 +00:00
```
2023-07-12 03:00:47 +00:00
You can also [install plugins ](https://github.com/simonw/llm-plugins ) to access models by other providers, including models that can be installed and run on your own device.
2023-06-17 17:01:48 +00:00
## Contents
2023-06-15 16:51:12 +00:00
```{toctree}
---
maxdepth: 3
---
setup
usage
2023-07-01 15:50:39 +00:00
python-api
2023-06-17 07:40:46 +00:00
templates
2023-06-15 16:51:12 +00:00
logging
2023-07-10 19:48:25 +00:00
plugins/index
2023-06-17 08:09:22 +00:00
help
2023-06-15 16:51:12 +00:00
contributing
2023-06-16 08:06:30 +00:00
changelog
2023-06-15 16:51:12 +00:00
```