A command-line interface for chatting with LLMs, storing chats and (future) rag interactions
Project description
Chat CLI
A comprehensive command-line interface for chatting with various AI language models. This application allows you to interact with different LLM providers through an intuitive terminal-based interface.
Features
- Interactive terminal UI with Textual library
- Support for multiple AI models:
- OpenAI models (GPT-3.5, GPT-4)
- OpenAI reasoning models (o1, o1-mini, o3, o3-mini, o4-mini)
- Anthropic models (Claude 3 Opus, Sonnet, Haiku)
- Conversation history with search functionality
- Customizable response styles (concise, detailed, technical, friendly)
- Code syntax highlighting
- Markdown rendering
Installation
-
Clone this repository:
git clone https://github.com/yourusername/chat-cli.git cd chat-cli -
Install the required dependencies:
pip install -r requirements.txt -
Set up your API keys:
Create a
.envfile in the project root directory with your API keys:OPENAI_API_KEY=your_openai_api_key_here ANTHROPIC_API_KEY=your_anthropic_api_key_here
Usage
Run the application:
chat-cli
Testing Reasoning Models
To test the OpenAI reasoning models implementation, you can use the included test script:
./test_reasoning.py
This script will test both completion and streaming with the available reasoning models.
About OpenAI Reasoning Models
OpenAI's reasoning models (o1, o3, o4-mini, etc.) are LLMs trained with reinforcement learning to perform reasoning. These models:
- Think before they answer, producing a long internal chain of thought
- Excel in complex problem solving, coding, scientific reasoning, and multi-step planning
- Use "reasoning tokens" to work through problems step by step before providing a response
- Support different reasoning effort levels (low, medium, high)
The implementation in this CLI supports both standard completions and streaming with these models.
Keyboard Shortcuts
q- Quit the applicationn- Start a new conversations- Toggle sidebarf- Focus search boxEscape- Cancel current generationCtrl+C- Quit the application
Configuration
The application creates a configuration file at ~/.chatcli/config.json on first run. You can edit this file to:
- Change the default model
- Modify available models
- Add or edit response styles
- Change the theme
- Adjust other settings
Data Storage
Conversation history is stored in a SQLite database at ~/.chatcli/chat_history.db.
Development
The application is structured as follows:
main.py- Main application entry pointapp/- Application modulesapi/- LLM provider API client implementationsui/- User interface componentsconfig.py- Configuration managementdatabase.py- Database operationsmodels.py- Data modelsutils.py- Utility functions
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 chat_console-0.5.95.tar.gz.
File metadata
- Download URL: chat_console-0.5.95.tar.gz
- Upload date:
- Size: 140.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d9c2bb20020ee2bf067d1a71bf2e3b579bd26a8206b0a424d6d52ae122f8d9a
|
|
| MD5 |
849b8b761455446538d67d781064ac1c
|
|
| BLAKE2b-256 |
2fd6c3768ae707775aabc4947a4c9277b7fd0423b40cd51deb5b71999d75de86
|
File details
Details for the file chat_console-0.5.95-py3-none-any.whl.
File metadata
- Download URL: chat_console-0.5.95-py3-none-any.whl
- Upload date:
- Size: 155.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a3154c3a47df9e6ea112797c2d1041faa15ff6e708c2bacc2cc222a2f923f46
|
|
| MD5 |
db0b844306d47409b1a86a951fe6b874
|
|
| BLAKE2b-256 |
b482f72f435b42ea951b4556815a3e36b9493066f5240cd3e744226a404d9a70
|