A beautiful, modern web-based AI chatbot that replicates the core user experience and interface of ChatGPT, powered by the Google Gemini API.
Visit Now
- Modern Aesthetic Design: Clean, beautiful interface inspired by the latest AI chat applications.
- Lexara AI Branding: Unique identity with custom logo and gradient design.
- Real-time Messaging: Live chat with elegant typing indicators.
- Quick Action Cards: Fast access to common AI tasks (with modern Fluent design).
- Code Syntax Highlighting: Beautiful formatting for code snippets using
highlight.js. - Markdown & Clean Typography: Completely styled headers, lists, paragraphs, horizontal rules, links, blockquotes, and tables for a highly professional look.
- Responsive & Mobile-First Design: Fully optimized for desktop, tablet, and mobile (with mobile drawer navigation, touch-friendly controls, and a mobile-optimized theme toggle).
- Persistent Chat History: All your chats are saved in your browser's local storage, so you can revisit previous conversations even after a reload.
- Chat Deletion: Delete individual chats easily via the trashcan icon next to any thread in the history sidebar.
- Clipboard Sharing: One-click button to copy your entire conversation to the clipboard.
- Refined Theme Toggle: Modern, touch-friendly dark/light mode toggle with smooth transitions and custom SVG icons.
- Conversation Context & System Instruction: Maintains context throughout the session. Includes system prompt guiding for knowledge limits gracefully.
- Frontend: HTML, CSS, vanilla JavaScript
- Backend: Python with FastAPI
- AI Model: Google Gemini API (
gemini-2.5-flashby default) - Dependencies: OpenAI library (configured for Gemini's OpenAI-compatible endpoint)
- Python 3.8 or higher
- Gemini API key (get one from Google AI Studio)
-
Clone or download the project files
-
Install Python dependencies:
pip install -r requirements.txt
-
Set up environment variables:
- Open the
.envfile - Replace with your actual Gemini API key and model settings:
GEMINI_API_KEY=your_gemini_api_key_here GEMINI_MODEL=gemini-2.5-flash
- Open the
-
Run the application:
python main.py
-
Open your browser and navigate to:
http://localhost:8000 -
Deployed using Heroku
lexara-ai/
├── main.py # FastAPI backend server
├── requirements.txt # Python dependencies
├── .env # Environment variables (API key)
├── README.md # This file
├── run.bat # Windows batch file for quick start
├── setup_and_run.py # Python setup helper
└── static/ # Frontend files
├── index.html # Main HTML page
├── styles.css # CSS styling (including mobile, dark mode, and markdown)
└── script.js # JavaScript (UI logic, chat history, and deletion)
GET /- Serves the main HTML pagePOST /api/chat- Handles chat requestsGET /health- Health check endpoint
Modify static/styles.css to change the appearance:
- Colors and themes
- Layout and spacing
- Markdown/typography overrides
Extend static/script.js to add new features:
- Local storage chat history (see
saveCurrentChat,loadChatHistoryFromStorage,deleteChat) - Clipboard sharing (see
copyChatToClipboard) - Custom commands
- Visit Google AI Studio
- Sign up or log in with your Google account
- Click Get API key
- Copy the API key to your
.envfile asGEMINI_API_KEY
-
"Module not found" errors:
- Make sure you've installed all requirements:
pip install -r requirements.txt
- Make sure you've installed all requirements:
-
API key errors / 403 / 429:
- Verify your Gemini API key is correctly set in the
.envfile. - Note that Google API keys generated outside AI Studio or restricted projects may return
403 Permission Deniedor429 Quota Exceedederrors. Generate a standard key starting withAIzaSy.
- Verify your Gemini API key is correctly set in the
-
Port already in use:
- Change the port in
main.py:uvicorn.run(app, host="0.0.0.0", port=8001)
- Change the port in
This project is for educational purposes.