2023-06-17 08:09:22 +00:00
|
|
|
# CLI reference
|
|
|
|
|
|
|
|
|
|
This page lists the `--help` output for all of the `llm` commands.
|
|
|
|
|
|
|
|
|
|
<!-- [[[cog
|
|
|
|
|
from click.testing import CliRunner
|
|
|
|
|
from llm.cli import cli
|
|
|
|
|
def all_help(cli):
|
|
|
|
|
"Return all help for Click command and its subcommands"
|
|
|
|
|
# First find all commands and subcommands
|
|
|
|
|
# List will be [["command"], ["command", "subcommand"], ...]
|
|
|
|
|
commands = []
|
|
|
|
|
def find_commands(command, path=None):
|
|
|
|
|
path = path or []
|
|
|
|
|
commands.append(path + [command.name])
|
|
|
|
|
if hasattr(command, 'commands'):
|
|
|
|
|
for subcommand in command.commands.values():
|
|
|
|
|
find_commands(subcommand, path + [command.name])
|
|
|
|
|
find_commands(cli)
|
|
|
|
|
# Remove first item of each list (it is 'cli')
|
|
|
|
|
commands = [command[1:] for command in commands]
|
|
|
|
|
# Now generate help for each one, with appropriate heading level
|
|
|
|
|
output = []
|
|
|
|
|
for command in commands:
|
|
|
|
|
heading_level = len(command) + 2
|
|
|
|
|
result = CliRunner().invoke(cli, command + ["--help"])
|
2023-09-04 02:35:14 +00:00
|
|
|
hyphenated = "-".join(command)
|
|
|
|
|
if hyphenated:
|
|
|
|
|
hyphenated = "-" + hyphenated
|
2023-09-05 00:08:30 +00:00
|
|
|
output.append(f"\n(help{hyphenated})=")
|
2023-06-17 08:09:22 +00:00
|
|
|
output.append("#" * heading_level + " llm " + " ".join(command) + " --help")
|
|
|
|
|
output.append("```")
|
|
|
|
|
output.append(result.output.replace("Usage: cli", "Usage: llm").strip())
|
|
|
|
|
output.append("```")
|
|
|
|
|
return "\n".join(output)
|
|
|
|
|
cog.out(all_help(cli))
|
|
|
|
|
]]] -->
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help)=
|
2023-06-17 08:09:22 +00:00
|
|
|
## llm --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm [OPTIONS] COMMAND [ARGS]...
|
|
|
|
|
|
2024-11-06 14:38:53 +00:00
|
|
|
Access Large Language Models from the command-line
|
2023-06-17 08:09:22 +00:00
|
|
|
|
2023-06-17 08:17:52 +00:00
|
|
|
Documentation: https://llm.datasette.io/
|
|
|
|
|
|
2024-11-06 14:38:53 +00:00
|
|
|
LLM can run models from many different providers. Consult the plugin directory
|
|
|
|
|
for a list of available models:
|
|
|
|
|
|
|
|
|
|
https://llm.datasette.io/en/stable/plugins/directory.html
|
|
|
|
|
|
|
|
|
|
To get started with OpenAI, obtain an API key from them and:
|
2023-06-17 08:17:52 +00:00
|
|
|
|
|
|
|
|
$ llm keys set openai
|
|
|
|
|
Enter key: ...
|
|
|
|
|
|
|
|
|
|
Then execute a prompt like this:
|
|
|
|
|
|
|
|
|
|
llm 'Five outrageous names for a pet pelican'
|
|
|
|
|
|
2023-06-17 08:09:22 +00:00
|
|
|
Options:
|
|
|
|
|
--version Show the version and exit.
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
Commands:
|
2023-08-28 05:24:10 +00:00
|
|
|
prompt* Execute a prompt
|
|
|
|
|
aliases Manage model aliases
|
2023-09-05 05:04:13 +00:00
|
|
|
chat Hold an ongoing chat with a model.
|
2023-09-10 21:24:27 +00:00
|
|
|
collections View and manage collections of embeddings
|
2023-08-28 05:24:10 +00:00
|
|
|
embed Embed text and store or return the result
|
|
|
|
|
embed-models Manage available embedding models
|
2023-09-03 22:08:04 +00:00
|
|
|
embed-multi Store embeddings for multiple strings at once
|
2023-08-28 05:24:10 +00:00
|
|
|
install Install packages from PyPI into the same environment as LLM
|
|
|
|
|
keys Manage stored API keys for different models
|
|
|
|
|
logs Tools for exploring logged prompts and responses
|
|
|
|
|
models Manage available models
|
|
|
|
|
openai Commands for working directly with the OpenAI API
|
|
|
|
|
plugins List installed plugins
|
2025-02-27 15:35:28 +00:00
|
|
|
schemas Manage stored schemas
|
2025-02-26 18:07:10 +00:00
|
|
|
similar Return top N similar IDs from a collection using cosine...
|
2023-08-28 05:24:10 +00:00
|
|
|
templates Manage stored prompt templates
|
|
|
|
|
uninstall Uninstall Python packages from the LLM environment
|
2023-06-17 08:09:22 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-prompt)=
|
2023-06-17 08:09:22 +00:00
|
|
|
### llm prompt --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm prompt [OPTIONS] [PROMPT]
|
|
|
|
|
|
2023-06-17 08:17:52 +00:00
|
|
|
Execute a prompt
|
|
|
|
|
|
|
|
|
|
Documentation: https://llm.datasette.io/en/stable/usage.html
|
2023-06-17 08:09:22 +00:00
|
|
|
|
2024-10-28 22:03:30 +00:00
|
|
|
Examples:
|
|
|
|
|
|
|
|
|
|
llm 'Capital of France?'
|
|
|
|
|
llm 'Capital of France?' -m gpt-4o
|
|
|
|
|
llm 'Capital of France?' -s 'answer in Spanish'
|
|
|
|
|
|
|
|
|
|
Multi-modal models can be called with attachments like this:
|
|
|
|
|
|
|
|
|
|
llm 'Extract text from this image' -a image.jpg
|
|
|
|
|
llm 'Describe' -a https://static.simonwillison.net/static/2024/pelicans.jpg
|
|
|
|
|
cat image | llm 'describe image' -a -
|
2024-10-28 22:06:17 +00:00
|
|
|
# With an explicit mimetype:
|
2024-10-28 22:03:30 +00:00
|
|
|
cat image | llm 'describe image' --at - image/jpeg
|
|
|
|
|
|
2024-12-19 14:40:05 +00:00
|
|
|
The -x/--extract option returns just the content of the first ``` fenced code
|
|
|
|
|
block, if one is present. If none are present it returns the full response.
|
|
|
|
|
|
|
|
|
|
llm 'JavaScript function for reversing a string' -x
|
|
|
|
|
|
2023-06-17 08:09:22 +00:00
|
|
|
Options:
|
2024-10-28 22:03:30 +00:00
|
|
|
-s, --system TEXT System prompt to use
|
|
|
|
|
-m, --model TEXT Model to use
|
|
|
|
|
-a, --attachment ATTACHMENT Attachment path or URL or -
|
|
|
|
|
--at, --attachment-type <TEXT TEXT>...
|
|
|
|
|
Attachment with explicit mimetype
|
|
|
|
|
-o, --option <TEXT TEXT>... key/value options for the model
|
2025-02-27 05:51:08 +00:00
|
|
|
--schema TEXT JSON schema, filepath or ID
|
2024-10-28 22:03:30 +00:00
|
|
|
-t, --template TEXT Template to use
|
|
|
|
|
-p, --param <TEXT TEXT>... Parameters for template
|
|
|
|
|
--no-stream Do not stream output
|
|
|
|
|
-n, --no-log Don't log to database
|
|
|
|
|
--log Log prompt and response to the database
|
|
|
|
|
-c, --continue Continue the most recent conversation.
|
|
|
|
|
--cid, --conversation TEXT Continue the conversation with the given ID.
|
|
|
|
|
--key TEXT API key to use
|
|
|
|
|
--save TEXT Save prompt with this template name
|
2024-11-14 01:51:00 +00:00
|
|
|
--async Run prompt asynchronously
|
2024-11-20 04:21:59 +00:00
|
|
|
-u, --usage Show token usage
|
2024-12-19 14:40:05 +00:00
|
|
|
-x, --extract Extract first fenced code block
|
2025-01-24 18:52:46 +00:00
|
|
|
--xl, --extract-last Extract last fenced code block
|
2024-10-28 22:03:30 +00:00
|
|
|
--help Show this message and exit.
|
2023-06-17 08:09:22 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-05 05:04:13 +00:00
|
|
|
(help-chat)=
|
|
|
|
|
### llm chat --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm chat [OPTIONS]
|
|
|
|
|
|
|
|
|
|
Hold an ongoing chat with a model.
|
|
|
|
|
|
|
|
|
|
Options:
|
2023-09-10 18:16:44 +00:00
|
|
|
-s, --system TEXT System prompt to use
|
|
|
|
|
-m, --model TEXT Model to use
|
|
|
|
|
-c, --continue Continue the most recent conversation.
|
|
|
|
|
--cid, --conversation TEXT Continue the conversation with the given ID.
|
|
|
|
|
-t, --template TEXT Template to use
|
|
|
|
|
-p, --param <TEXT TEXT>... Parameters for template
|
|
|
|
|
-o, --option <TEXT TEXT>... key/value options for the model
|
2023-09-10 18:49:32 +00:00
|
|
|
--no-stream Do not stream output
|
2023-09-10 18:16:44 +00:00
|
|
|
--key TEXT API key to use
|
|
|
|
|
--help Show this message and exit.
|
2023-09-05 05:04:13 +00:00
|
|
|
```
|
|
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-keys)=
|
2023-06-17 08:09:22 +00:00
|
|
|
### llm keys --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm keys [OPTIONS] COMMAND [ARGS]...
|
|
|
|
|
|
2023-06-17 08:17:52 +00:00
|
|
|
Manage stored API keys for different models
|
2023-06-17 08:09:22 +00:00
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
Commands:
|
2023-08-21 06:11:47 +00:00
|
|
|
list* List names of all stored keys
|
2024-11-11 17:47:13 +00:00
|
|
|
get Return the value of a stored key
|
2023-08-21 06:11:47 +00:00
|
|
|
path Output the path to the keys.json file
|
|
|
|
|
set Save a key in the keys.json file
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-keys-list)=
|
2023-08-21 06:11:47 +00:00
|
|
|
#### llm keys list --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm keys list [OPTIONS]
|
|
|
|
|
|
|
|
|
|
List names of all stored keys
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
2023-06-17 08:09:22 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-keys-path)=
|
2023-06-17 08:09:22 +00:00
|
|
|
#### llm keys path --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm keys path [OPTIONS]
|
|
|
|
|
|
2023-06-17 08:17:52 +00:00
|
|
|
Output the path to the keys.json file
|
2023-06-17 08:09:22 +00:00
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2024-11-11 17:47:13 +00:00
|
|
|
(help-keys-get)=
|
|
|
|
|
#### llm keys get --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm keys get [OPTIONS] NAME
|
|
|
|
|
|
|
|
|
|
Return the value of a stored key
|
|
|
|
|
|
2024-11-11 17:53:24 +00:00
|
|
|
Example usage:
|
|
|
|
|
|
|
|
|
|
export OPENAI_API_KEY=$(llm keys get openai)
|
|
|
|
|
|
2024-11-11 17:47:13 +00:00
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
|
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-keys-set)=
|
2023-06-17 08:09:22 +00:00
|
|
|
#### llm keys set --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm keys set [OPTIONS] NAME
|
|
|
|
|
|
2023-06-17 08:17:52 +00:00
|
|
|
Save a key in the keys.json file
|
2023-06-17 08:09:22 +00:00
|
|
|
|
|
|
|
|
Example usage:
|
|
|
|
|
|
|
|
|
|
$ llm keys set openai
|
|
|
|
|
Enter key: ...
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--value TEXT Value to set
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-logs)=
|
2023-06-17 08:09:22 +00:00
|
|
|
### llm logs --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm logs [OPTIONS] COMMAND [ARGS]...
|
|
|
|
|
|
2023-06-17 08:17:52 +00:00
|
|
|
Tools for exploring logged prompts and responses
|
2023-06-17 08:09:22 +00:00
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
Commands:
|
2023-07-12 02:38:01 +00:00
|
|
|
list* Show recent logged prompts and their responses
|
2023-07-12 02:48:16 +00:00
|
|
|
off Turn off logging for all prompts
|
|
|
|
|
on Turn on logging for all prompts
|
2023-07-12 02:38:01 +00:00
|
|
|
path Output the path to the logs.db file
|
|
|
|
|
status Show current status of database logging
|
2023-06-17 08:09:22 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-logs-path)=
|
2023-06-17 08:09:22 +00:00
|
|
|
#### llm logs path --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm logs path [OPTIONS]
|
|
|
|
|
|
2023-06-17 08:29:36 +00:00
|
|
|
Output the path to the logs.db file
|
2023-06-17 08:09:22 +00:00
|
|
|
|
2023-07-12 02:38:01 +00:00
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-logs-status)=
|
2023-07-12 02:38:01 +00:00
|
|
|
#### llm logs status --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm logs status [OPTIONS]
|
|
|
|
|
|
|
|
|
|
Show current status of database logging
|
|
|
|
|
|
2023-07-12 02:48:16 +00:00
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-logs-on)=
|
2023-07-12 02:48:16 +00:00
|
|
|
#### llm logs on --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm logs on [OPTIONS]
|
|
|
|
|
|
|
|
|
|
Turn on logging for all prompts
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-logs-off)=
|
2023-07-12 02:48:16 +00:00
|
|
|
#### llm logs off --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm logs off [OPTIONS]
|
|
|
|
|
|
|
|
|
|
Turn off logging for all prompts
|
|
|
|
|
|
2023-06-17 08:09:22 +00:00
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-logs-list)=
|
2023-06-17 08:09:22 +00:00
|
|
|
#### llm logs list --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm logs list [OPTIONS]
|
|
|
|
|
|
2023-06-17 08:17:52 +00:00
|
|
|
Show recent logged prompts and their responses
|
2023-06-17 08:09:22 +00:00
|
|
|
|
|
|
|
|
Options:
|
2023-08-17 21:32:43 +00:00
|
|
|
-n, --count INTEGER Number of entries to show - defaults to 3, use 0
|
|
|
|
|
for all
|
|
|
|
|
-p, --path FILE Path to log database
|
|
|
|
|
-m, --model TEXT Filter by model or model alias
|
|
|
|
|
-q, --query TEXT Search for logs matching this string
|
2025-02-27 05:51:08 +00:00
|
|
|
--schema TEXT JSON schema, filepath or ID
|
|
|
|
|
--data Output newline-delimited JSON data for schema
|
|
|
|
|
--data-array Output JSON array of data for schema
|
|
|
|
|
--data-key TEXT Return JSON objects from array in this key
|
2023-08-17 21:32:43 +00:00
|
|
|
-t, --truncate Truncate long strings in output
|
2025-02-16 23:16:51 +00:00
|
|
|
-s, --short Shorter YAML output with truncated prompts
|
2024-11-20 04:21:59 +00:00
|
|
|
-u, --usage Include token usage
|
2024-03-04 21:28:59 +00:00
|
|
|
-r, --response Just output the last response
|
2025-01-10 23:53:04 +00:00
|
|
|
-x, --extract Extract first fenced code block
|
2025-01-24 18:52:46 +00:00
|
|
|
--xl, --extract-last Extract last fenced code block
|
2023-08-17 21:32:43 +00:00
|
|
|
-c, --current Show logs from the current conversation
|
|
|
|
|
--cid, --conversation TEXT Show logs for this conversation ID
|
|
|
|
|
--json Output logs as JSON
|
|
|
|
|
--help Show this message and exit.
|
2023-06-17 08:09:22 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-models)=
|
2023-06-26 14:49:12 +00:00
|
|
|
### llm models --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm models [OPTIONS] COMMAND [ARGS]...
|
|
|
|
|
|
|
|
|
|
Manage available models
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
Commands:
|
2023-08-20 03:04:14 +00:00
|
|
|
list* List available models
|
2023-07-01 21:01:29 +00:00
|
|
|
default Show or set the default model
|
2023-06-26 14:49:12 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-models-list)=
|
2023-06-26 14:49:12 +00:00
|
|
|
#### llm models list --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm models list [OPTIONS]
|
|
|
|
|
|
|
|
|
|
List available models
|
|
|
|
|
|
2023-07-01 21:01:29 +00:00
|
|
|
Options:
|
2025-01-09 19:37:33 +00:00
|
|
|
--options Show options for each model, if available
|
|
|
|
|
--async List async models
|
2025-02-13 23:33:20 +00:00
|
|
|
-q, --query TEXT Search for models matching these strings
|
2025-01-09 19:37:33 +00:00
|
|
|
--help Show this message and exit.
|
2023-07-01 21:01:29 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-models-default)=
|
2023-07-01 21:01:29 +00:00
|
|
|
#### llm models default --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm models default [OPTIONS] [MODEL]
|
|
|
|
|
|
|
|
|
|
Show or set the default model
|
|
|
|
|
|
2023-06-26 14:49:12 +00:00
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-templates)=
|
2023-06-17 08:09:22 +00:00
|
|
|
### llm templates --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm templates [OPTIONS] COMMAND [ARGS]...
|
|
|
|
|
|
2023-06-17 08:17:52 +00:00
|
|
|
Manage stored prompt templates
|
2023-06-17 08:09:22 +00:00
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
Commands:
|
2023-08-20 03:04:14 +00:00
|
|
|
list* List available prompt templates
|
|
|
|
|
edit Edit the specified prompt template using the default $EDITOR
|
|
|
|
|
path Output the path to the templates directory
|
|
|
|
|
show Show the specified prompt template
|
2023-06-17 08:09:22 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-templates-list)=
|
2023-06-17 08:09:22 +00:00
|
|
|
#### llm templates list --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm templates list [OPTIONS]
|
|
|
|
|
|
2023-06-17 08:17:52 +00:00
|
|
|
List available prompt templates
|
2023-06-17 08:09:22 +00:00
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-templates-show)=
|
2023-06-17 08:09:22 +00:00
|
|
|
#### llm templates show --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm templates show [OPTIONS] NAME
|
|
|
|
|
|
2023-06-17 08:17:52 +00:00
|
|
|
Show the specified prompt template
|
2023-06-17 08:09:22 +00:00
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-templates-edit)=
|
2023-06-17 08:09:22 +00:00
|
|
|
#### llm templates edit --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm templates edit [OPTIONS] NAME
|
|
|
|
|
|
2023-06-17 08:17:52 +00:00
|
|
|
Edit the specified prompt template using the default $EDITOR
|
2023-06-17 08:09:22 +00:00
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-templates-path)=
|
2023-06-17 08:09:22 +00:00
|
|
|
#### llm templates path --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm templates path [OPTIONS]
|
|
|
|
|
|
2023-06-17 08:17:52 +00:00
|
|
|
Output the path to the templates directory
|
2023-06-17 08:09:22 +00:00
|
|
|
|
2023-08-12 05:55:59 +00:00
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2025-02-27 15:35:28 +00:00
|
|
|
(help-schemas)=
|
|
|
|
|
### llm schemas --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm schemas [OPTIONS] COMMAND [ARGS]...
|
|
|
|
|
|
|
|
|
|
Manage stored schemas
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
Commands:
|
|
|
|
|
list* List stored schemas
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
(help-schemas-list)=
|
|
|
|
|
#### llm schemas list --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm schemas list [OPTIONS]
|
|
|
|
|
|
|
|
|
|
List stored schemas
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
-p, --path FILE Path to log database
|
|
|
|
|
-q, --query TEXT Search for schemas matching this string
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
|
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-aliases)=
|
2023-08-12 05:55:59 +00:00
|
|
|
### llm aliases --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm aliases [OPTIONS] COMMAND [ARGS]...
|
|
|
|
|
|
|
|
|
|
Manage model aliases
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
Commands:
|
2023-08-20 04:48:20 +00:00
|
|
|
list* List current aliases
|
2023-08-12 16:15:46 +00:00
|
|
|
path Output the path to the aliases.json file
|
|
|
|
|
remove Remove an alias
|
|
|
|
|
set Set an alias for a model
|
2023-08-12 05:55:59 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-aliases-list)=
|
2023-08-12 05:55:59 +00:00
|
|
|
#### llm aliases list --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm aliases list [OPTIONS]
|
|
|
|
|
|
|
|
|
|
List current aliases
|
|
|
|
|
|
2023-08-12 16:15:46 +00:00
|
|
|
Options:
|
|
|
|
|
--json Output as JSON
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-aliases-set)=
|
2023-08-12 16:15:46 +00:00
|
|
|
#### llm aliases set --help
|
|
|
|
|
```
|
2025-02-13 23:38:25 +00:00
|
|
|
Usage: llm aliases set [OPTIONS] ALIAS [MODEL_ID]
|
2023-08-12 16:15:46 +00:00
|
|
|
|
|
|
|
|
Set an alias for a model
|
|
|
|
|
|
|
|
|
|
Example usage:
|
|
|
|
|
|
2025-02-13 23:38:25 +00:00
|
|
|
llm aliases set mini gpt-4o-mini
|
|
|
|
|
|
|
|
|
|
Alternatively you can omit the model ID and specify one or more -q options.
|
|
|
|
|
The first model matching all of those query strings will be used.
|
|
|
|
|
|
|
|
|
|
llm aliases set mini -q 4o -q mini
|
2023-08-12 16:15:46 +00:00
|
|
|
|
|
|
|
|
Options:
|
2025-02-13 23:38:25 +00:00
|
|
|
-q, --query TEXT Set alias for model matching these strings
|
|
|
|
|
--help Show this message and exit.
|
2023-08-12 16:15:46 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-aliases-remove)=
|
2023-08-12 16:15:46 +00:00
|
|
|
#### llm aliases remove --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm aliases remove [OPTIONS] ALIAS
|
|
|
|
|
|
|
|
|
|
Remove an alias
|
|
|
|
|
|
|
|
|
|
Example usage:
|
|
|
|
|
|
|
|
|
|
$ llm aliases remove turbo
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-aliases-path)=
|
2023-08-12 16:15:46 +00:00
|
|
|
#### llm aliases path --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm aliases path [OPTIONS]
|
|
|
|
|
|
|
|
|
|
Output the path to the aliases.json file
|
|
|
|
|
|
2023-06-17 16:46:53 +00:00
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-plugins)=
|
2023-06-17 16:46:53 +00:00
|
|
|
### llm plugins --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm plugins [OPTIONS]
|
|
|
|
|
|
|
|
|
|
List installed plugins
|
|
|
|
|
|
2023-06-17 08:09:22 +00:00
|
|
|
Options:
|
2023-09-10 21:18:16 +00:00
|
|
|
--all Include built-in default plugins
|
2023-06-17 08:09:22 +00:00
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-install)=
|
2023-06-17 16:55:53 +00:00
|
|
|
### llm install --help
|
|
|
|
|
```
|
2023-07-06 00:58:19 +00:00
|
|
|
Usage: llm install [OPTIONS] [PACKAGES]...
|
2023-06-17 16:55:53 +00:00
|
|
|
|
|
|
|
|
Install packages from PyPI into the same environment as LLM
|
|
|
|
|
|
|
|
|
|
Options:
|
2023-07-26 05:18:45 +00:00
|
|
|
-U, --upgrade Upgrade packages to latest version
|
|
|
|
|
-e, --editable TEXT Install a project in editable mode from this path
|
2023-08-04 04:30:37 +00:00
|
|
|
--force-reinstall Reinstall all packages even if they are already up-to-
|
|
|
|
|
date
|
|
|
|
|
--no-cache-dir Disable the cache
|
2023-07-26 05:18:45 +00:00
|
|
|
--help Show this message and exit.
|
2023-06-17 16:55:53 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-uninstall)=
|
2023-06-17 16:55:53 +00:00
|
|
|
### llm uninstall --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm uninstall [OPTIONS] PACKAGES...
|
|
|
|
|
|
|
|
|
|
Uninstall Python packages from the LLM environment
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
-y, --yes Don't ask for confirmation
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-embed)=
|
2023-08-28 05:24:10 +00:00
|
|
|
### llm embed --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm embed [OPTIONS] [COLLECTION] [ID]
|
|
|
|
|
|
|
|
|
|
Embed text and store or return the result
|
|
|
|
|
|
|
|
|
|
Options:
|
2023-09-12 01:58:44 +00:00
|
|
|
-i, --input PATH File to embed
|
2023-08-28 05:24:10 +00:00
|
|
|
-m, --model TEXT Embedding model to use
|
|
|
|
|
--store Store the text itself in the database
|
|
|
|
|
-d, --database FILE
|
2023-09-12 01:17:34 +00:00
|
|
|
-c, --content TEXT Content to embed
|
2023-09-12 01:58:44 +00:00
|
|
|
--binary Treat input as binary data
|
2023-09-03 14:43:23 +00:00
|
|
|
--metadata TEXT JSON object metadata to store
|
2023-08-28 05:24:10 +00:00
|
|
|
-f, --format [json|blob|base64|hex]
|
|
|
|
|
Output format
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-embed-multi)=
|
2023-09-03 22:08:04 +00:00
|
|
|
### llm embed-multi --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm embed-multi [OPTIONS] COLLECTION [INPUT_PATH]
|
|
|
|
|
|
|
|
|
|
Store embeddings for multiple strings at once
|
|
|
|
|
|
|
|
|
|
Input can be CSV, TSV or a JSON list of objects.
|
|
|
|
|
|
|
|
|
|
The first column is treated as an ID - all other columns are assumed to be
|
|
|
|
|
text that should be concatenated together in order to calculate the
|
|
|
|
|
embeddings.
|
|
|
|
|
|
|
|
|
|
Input data can come from one of three sources:
|
|
|
|
|
|
|
|
|
|
1. A CSV, JSON, TSV or JSON-nl file (including on standard input)
|
|
|
|
|
2. A SQL query against a SQLite database
|
|
|
|
|
3. A directory of files
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--format [json|csv|tsv|nl] Format of input file - defaults to auto-detect
|
|
|
|
|
--files <DIRECTORY TEXT>... Embed files in this directory - specify directory
|
|
|
|
|
and glob pattern
|
2023-09-04 19:28:16 +00:00
|
|
|
--encoding TEXT Encoding to use when reading --files
|
2023-09-12 01:58:44 +00:00
|
|
|
--binary Treat --files as binary data
|
2023-09-03 22:08:04 +00:00
|
|
|
--sql TEXT Read input using this SQL query
|
|
|
|
|
--attach <TEXT FILE>... Additional databases to attach - specify alias
|
|
|
|
|
and file path
|
2023-09-13 23:33:27 +00:00
|
|
|
--batch-size INTEGER Batch size to use when running embeddings
|
2023-09-03 22:41:11 +00:00
|
|
|
--prefix TEXT Prefix to add to the IDs
|
2023-09-03 22:08:04 +00:00
|
|
|
-m, --model TEXT Embedding model to use
|
2025-02-12 23:19:18 +00:00
|
|
|
--prepend TEXT Prepend this string to all content before
|
|
|
|
|
embedding
|
2023-09-03 22:08:04 +00:00
|
|
|
--store Store the text itself in the database
|
|
|
|
|
-d, --database FILE
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-similar)=
|
2023-09-01 06:13:20 +00:00
|
|
|
### llm similar --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm similar [OPTIONS] COLLECTION [ID]
|
|
|
|
|
|
2025-02-26 18:07:10 +00:00
|
|
|
Return top N similar IDs from a collection using cosine similarity.
|
2023-09-01 06:13:20 +00:00
|
|
|
|
2023-09-02 02:01:16 +00:00
|
|
|
Example usage:
|
|
|
|
|
|
|
|
|
|
llm similar my-collection -c "I like cats"
|
|
|
|
|
|
|
|
|
|
Or to find content similar to a specific stored ID:
|
|
|
|
|
|
|
|
|
|
llm similar my-collection 1234
|
|
|
|
|
|
2023-09-01 06:13:20 +00:00
|
|
|
Options:
|
2023-09-12 18:22:21 +00:00
|
|
|
-i, --input PATH File to embed for comparison
|
2023-09-02 02:01:16 +00:00
|
|
|
-c, --content TEXT Content to embed for comparison
|
2023-09-12 18:22:21 +00:00
|
|
|
--binary Treat input as binary data
|
2023-09-01 06:13:20 +00:00
|
|
|
-n, --number INTEGER Number of results to return
|
|
|
|
|
-d, --database FILE
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-embed-models)=
|
2023-08-28 05:24:10 +00:00
|
|
|
### llm embed-models --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm embed-models [OPTIONS] COMMAND [ARGS]...
|
|
|
|
|
|
|
|
|
|
Manage available embedding models
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
Commands:
|
|
|
|
|
list* List available embedding models
|
|
|
|
|
default Show or set the default embedding model
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-embed-models-list)=
|
2023-08-28 05:24:10 +00:00
|
|
|
#### llm embed-models list --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm embed-models list [OPTIONS]
|
|
|
|
|
|
|
|
|
|
List available embedding models
|
|
|
|
|
|
|
|
|
|
Options:
|
2025-02-13 23:33:20 +00:00
|
|
|
-q, --query TEXT Search for embedding models matching these strings
|
|
|
|
|
--help Show this message and exit.
|
2023-08-28 05:24:10 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-embed-models-default)=
|
2023-08-28 05:24:10 +00:00
|
|
|
#### llm embed-models default --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm embed-models default [OPTIONS] [MODEL]
|
|
|
|
|
|
|
|
|
|
Show or set the default embedding model
|
|
|
|
|
|
|
|
|
|
Options:
|
2023-09-03 23:03:30 +00:00
|
|
|
--remove-default Reset to specifying no default model
|
|
|
|
|
--help Show this message and exit.
|
2023-08-28 05:24:10 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-10 21:24:27 +00:00
|
|
|
(help-collections)=
|
|
|
|
|
### llm collections --help
|
2023-08-28 05:24:10 +00:00
|
|
|
```
|
2023-09-10 21:24:27 +00:00
|
|
|
Usage: llm collections [OPTIONS] COMMAND [ARGS]...
|
2023-08-28 05:24:10 +00:00
|
|
|
|
2023-09-10 21:24:27 +00:00
|
|
|
View and manage collections of embeddings
|
2023-08-28 05:24:10 +00:00
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
Commands:
|
2023-09-12 06:08:11 +00:00
|
|
|
list* View a list of collections
|
2023-09-10 21:24:27 +00:00
|
|
|
delete Delete the specified collection
|
|
|
|
|
path Output the path to the embeddings database
|
2023-08-28 05:24:10 +00:00
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-10 21:24:27 +00:00
|
|
|
(help-collections-path)=
|
|
|
|
|
#### llm collections path --help
|
2023-08-28 05:24:10 +00:00
|
|
|
```
|
2023-09-10 21:24:27 +00:00
|
|
|
Usage: llm collections path [OPTIONS]
|
2023-08-28 05:24:10 +00:00
|
|
|
|
|
|
|
|
Output the path to the embeddings database
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-10 21:24:27 +00:00
|
|
|
(help-collections-list)=
|
|
|
|
|
#### llm collections list --help
|
2023-08-28 05:24:10 +00:00
|
|
|
```
|
2023-09-10 21:24:27 +00:00
|
|
|
Usage: llm collections list [OPTIONS]
|
2023-08-28 05:24:10 +00:00
|
|
|
|
2023-09-10 21:24:27 +00:00
|
|
|
View a list of collections
|
2023-08-28 05:24:10 +00:00
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
-d, --database FILE Path to embeddings database
|
|
|
|
|
--json Output as JSON
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-10 21:24:27 +00:00
|
|
|
(help-collections-delete)=
|
|
|
|
|
#### llm collections delete --help
|
2023-09-03 19:55:48 +00:00
|
|
|
```
|
2023-09-10 21:24:27 +00:00
|
|
|
Usage: llm collections delete [OPTIONS] COLLECTION
|
2023-09-03 19:55:48 +00:00
|
|
|
|
|
|
|
|
Delete the specified collection
|
|
|
|
|
|
|
|
|
|
Example usage:
|
|
|
|
|
|
2023-09-10 21:24:27 +00:00
|
|
|
llm collections delete my-collection
|
2023-09-03 19:55:48 +00:00
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
-d, --database FILE Path to embeddings database
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-openai)=
|
2023-07-01 17:40:11 +00:00
|
|
|
### llm openai --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm openai [OPTIONS] COMMAND [ARGS]...
|
|
|
|
|
|
|
|
|
|
Commands for working directly with the OpenAI API
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
|
|
|
|
|
Commands:
|
|
|
|
|
models List models available to you from the OpenAI API
|
|
|
|
|
```
|
2023-09-05 00:08:30 +00:00
|
|
|
|
2023-09-04 02:35:14 +00:00
|
|
|
(help-openai-models)=
|
2023-07-01 17:40:11 +00:00
|
|
|
#### llm openai models --help
|
|
|
|
|
```
|
|
|
|
|
Usage: llm openai models [OPTIONS]
|
|
|
|
|
|
|
|
|
|
List models available to you from the OpenAI API
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--json Output as JSON
|
|
|
|
|
--key TEXT OpenAI API key
|
|
|
|
|
--help Show this message and exit.
|
|
|
|
|
```
|
2023-06-17 08:09:22 +00:00
|
|
|
<!-- [[[end]]] -->
|