Skip to content

itsvasugrover/clxai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLXAI

CLI-based chatbot using the OpenAI API with a rich terminal interface. Easily interact with the bot, change personalities and models using serial numbers, and view available commands with /help. All logs are stored in a single log file (logs/clxai.log) in your current working directory.

Features

  • Uses OpenAI API (chat/completions) with openai>=1.0.0
  • Loads personalities and models from config.yaml
  • Logging via loguru (single log file: logs/clxai.log)
  • Rich CLI interface (colors, prompts)
  • Slash commands for runtime control:
    • /personality — change bot personality (by serial number)
    • /model — change model (by serial number)
    • /exit — quit the bot
    • /help — show all available slash commands

Usage

Run the chatbot:

python main.py

Type your message and press Enter. Use slash commands to change settings:

  • /personality — select a different personality (by serial number)
  • /model — select a different model (by serial number)
  • /exit — exit the chat
  • /help — show all available slash commands

All logs are saved in logs/clxai.log in your current working directory.

Configuration

Edit config.yaml to customize personalities, models, and prompts. You can define multiple personalities and models, which are selectable in the CLI by their serial number.

Example

Type your message (or 'exit' to quit):
You: Hello
Friendly Assistant: Hi there! How can I help you today?

You: /personality
Available personalities:
   1. Friendly Assistant
   2. Tech Expert
   3. Motivational Coach
Type the serial number to select.
Select personality: 2
Personality changed to Tech Expert

You: /model
Available models:
   1. gpt-3.5-turbo
   2. gpt-4
Type the serial number to select.
Select model: 2
Model changed to gpt-4

You: /help
Slash commands:
/personality - Change bot personality
/model - Change model
/exit - Quit the bot
/help - Show this help message

You: /exit
Goodbye!

Requirements

  • Python 3.13+ (will be available if you are using latest uv)
  • llama.cpp and llama-swap (for running the chatbot locally)
  • huggingface_hub (for downloading models from Hugging Face)

For environment setup please refer to the environment setup guide for detailed instructions on how to set up the necessary environment for running CLXAI.

Installation and Usage

  1. Clone the repository:

    git clone https://github.com/itsvasugrover/clxai.git
  2. Navigate to the clxai directory:

    cd clxai
  3. Install the required packages:

    uv sync
  4. Run the chatbot:

    uv run python main.py

Configuration

The chatbot is configured using a YAML file named config.yaml. You can customize the chatbot's behavior and responses by modifying this file. The configuration file includes settings for the model, prompts, and other parameters that influence how the chatbot generates responses.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A terminal-based chatbot powered by llama-swap OpenAI API compatible with a rich interface.

Resources

License

Stars

Watchers

Forks

Contributors

Languages