Chat with LLMs from the terminal
Project description
Terminal LLM Chatbot
A python terminal-based chatbot application that integrates with language models. Features include multiline text input, streaming responses and many commands to control the conversation.
Features
- Supports Claude 3.7 (with optional extended thinking), ChatGPT-4o and o3-mini
- Terminal-based user interface with rich text formatting and code highlighting
- Support for multiline text input
- Streaming responses from the language model
- Conversations are saved as text files for portability and easy manipulation
- Anonymous chats that don't get saved anywhere
- You can edit the conversation at any point to add/remove context or edit the system prompt
- Change active model/conversation on the fly
- Embed files from the filesystem or webpage contents by url in your prompts
- Quick temporary prompts that don't pollute the current conversation context
- Optional voice input support
- Configurable via a YAML config file
Installation
You can install llm_chat_term using uv by running:
uv tool install llm_chat_term
or if you don't have uv installed:
pip install llm-chat-term
# or
pipx install llm-chat-term
If you want voice input support, you will need to have portaudio and ffmpeg installed for your system. Then, install the llm_chat_term[voice] instead of the base llm_chat_term package.
Set up your API key(s)
On first run, a config.yaml with default options is created in your Config dir (e.g. ~/.config/llm_chat_term)
Edit it to add your API key(s) and customize other options. Then re-run the application.
Alternatively the application can read your API keys from your env (ANTHROPIC_API_KEY, OPENAI_API_KEY)
Usage
Run the chatbot from the command line:
llm_chat_term
Controls
- Type your message and press
Alt(Esc)+Enterto send - Use
Enterto add a new line in your message - Type
:exitor pressCtrl+Dto exit the application - Type
:helpto view help for available commands - Press
Ctrl+Cto interrupt and exit
Commands
:helpDisplays help about the commands.:infoDisplays info about this chat.:edit,:eOpens the conversation history in $EDITOR (vim by default). Edit it and save and it will be reloaded in the message history. You can edit the system prompt for the current conversation this way.:chatDisplay a menu to select a different chat.:modelDisplay a menu to select a different chat.:redrawRedraw the whole conversation.:tmp {prompt}This prompt won't be saved to the conversation history. Ideal for quick one-off questions in the middle of a large conversation:think {prompt}Enable thinking mode only for this question (Claude only).:read {path}Embed a text file in the prompt (replaces the line with :read).:web {url}Embed a webpage contents in the prompt (replaces the line with :web).:exitExits the application. The conversation is saved if not anonymous chat.
Configuration
This is the initial config.yaml file:
llm:
models:
- provider: anthropic
name: claude-3-7-sonnet-20250219
temperature: null
- provider: openai
name: o3-mini
temperature: null
- provider: openai
name: gpt-4o
temperature: null
api_keys:
- provider: anthropic
api_key: ""
- provider: openai
api_key: ""
system_prompt:
"You are a helpful assistant responding to a user's questions in
a PC terminal application.
The user is an experienced software engineer, your answers should be concise and
not repetitive.
Skip conclusions and summarizations of your answers.
If the user asks for a change in code, don't return the whole code, just the
changed segment(s).
Return your answers in markdown format, and wrap code in ``` blocks.
"
ui:
prompt_symbol: ">>> "
user: user
assistant: assistant
colors:
user: cyan
assistant: grey39
system: yellow
License
MIT
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_chat_term-0.2.3.tar.gz.
File metadata
- Download URL: llm_chat_term-0.2.3.tar.gz
- Upload date:
- Size: 63.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9254b6d9cc3b626acfae2d5a9db58eb5f27ab94199432b7ad9c76089a217c9b
|
|
| MD5 |
94c27e79f2b7d1ef57d7ec39df225e39
|
|
| BLAKE2b-256 |
3dd9cb65be4a04bde98fcb11417dc0f0fcd4b256740946bfa064124015f9496c
|
Provenance
The following attestation bundles were made for llm_chat_term-0.2.3.tar.gz:
Publisher:
main.yml on vtsiolkas/llm_chat_term
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_chat_term-0.2.3.tar.gz -
Subject digest:
a9254b6d9cc3b626acfae2d5a9db58eb5f27ab94199432b7ad9c76089a217c9b - Sigstore transparency entry: 180260894
- Sigstore integration time:
-
Permalink:
vtsiolkas/llm_chat_term@2cc38a8d763a8f24a7a850265d1ad89f9114294f -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/vtsiolkas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@2cc38a8d763a8f24a7a850265d1ad89f9114294f -
Trigger Event:
push
-
Statement type:
File details
Details for the file llm_chat_term-0.2.3-py3-none-any.whl.
File metadata
- Download URL: llm_chat_term-0.2.3-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cd60902b4d473b2b09a708f2e2a44c15aed64600af19d3e79f951271a4a9694
|
|
| MD5 |
d0370123d1def6dcad35df702f080450
|
|
| BLAKE2b-256 |
f8b2167725d4ec3f41d4e688710a58b6d18fab710dd6d2f6202e7f15215e3a6f
|
Provenance
The following attestation bundles were made for llm_chat_term-0.2.3-py3-none-any.whl:
Publisher:
main.yml on vtsiolkas/llm_chat_term
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_chat_term-0.2.3-py3-none-any.whl -
Subject digest:
7cd60902b4d473b2b09a708f2e2a44c15aed64600af19d3e79f951271a4a9694 - Sigstore transparency entry: 180260907
- Sigstore integration time:
-
Permalink:
vtsiolkas/llm_chat_term@2cc38a8d763a8f24a7a850265d1ad89f9114294f -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/vtsiolkas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@2cc38a8d763a8f24a7a850265d1ad89f9114294f -
Trigger Event:
push
-
Statement type: