A command-line interface for chatting with AI models using the OpenAI-compatible API format. Currently configured to work with DeepSeek and OpenRouter APIs.
- Interactive command-line chat interface
- Multi-line input support with editing capabilities
- Real-time streaming of AI responses
- Automatic chat logging with timestamped files
- Configurable AI model selection
- Color-coded interface for better readability
- Python 3.6+
- pip (Python package installer)
- Clone this repository:
git clone <repository-url>
cd <repository-name>
- Install the required packages:
pip install openai python-dotenv prompt_toolkit
- Create a
.env
file in the project root and add your API keys:
DEEPSEEK_API_KEY=your_deepseek_api_key_here
OPENROUTER_API_KEY=your_openrouter_api_key_here
- Run the chat interface:
python main.py
-
Type your messages and press Enter to send. For multi-line messages:
- Press Enter to start a new line
- Press Esc + Enter to send the message
-
Press Ctrl+C to exit the chat
Each chat session is automatically logged to a unique file in the format:
chat_log_YYYYMMDD_HHMMSS.txt
The logs include:
- Timestamp for each message
- Role of the sender (User/Assistant/System)
- Complete message content
You can modify the following in main.py
:
- AI model selection (currently set to "deepseek-reasoner")
- API endpoints (DeepSeek or OpenRouter)
- System prompt
- Interface styling
[Your chosen license]
Feel free to open issues or submit pull requests for any improvements.