AI-powered LaTeX solution generator for algorithms and data structures problems
LatexAI is an intelligent web application that generates comprehensive, professionally formatted LaTeX solutions for Design and Analysis of Algorithms problems. It leverages advanced AI models to provide detailed, academic-quality solutions with proper mathematical formatting, time complexity analysis, and pseudocode implementations.
- AI-Powered Solutions: Generate detailed algorithm solutions using advanced language models
- Real-time Streaming: Watch solutions appear in real-time as they're generated
- LaTeX Formatting: Professionally formatted solutions ready for academic use
- Session Consistency: Maintains consistent writing style throughout each session
- Chat History: Browse and revisit previous solutions
- Algorithm Analysis: Step-by-step time complexity analysis
- Pseudocode Generation: Clean, academic-style pseudocode
- Mathematical Notation: Proper LaTeX mathematical formatting
- Comprehensive Explanations: Detailed, 2000+ word solutions
- Error-Free Output: LaTeX solutions that compile without errors
- Multiple API Keys: Load balancing with automatic failover
- Rate Limiting: Built-in retry logic with exponential backoff
- Responsive Design: Works seamlessly on desktop and mobile
- Dark Theme: Easy-on-the-eyes interface for extended use
- Node.js 16+ and npm
- Groq API keys (multiple recommended for better reliability)
- Clone the repository
git clone https://github.com/TexZ-GenZ/LatexAI.git
cd LatexAI- Install dependencies
# Install frontend dependencies
cd frontend
npm install
# Install server dependencies
cd ../server
npm install- Environment Setup
Create a
.envfile in the server directory:
GROQ_API_KEY1=your_groq_api_key_1
GROQ_API_KEY2=your_groq_api_key_2
GROQ_API_KEY3=your_groq_api_key_3
# Add up to 6 API keys for better load balancing- Development
# Terminal 1: Start the server
cd server
npm start
# Terminal 2: Start the frontend
cd frontend
npm run dev- Production Build
cd frontend
npm run build- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- Lucide React for icons
- Vercel Analytics for usage tracking
- Express.js server
- Groq API integration with LLaMA 3 70B model
- Streaming responses for real-time output
- Multiple API key rotation for reliability
- CORS enabled for cross-origin requests
- Ask a Question: Enter your algorithms or data structures problem
- Get Solutions: Receive comprehensive LaTeX-formatted solutions
- Copy & Paste: Solutions are ready to use in your LaTeX documents
- Browse History: Access previous solutions from the sidebar
Explain the merge sort algorithm and analyze its time complexity
\begin{solution}
Merge sort is a divide-and-conquer algorithm that sorts an array by recursively...
% Time Complexity Analysis
Let T(n) be the time complexity of merge sort for an array of size n.
T(n) = 2T(n/2) + O(n)
...
\end{solution}- Academic Assignments: Generate detailed algorithm solutions for coursework
- Exam Preparation: Practice with comprehensive explanations
- Research Papers: Get properly formatted algorithm descriptions
- Teaching Materials: Create educational content with proper mathematical notation
| Component | Technology | Purpose |
|---|---|---|
| Frontend | React + TypeScript | User interface and type safety |
| Styling | Tailwind CSS | Responsive, utility-first styling |
| Build Tool | Vite | Fast development and building |
| Backend | Express.js | API server and request handling |
| AI Model | Groq LLaMA 3 70B | Solution generation |
| Deployment | Vercel | Hosting and serverless functions |
POST /api/generate
Content-Type: application/json
{
"question": "Your algorithm question here",
"seed": 1234
}Response: Streaming text content with LaTeX formatting
GET /api/healthResponse: { "status": "ok" }
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Maintain consistent code formatting
- Add tests for new features
- Update documentation as needed
This project is open source and available under the MIT License.
- Groq for providing fast AI inference
- LLaMA 3 for the underlying language model
- Vercel for seamless deployment
- React and TypeScript communities for excellent tooling
- Live Demo: latex-ai.vercel.app
- Issues: GitHub Issues
- Author: @TexZ-GenZ
Made with ❤️ for the academic community