Access large language models from the command-line
Project description
llm
Access large language models from the command-line
Installation
Install this tool using pip:
pip install llm
You need an OpenAI API key, which should either be set in the OPENAI_API_KEY environment variable, or saved in a plain text file called ~/.openai-api-key.txt in your home directory.
Usage
So far this tool only has one command - llm chatgpt. You can just use llm as this is the default command.
To run a prompt:
llm 'Ten names for cheesecakes'
To stream the results a token at a time:
llm 'Ten names for cheesecakes' -s
To switch from ChatGPT 3.5 (the default) to GPT-4 if you have access:
llm 'Ten names for cheesecakes' -4
Pass --model <model name> to use a different model.
Help
For help, run:
llm --help
You can also use:
python -m llm --help
Development
To contribute to this tool, first checkout the code. Then create a new virtual environment:
cd llm
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm-0.1.tar.gz.
File metadata
- Download URL: llm-0.1.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
547913bb8468b8288ae852cdf7f3bc7da4519f9d59661735cb3b4523a033c5ad
|
|
| MD5 |
4853ddda26bf069fed21c4f78ae9cd19
|
|
| BLAKE2b-256 |
311e5e9692da23ec1e3af54a7bf0c36486f18249811a0d8c339fb4d122dc19bd
|
File details
Details for the file llm-0.1-py3-none-any.whl.
File metadata
- Download URL: llm-0.1-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e0cef412988ffb6f9df11326b66a3c90184dc69f60b9c7f095d54e66ee9dfc4
|
|
| MD5 |
27b028723d6e8cda7cb1b0ade88273cd
|
|
| BLAKE2b-256 |
4e9470c05c02fd2f9179b2295512c8ec62a878f617ab67db877ece8d6337c783
|