Skip to content

pragmaticforesight/castllm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CastLLM

LLM chat via CLI

License

MIT License -- See LICENSE file for details.

Usage

Go get an OpenAI API key and set it as an environment variable in .env file:

CASTLLM_OPENAI_KEY=<api key>

Use default ChatGPT 3-turbo model

python3 castllm.py

Press cntr+c to exit chat.

Use ChatGPT 4 model

Use ChatGPT 4 (default is ChatGPT 3-turbo)

python3 castllm.py --use gpt4

Session Management

Sessions are saved to JSON files in sessions/ directory. The filename is the topic of the chat and the timestamp of the start of the chat. Generated by ChatGPT 3-turbo model.

Load a Saved Session

Reload a saved session to continue a chat:

python cast_llm.py --load-session sessions/Woodchuck_and_tongue_twister_explanation-20231006-142440.json

Loading session example output:

python cast_llm.py --load-session sessions/Woodchuck_and_tongue_twister_explanation-20231006-142440.json
╭───────────────────────────────────────────────────────╮
│ Chat Topic: Woodchuck and tongue twister explanation. │
╰───────────────────────────────────────────────────────╯
system: You are now chatting with ChatGPT.
user: How much can a wood-chuck chuck?
assistant: A woodchuck, also known as a groundhog, is a burrowing rodent known for digging 
holes. The phrase "how much wood could a woodchuck chuck" is actually a popular tongue 
twister rather than a serious question. It's meant to be a playful linguistic exercise, and 
there is no definitive answer. However, if you were inquiring about the amount of dirt a 
woodchuck can excavate while burrowing, they're capable of moving several pounds of soil.

Releases

No releases published

Packages

No packages published

Languages