Skip to main content

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

  1. Clone this repository:

    git clone https://github.com/yourusername/chat-cli.git
    cd chat-cli
    
  2. Install the required dependencies:

    pip install -r requirements.txt
    
  3. Set up your API keys:

    Create a .env file 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 application
  • n - Start a new conversation
  • s - Toggle sidebar
  • f - Focus search box
  • Escape - Cancel current generation
  • Ctrl+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 point
  • app/ - Application modules
    • api/ - LLM provider API client implementations
    • ui/ - User interface components
    • config.py - Configuration management
    • database.py - Database operations
    • models.py - Data models
    • utils.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

chat_console-0.5.95.tar.gz (140.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chat_console-0.5.95-py3-none-any.whl (155.5 kB view details)

Uploaded Python 3

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

Hashes for chat_console-0.5.95.tar.gz
Algorithm Hash digest
SHA256 2d9c2bb20020ee2bf067d1a71bf2e3b579bd26a8206b0a424d6d52ae122f8d9a
MD5 849b8b761455446538d67d781064ac1c
BLAKE2b-256 2fd6c3768ae707775aabc4947a4c9277b7fd0423b40cd51deb5b71999d75de86

See more details on using hashes here.

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

Hashes for chat_console-0.5.95-py3-none-any.whl
Algorithm Hash digest
SHA256 2a3154c3a47df9e6ea112797c2d1041faa15ff6e708c2bacc2cc222a2f923f46
MD5 db0b844306d47409b1a86a951fe6b874
BLAKE2b-256 b482f72f435b42ea951b4556815a3e36b9493066f5240cd3e744226a404d9a70

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page