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.
- 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
Run the chatbot:
python main.pyType 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.
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.
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!Python 3.13+(will be available if you are using latest uv)llama.cppandllama-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.
-
Clone the repository:
git clone https://github.com/itsvasugrover/clxai.git
-
Navigate to the
clxaidirectory:cd clxai -
Install the required packages:
uv sync
-
Run the chatbot:
uv run python main.py
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.
This project is licensed under the MIT License. See the LICENSE file for details.