2023-12-13 08:37:11 +02:00
|
|
|
# llm
|
|
|
|
|
|
|
|
> Interact with Large Language Models (LLMs) via remote APIs and models that can be installed and run on your machine.
|
|
|
|
> More information: <https://llm.datasette.io/en/stable/help.html>.
|
|
|
|
|
|
|
|
- Set up an OpenAI API Key:
|
|
|
|
|
|
|
|
`llm keys set openai`
|
|
|
|
|
|
|
|
- Run a prompt:
|
|
|
|
|
|
|
|
`llm "{{Ten fun names for a pet pelican}}"`
|
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
- Run a system prompt against a file:
|
2023-12-13 08:37:11 +02:00
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
`cat {{path/to/file.py}} | llm {{[-s|--system]}} "{{Explain this code}}"`
|
2023-12-13 08:37:11 +02:00
|
|
|
|
|
|
|
- Install packages from PyPI into the same environment as LLM:
|
|
|
|
|
|
|
|
`llm install {{package1 package2 ...}}`
|
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
- Download and run a prompt against a model:
|
2023-12-13 08:37:11 +02:00
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
`llm {{[-m|--model]}} {{orca-mini-3b-gguf2-q4_0}} "{{What is the capital of France?}}"`
|
2023-12-13 08:37:11 +02:00
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
- Create a system prompt and save it with a template name:
|
2023-12-13 08:37:11 +02:00
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
`llm {{[-s|--system]}} '{{You are a sentient cheesecake}}' --save {{sentient_cheesecake}}`
|
2024-04-11 18:51:05 +01:00
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
- Have an interactive chat with a specific model using a specific template:
|
2024-04-11 18:51:05 +01:00
|
|
|
|
2025-03-17 23:17:57 +02:00
|
|
|
`llm chat {{[-m|--model]}} {{chatgpt}} {{[-t|--template]}} {{sentient_cheesecake}}`
|