A premium, modern React application powered by Vite that connects to Hugging Face's inference APIs to deliver real-time streaming text responses and state-of-the-art image generation. With a sleek glassmorphic design, persistent session management, and a highly responsive layout, Nexus AI provides an engaging and fluid AI assistant experience.
- GitHub Repository: MythiCODE25/AI-Chatbot
- 💬 Real-Time Streaming Chat: Streams answers chunk-by-chunk for a natural conversation flow using the powerful
Qwen/Qwen2.5-72B-Instructmodel. - 🎨 FLUX Image Generation: Seamlessly toggle modes to generate high-fidelity images using the state-of-the-art
black-forest-labs/FLUX.1-schnellmodel. - 💾 Persistent Session Storage: Automatically saves conversation history, active chat sessions, and theme preferences to
localStorage. - 🌗 Persistent Dark/Light Mode: Smooth transitions between light and dark themes, saved to fit your ambient workspace.
- 🪄 Premium Glassmorphic UI/UX: Includes elegant hover states, custom micro-animations, a clean sidebar for chat history management, and quick-start suggestion cards.
- ⚡ Vite-Powered: Built on the latest Vite framework for lightning-fast development, Hot Module Replacement (HMR), and optimized production builds.
- Frontend: React 19
- Bundler & Dev Server: Vite 8
- Styling: Vanilla CSS featuring modern layout patterns (Flexbox/Grid), variables, media queries, and high-performance hardware-accelerated animations.
- Inference APIs: Hugging Face Inference API / Chat Completion Router.
AI-Chatbot/
├── public/ # Static assets
├── src/
│ ├── assets/ # App images and SVG logos
│ ├── components/ # Reusable UI Components
│ │ ├── ChatWindow.jsx # Core chat container, landing view, and message flow
│ │ ├── ChatWindow.css # Layout, greeting styles, and landing cards
│ │ ├── InputBar.jsx # Text input, mode toggle (Text/Image), and send action
│ │ ├── InputBar.css # Form styling, modern buttons, and dynamic textareas
│ │ ├── MessageBubble.jsx# Individual messages (Text/Image bubbles with loading spinner)
│ │ ├── MessageBubble.css# Chat bubbles, user/bot avatar, and slide-in animations
│ │ ├── Sidebar.jsx # Chat management list, search, and dark/light mode toggle
│ │ └── Sidebar.css # Sidebar layout, delete buttons, and action styling
│ ├── App.jsx # Application state, theme synchronization, and API handlers
│ ├── index.css # Global CSS variables, scrollbars, and resetting
│ └── main.jsx # React DOM entry point
├── .env # Local environment configurations (API tokens)
├── .gitignore # Files excluded from git tracking
├── eslint.config.js # JavaScript linter configurations
├── index.html # Main HTML entry point
├── package.json # NPM dependencies and script tasks
└── vite.config.js # Vite bundler configurations
To run the application locally, you must specify your Hugging Face API Token in a .env file at the root of the project:
# Hugging Face Access Token (required for API requests)
VITE_HF_TOKEN=your_huggingface_token_here
# Optional: Override the default text generation model
VITE_MODEL_NAME=Qwen/Qwen2.5-72B-InstructNote
You can acquire a free access token by creating an account on Hugging Face and visiting your account settings.
Follow these steps to run the project locally on your machine:
git clone https://github.com/MythiCODE25/AI-Chatbot.git
cd "AI chatbot"npm installCreate a .env file in the root directory:
touch .envPaste in your Hugging Face token:
VITE_HF_TOKEN=your_hf_api_tokennpm run devOpen your browser and navigate to the local server URL (usually http://localhost:5173).
Contributions are welcome! If you have any suggestions, bug fixes, or enhancements:
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
This project is open-source and available under the MIT License.