Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 

Repository files navigation

🧠 LatexAI

AI-powered LaTeX solution generator for algorithms and data structures problems

Live Demo TypeScript JavaScript

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.

✨ Features

🎯 Core Functionality

  • 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

📝 Academic Focus

  • 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

🔧 Technical Features

  • 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

🚀 Quick Start

Prerequisites

  • Node.js 16+ and npm
  • Groq API keys (multiple recommended for better reliability)

Installation

  1. Clone the repository
git clone https://github.com/TexZ-GenZ/LatexAI.git
cd LatexAI
  1. Install dependencies
# Install frontend dependencies
cd frontend
npm install

# Install server dependencies
cd ../server
npm install
  1. Environment Setup Create a .env file 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
  1. Development
# Terminal 1: Start the server
cd server
npm start

# Terminal 2: Start the frontend
cd frontend
npm run dev
  1. Production Build
cd frontend
npm run build

🏗️ Architecture

Frontend (/frontend)

  • React 18 with TypeScript
  • Vite for fast development and building
  • Tailwind CSS for styling
  • Lucide React for icons
  • Vercel Analytics for usage tracking

Backend (/server)

  • 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

📖 Usage

  1. Ask a Question: Enter your algorithms or data structures problem
  2. Get Solutions: Receive comprehensive LaTeX-formatted solutions
  3. Copy & Paste: Solutions are ready to use in your LaTeX documents
  4. Browse History: Access previous solutions from the sidebar

Example Input:

Explain the merge sort algorithm and analyze its time complexity

Example Output:

\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}

🎯 Use Cases

  • 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

🛠️ Technology Stack

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

📚 API Reference

Generate Solution

POST /api/generate
Content-Type: application/json

{
  "question": "Your algorithm question here",
  "seed": 1234
}

Response: Streaming text content with LaTeX formatting

Health Check

GET /api/health

Response: { "status": "ok" }

🤝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Maintain consistent code formatting
  • Add tests for new features
  • Update documentation as needed

📄 License

This project is open source and available under the MIT License.

🌟 Acknowledgments

  • Groq for providing fast AI inference
  • LLaMA 3 for the underlying language model
  • Vercel for seamless deployment
  • React and TypeScript communities for excellent tooling

📞 Support


Made with ❤️ for the academic community

⭐ Star this repo🐛 Report Bug💡 Request Feature

About

AI-powered LaTeX solution generator for algorithms and data structures problems, featuring real-time streaming responses and professionally formatted academic solutions.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages