View Single Post
  #1  
Old 11-09-2023, 14:39
blue_devil's Avatar
blue_devil blue_devil is offline
Family
 
Join Date: Dec 2011
Location: Observable Universe
Posts: 537
Rept. Given: 110
Rept. Rcvd 73 Times in 46 Posts
Thanks Given: 687
Thanks Rcvd at 895 Times in 297 Posts
blue_devil Reputation: 73
ChatGPT from your command prompt: llm

A CLI utility and Python library for interacting with Large Language Models, both via remote APIs and models that can be installed and run on your own machine.

REPO:
Code:
https://github.com/simonw/llm
DOCS:
Code:
https://llm.datasette.io/en/stable/
INSTALL:

Code:
pip install llm
or
Code:
python -m pip install llm
USAGE:
Obtain a chatgpt/openai API key from their site. You need to register to openai. When you set your api to llm you can use chatgpt from commmand prompt:

Code:
# 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"
My experience after setting open ai api:
Code:
$ llm "Ten fun names for a pet pelican"
Error: You exceeded your current quota, please check your plan and billing details.

Last edited by blue_devil; 11-09-2023 at 14:39. Reason: typo
Reply With Quote
The Following User Says Thank You to blue_devil For This Useful Post:
dotdll (07-16-2025)