This project is a lightweight and scalable conversational chatbot that utilizes Groq for natural language processing and FastAPI as the backend. The chatbot handles user queries and provides conversational responses with an interactive frontend built using HTML, CSS, and JavaScript. It is designed for seamless interaction and easy scalability, making it suitable for conversational use cases.
- FastAPI Backend: High-performance backend framework that enables fast development and scalability.
- Groq API Integration: Delivers highly accurate and engaging conversational experiences using Groq's AI models.
- Interactive Frontend: Simple and user-friendly interface developed with HTML, CSS, and JavaScript.
- Scalable Architecture: Easily extendable for custom conversational features and use cases.
- Environment Configuration: Secure management of API keys using environment variables.
- Backend: FastAPI, Python
- Frontend: HTML, CSS, JavaScript
- AI/Chat API: Groq API
- Deployment: Ready for deployment on platforms like Heroku, AWS, or Docker.
Make sure you have the following installed:
- Python 3.8+
- FastAPI
- Pydantic
- Groq API Key (you can get one from Groq's website)
- Dotenv for managing environment variables
-
Clone the repository:
git clone https://github.com/yourusername/groq-chatbot-fastapi.git cd groq-chatbot-fastapi
-
Install the dependencies:
pip install -r requirements.txt
-
Set up your environment variables:
- Create a
.env
file inside theapp/
folder. - Add your Groq API key:
GROQ_API_KEY=your_groq_api_key_here
- Create a
-
Run the application:
uvicorn main:app --reload
-
Open your browser and navigate to
http://127.0.0.1:8000/
to interact with the chatbot.
- Frontend: The user interacts with the web interface (HTML, CSS, JavaScript) by submitting a message.
- Backend: The message is sent to the FastAPI backend for processing.
- Groq API: The FastAPI backend sends the message to the Groq API, which processes it and returns a response.
- Response: The chatbot sends the response back to the front end, where the user can view the reply and continue the conversation.
- Persistent Chat History: Store chat conversations in a database for future reference.
- Enhanced UI: Improve the frontend design with additional styling and interactive elements.
- Customizable Models: Users can select from multiple AI models for different conversational experiences.
Contributions are welcome! You can fix this project and submit a pull request with any improvements or suggestions. Please follow the standard GitHub workflow for contributing.
This project is licensed under the MIT License. See the LICENSE file for more details.