VerisBot is a fun and experimental AI chatbot developed as a learning adventure using FastAPI and the Hugging Face Inference API. Powered by the google/gemma-2-2b-it model, this project showcases the art of crafting conversational AI, aimed at exploring how to create engaging, accurate, and intelligent responses. While it’s not designed for production use, VerisBot serves as an exciting playground for me to dive into the world of AI, master new technologies, and unleash creativity in developing advanced chat solutions.
-
Enterprise-Grade Chatbot:
Provides clear, accurate, and professional responses tailored to business needs. -
Serverless and Scalable:
Leverages the Hugging Face Inference API to ensure cost-effective, scalable performance. -
FastAPI-Based Backend:
A lightweight and responsive RESTful API for handling chat interactions. -
Structured Response Formatting:
Utilizes a dedicated formatter to ensure all responses are well-structured and ready for frontend display. -
Robust Prompt Engineering:
Includes strict system instructions to guide the model’s behavior and maintain consistency in tone and style.
VerisBot is built using a modular architecture:
-
FastAPI Backend:
Handles incoming chat requests, manages sessions, and processes errors. -
Hugging Face Inference API Integration:
Directly calls thegoogle/gemma-2-2b-itmodel for generating responses. -
Response Formatter:
Processes and formats generated text to ensure professional and consistent output on the frontend. -
Environment Configuration:
All sensitive information (e.g., API keys) is managed through environment variables for security and flexibility.
-
Clone the Repository:
git clone https://github.com/SCCSMARTCODE/VerisBot.git cd VerisBot -
Create a Virtual Environment and Install Dependencies:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Set Up Environment Variables:
Create a
.envfile based on the provided.env.exampleand add your Hugging Face API key:HF_API_KEY=your_huggingface_api_key HF_API_URL="https://api-inference.huggingface.co/models/google/gemma-2-2b-it"
-
Run the FastAPI Server:
uvicorn app.main:app --reload
-
Interact with the Chatbot:
Send a POST request to the
/chatendpoint with a JSON body containing amessagefield. For example:{ "user_id": "userId", "message": "What is a noun?" }The server will return a response similar to:
{ "veris_response": "I am Veris, a high-quality AI chatbot built by SCCSMARTCODE using the Hugging Face Inference API. [Detailed answer...]" }
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Include tests for your changes.
- Submit a pull request with a clear description of your changes.
For major changes, please open an issue first to discuss your ideas.
This project is licensed under the MIT License.
For questions or support, please contact:
SCCSMARTCODE
Email: [email protected]