A simple command-line chatbot that uses the Together AI API to have conversations using the Mixtral-8x7B language model.
- Interactive command-line chat interface
- Powered by Mixtral-8x7B-Instruct model via Together AI
- Simple setup with environment variables
- Easy exit commands
- Python 3.7 or higher
- Together AI API key (get one at together.ai)
-
Clone or download this project
-
Install required packages:
pip install requests python-dotenv together
-
Set up your API key:
Create a
.envfile in the project directory and add your Together AI API key:TOGETHER_API_KEY=your_api_key_here
Run the chatbot:
python main.pyOnce started:
- Type your messages and press Enter to chat with the AI
- Type
bye,goodbye,exit, orquitto end the conversation
Welcome to the simple chatbot!
YOU: Hello, how are you?
Chatbot: Hello! I'm doing well, thank you for asking. How can I help you today?
YOU: What's the weather like?
Chatbot: I don't have access to real-time weather data, but I'd be happy to help you with other questions or tasks!
YOU: bye
Chatbot: Goodbye!
chatbot/
├── main.py # Main chatbot script
├── .env # API key (create this file)
├── requirements.txt # Dependencies (optional)
└── README.md # This file
ModuleNotFoundError: Make sure you've installed all required packages with pip
API Error: Check that your Together AI API key is correct in the .env file
No response: Verify you have an active internet connection and valid API credits
requests- For making HTTP requests to the APIpython-dotenv- For loading environment variablestogether- Together AI Python SDK
This project is open source and available under the MIT License.