A lightweight, stylish, and responsive web-based chatbot application built with PHP, JavaScript, and Bootstrap. This project integrates Groq's LLaMA 3 model to simulate a virtual doctor—Dr. Yasir—who provides intelligent responses based on user queries.
- 🧠 AI-Powered Doctor (Dr. Yasir) using LLaMA 3 (8B) model
- 💬 Chat-style user interface with dark theme
- ⚡ Instant AJAX responses with loading indicator
- ✅ Form validation and error handling
- 🎯 Clean and modern UI using Bootstrap 5 and custom styles
Frontend | Backend | AI Model |
---|---|---|
HTML, CSS, JS (Vanilla) | PHP (API call via cURL ) |
LLaMA 3 (via Groq API) |
Bootstrap 5 | JSON handling | llama3-8b-8192 |
- User types a query into the input field.
- JavaScript fetches the response via a PHP script (
api.php
) using the Groq API. - The backend uses the provided
role
andprompt
to query the LLaMA 3 model. - The model's response is displayed dynamically in a chat bubble.
📁 your-project-root/
├── api.php # PHP script to connect with Groq's LLaMA 3 model
├── index.html # Main frontend interface
├── style (inline) # Custom dark theme styles
git clone https://github.com/AriyaArKa/AI-Chabot.git
cd AI-Chabot
Edit api.php
and replace the placeholder:
$secretKey = 'YOUR_GROQ_API_KEY_HERE';
🔐 Important: Never expose this key on the frontend or commit it to public repositories.
You can use any local server like XAMPP, WAMP, or PHP’s built-in server:
php -S localhost:3000
Visit: http://localhost:3000
The system instructs the model to act as:
Role: "You act as a Doctor named Yasir."
Prompt: "I have a headache and fever. What should I do?"
Expected response will be from Dr. Yasir, offering medical guidance powered by LLaMA 3.
This app is for educational/demo purposes only and should not be used for actual medical advice or diagnosis.
MIT License
- Groq API for ultra-fast LLaMA 3 inference
- Bootstrap 5 for beautiful UI components