You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Development
npm run dev # Start dev server
npm run build # Build for production
npm run start # Start production server# Quality
npm run lint # Run ESLint
npx tsc --noEmit # Type check
npm audit # Security check# Deployment
netlify deploy --prod # Deploy to Netlify
vercel --prod # Deploy to Vercel
firebase deploy # Deploy to Firebase
User Request
↓
Try Preferred Model (2 retries)
↓ (if fails)
Try Other Models in Category
↓ (if fails)
Try All Available Models
↓ (if all fail)
User-Friendly Error Message
🐛 Troubleshooting
AI Not Responding
# Check API keyecho$HUGGINGFACE_API_KEY# Test API key
curl -H "Authorization: Bearer $HUGGINGFACE_API_KEY" \
https://huggingface.co/api/whoami
Build Fails
# Clean and rebuild
rm -rf node_modules .next
npm install
npm run build
# Problem Solving
POST /api/ai/solve
Body: {"problem": "What is 2+2?"}
# Summarization
POST /api/ai/summarize
Body: {"text": "Long text...", "style": "brief"}
# Web Search
POST /api/ai/search
Body: {"query": "What is AI?"}
🎨 Slash Commands
Command
Description
/solve
Solve problems step-by-step
/summarize
Summarize long text
/search
Search the web
📱 Routes
Route
Description
/
Landing page
/chat
Main chat interface
/login
Authentication
/visual-math
Visual math solver
/pdf-analyzer
PDF analysis
/documentation
Docs
🔐 Security Checklist
Never commit .env.local
Use environment variables for secrets
Enable HTTPS in production
Configure CORS properly
Validate all user inputs
📈 Performance Tips
Use Auto Mode - Let smart routing pick best model
Enable Caching - Cache common responses
Optimize Images - Use Next.js Image component
Enable PWA - Better mobile experience
Monitor Logs - Track model performance
🆘 Quick Fixes
Model Loading Error
Error: "Model is currently loading"
Fix: Wait 20-30 seconds, retry automatically happens
Rate Limit Error
Error: "Rate limit exceeded"
Fix: Wait a moment, smart fallback tries other models
Network Error
Error: "Network error"
Fix: Check internet connection, retry
📚 Documentation
File
Purpose
README.md
Getting started
SETUP_GUIDE.md
Detailed setup
TESTING_GUIDE.md
Testing procedures
DEPLOYMENT_CHECKLIST.md
Deployment steps
SMART_FALLBACK_SYSTEM.md
Fallback system
PROJECT_STATUS.md
Current status
💰 Cost Breakdown
Hugging Face API: $0.00 (FREE)
Firebase (Spark): $0.00 (FREE tier)
Netlify Hosting: $0.00 (FREE tier)
─────────────────────────────────
Total Monthly: $0.00 💰
🎯 Quick Tests
# Test homepage
curl -I http://localhost:3000
# Test chat page
curl -I http://localhost:3000/chat
# Test API
curl -X POST http://localhost:3000/api/ai/solve \
-H "Content-Type: application/json" \
-d '{"problem": "What is 2+2?"}'