mirror of
https://github.com/Hopiu/llm.git
synced 2026-04-08 07:20:58 +00:00
63 lines
2 KiB
Markdown
63 lines
2 KiB
Markdown
# LLM
|
|
|
|
[](https://pypi.org/project/llm/)
|
|
[](https://llm.datasette.io/en/stable/changelog.html)
|
|
[](https://github.com/simonw/llm/actions?query=workflow%3ATest)
|
|
[](https://github.com/simonw/llm/blob/main/LICENSE)
|
|
[](https://datasette.io/discord-llm)
|
|
|
|
A CLI utility and Python library for interacting with Large Language Models, including OpenAI, PaLM and local models installed on your own machine.
|
|
|
|
Background on this project:
|
|
- [llm, ttok and strip-tags—CLI tools for working with ChatGPT and other LLMs](https://simonwillison.net/2023/May/18/cli-tools-for-llms/)
|
|
- [The LLM CLI tool now supports self-hosted language models via plugins](https://simonwillison.net/2023/Jul/12/llm/)
|
|
- [Accessing Llama 2 from the command-line with the llm-replicate plugin](https://simonwillison.net/2023/Jul/18/accessing-llama-2/)
|
|
|
|
## Quick start
|
|
|
|
First, install LLM using `pip` or Homebrew:
|
|
|
|
```bash
|
|
pip install llm
|
|
```
|
|
Or with Homebrew:
|
|
```bash
|
|
brew install llm
|
|
```
|
|
If you have an [OpenAI API key](https://platform.openai.com/account/api-keys) key you can run this:
|
|
```bash
|
|
# Paste your OpenAI API key into this
|
|
llm keys set openai
|
|
|
|
# Run a prompt
|
|
llm "Ten fun names for a pet pelican"
|
|
|
|
# Run a system prompt against a file
|
|
cat myfile.py | llm -s "Explain this code"
|
|
```
|
|
Or you can {ref}`install a plugin <installing-plugins>` and use models that can run on your local device:
|
|
```bash
|
|
# Install the plugin
|
|
llm install llm-gpt4all
|
|
|
|
# Download and run a prompt against the Vicuna model
|
|
llm -m ggml-vicuna-7b-1 'What is the capital of France?'
|
|
```
|
|
|
|
## Contents
|
|
|
|
```{toctree}
|
|
---
|
|
maxdepth: 3
|
|
---
|
|
setup
|
|
usage
|
|
other-models
|
|
python-api
|
|
templates
|
|
logging
|
|
plugins/index
|
|
help
|
|
contributing
|
|
changelog
|
|
```
|