✨ A colorful and modern way to chat with OpenRouter-powered AI models ✨
Chat Py is a lightweight Python chat client that connects to OpenRouter-compatible models through the OpenAI SDK. It supports both a terminal-based CLI and a Tkinter-based GUI.
- 🎯 Choose from several OpenRouter models
- 💬 Chat through the terminal or a GUI window
- ⚡ Use slash commands such as:
/modelto show the current model/exitto quit the app/saveto save the conversation history
- 🛠️ Use a setup helper to install dependencies and create a
.envfile - 🪟 Configure GUI window size and resize behavior with environment variables
main.py– CLI chat app entry pointmain_gui.py– Tkinter GUI app entry pointlogo.py– prints the startup logosave.py– saves chat history to a text filesetup.py– installs dependencies and creates the.envfilerequirements.txt– Python package requirementspyproject.toml– packaging metadata
- 🐍 Python 3.9 or newer
- 🔑 An OpenRouter API key
-
Create and activate a virtual environment (recommended):
python -m venv .venv .venv\Scripts\activate
-
Install the required Python packages:
python -m pip install -r requirements.txt
-
Run the setup helper:
python setup.py
-
Enter your OpenRouter API key when prompted. The setup script will create a
.envfile in the project root.
You can also install the project in editable mode with:
python -m pip install -e .Create or update the .env file with values like the following:
OPENROUTER_API_KEY=your_openrouter_api_key_here
USER_NAME=Your Name
GUI_window_width=800
GUI_window_height=600
IS_WIDTH_RESIZABLE=True
IS_HEIGHT_RESIZABLE=Truepython main.pypython main_gui.py- A valid OpenRouter API key is required to use the chat features.
- If
.envalready exists, the setup script will add any missing values. - The GUI size and resizability are controlled by the values in
.env.