File size: 19,747 Bytes
3eafcdd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 | # π SETUP.md β MultiMind Classroom Setup Guide
> Complete beginner-friendly guide to install, configure, run, and use MultiMind Classroom.
> Includes cost-effective AI model recommendations for every feature.
---
## π Table of Contents
1. [Prerequisites](#1-prerequisites)
2. [Installation (Step by Step)](#2-installation-step-by-step)
3. [Running the App](#3-running-the-app)
4. [Configuration β Which API Keys Do I Need?](#4-configuration--which-api-keys-do-i-need)
5. [Best & Most Cost-Effective AI Models](#5-best--most-cost-effective-ai-models)
6. [Feature-by-Feature Setup](#6-feature-by-feature-setup)
7. [Free Tier & Zero-Cost Options](#7-free-tier--zero-cost-options)
8. [Recommended Starter Configurations](#8-recommended-starter-configurations)
9. [Docker Deployment](#9-docker-deployment)
10. [Troubleshooting](#10-troubleshooting)
11. [FAQ](#11-faq)
---
## 1. Prerequisites
| Requirement | Minimum | Recommended |
|-------------|---------|-------------|
| **Node.js** | 20.9.0+ | 22.x LTS |
| **npm** or **pnpm** | npm 10+ or pnpm 10+ | pnpm (faster) |
| **OS** | Windows 10+, macOS 12+, Linux | Any modern OS |
| **RAM** | 4 GB | 8 GB+ |
| **Browser** | Chrome 100+, Firefox 100+, Edge 100+, Safari 16+ | Chrome or Edge (best WebRTC/TTS support) |
### Check your environment
```bash
node --version # Should show v20.x or v22.x
npm --version # Should show 10.x+
```
**Don't have Node.js?** Download from [nodejs.org](https://nodejs.org/) β pick the **LTS** version.
---
## 2. Installation (Step by Step)
### Step 1: Clone the repository
```bash
git clone https://huggingface.co/muthuk1/OpenMAIC-React
cd OpenMAIC-React
```
### Step 2: Install dependencies
```bash
npm install --legacy-peer-deps
```
> **Why `--legacy-peer-deps`?** Some packages have peer dependency version mismatches. This flag tells npm to install them anyway. It's safe.
### Step 3: Build workspace packages
The app uses two local packages that need to be built first:
```bash
# Build mathml2omml (MathML β OMML converter for PowerPoint export)
cd packages/mathml2omml
npm install
npm run build
cd ../..
# Build pptxgenjs (PowerPoint generation library)
cd packages/pptxgenjs
npm install @rollup/plugin-node-resolve @rollup/plugin-commonjs @rollup/plugin-typescript typescript tslib --save-dev
npx tsc --outDir ./dist-tsc --declaration --module es2020 --target es2016 --moduleResolution node --esModuleInterop true --allowSyntheticDefaultImports true --strict --strictNullChecks false --noImplicitAny false --lib dom,es2020 --skipLibCheck
mkdir -p dist
# Bundle compiled JS
cat > rollup.temp.mjs << 'EOF'
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
export default {
input: "dist-tsc/pptxgen.js",
output: [
{ file: "./dist/pptxgen.es.js", format: "es" },
{ file: "./dist/pptxgen.cjs.js", format: "cjs", exports: "default" },
],
external: [/^node:.*/, "jszip"],
plugins: [resolve({ preferBuiltins: true }), commonjs()]
};
EOF
npx rollup -c rollup.temp.mjs
cp types/index.d.ts dist/
rm rollup.temp.mjs
cd ../..
# Install local packages into the main project
npm install ./packages/mathml2omml ./packages/pptxgenjs --legacy-peer-deps
```
### Step 4: Configure environment
```bash
cp .env.example .env
```
Edit `.env` with your API keys (see [Section 4](#4-configuration--which-api-keys-do-i-need) for which keys you actually need).
### Step 5: Verify the build
```bash
npm run build
```
You should see `β built in ~25s` with no errors.
---
## 3. Running the App
### Development mode (with hot reload)
```bash
npm run dev
```
Opens at **http://localhost:5173**
### Production preview
```bash
npm run build
npm run preview
```
Opens at **http://localhost:4173**
### What you'll see
1. **Home page** β A clean interface with a text area to type your lesson requirements
2. **Upload a PDF** or type what you want to teach
3. Click **Generate** β the app creates an AI classroom with slides, quizzes, and interactive content
4. **Enter the classroom** β watch the AI teacher present with voice, whiteboard, and discussion
---
## 4. Configuration β Which API Keys Do I Need?
### The short answer: **You only need ONE LLM API key to get started.**
Everything else is optional. Here's what each key unlocks:
| Feature | Required Key | Can You Skip It? |
|---------|-------------|-----------------|
| π§ **Classroom generation** (slides, quizzes, actions) | Any LLM key (OpenAI, Google, etc.) | β No β this is the core feature |
| π£οΈ **Voice narration** (TTS) | TTS provider key OR use browser TTS | β
Yes β browser TTS works free |
| π€ **Voice input** (ASR) | ASR provider key OR use browser ASR | β
Yes β browser ASR works free |
| πΌοΈ **AI image generation** in slides | Image provider key | β
Yes β slides work without images |
| π¬ **AI video generation** in slides | Video provider key | β
Yes β slides work without videos |
| π **Web search** for content enrichment | Tavily API key | β
Yes β generation works without search |
| π **Advanced PDF parsing** | MinerU Cloud key | β
Yes β built-in unpdf parser is free |
### Minimum viable setup: just ONE key
Pick one LLM provider and set its key in `.env`:
```env
# Option A: Google Gemini (BEST FREE OPTION)
GOOGLE_API_KEY=your-key-here
# Option B: OpenAI
OPENAI_API_KEY=your-key-here
# Option C: DeepSeek (cheapest paid)
DEEPSEEK_API_KEY=your-key-here
```
---
## 5. Best & Most Cost-Effective AI Models
### π§ LLM β For Classroom Generation (THE most important choice)
| Tier | Provider | Model | Price (per 1M tokens) | Quality | Best For |
|------|----------|-------|----------------------|---------|----------|
| π **FREE** | Google | `gemini-2.5-flash` | **$0 (free tier: 500 req/day)** | ββββ | **Best free option. Start here.** |
| π **FREE** | Google | `gemini-2.5-flash-lite` | **$0 (free tier)** | βββ | Faster, simpler content |
| π° **Budget** | DeepSeek | `deepseek-chat` | **$0.14 input / $0.28 output** | ββββ | Best bang-for-buck paid option |
| π° **Budget** | GLM (ZhipuAI) | `glm-4.7-flash` | **Free tier available** | ββββ | Great for Chinese content |
| π΅ **Mid** | OpenAI | `gpt-4o-mini` | $0.15 / $0.60 | ββββ | Good balance of cost & quality |
| π΅ **Mid** | Anthropic | `claude-haiku-4-5` | $0.80 / $4.00 | βββββ | Better slide layouts |
| π **Premium** | OpenAI | `gpt-5.5` | $2.00 / $10.00 | βββββ | Best overall quality |
| π **Premium** | Anthropic | `claude-sonnet-4-5` | $3.00 / $15.00 | βββββ | Best reasoning & creativity |
| π **Premium** | Google | `gemini-2.5-pro` | $1.25 / $10.00 | βββββ | Longest context (1M tokens) |
| π **Local** | Ollama | `llama3.3`, `qwen2.5` | **$0 (runs on your GPU)** | βββ | Privacy, no internet needed |
> **π‘ My recommendation:** Start with **Google Gemini 2.5 Flash** (free). If you need better quality, switch to **DeepSeek** ($0.14/M) or **GPT-4o-mini** ($0.15/M).
### π£οΈ TTS β Voice Narration
| Tier | Provider | Voice | Price | Quality | Setup |
|------|----------|-------|-------|---------|-------|
| π **FREE** | Browser Native | System voices | **$0** | ββ | No setup needed β works in Chrome/Edge |
| π° **Budget** | OpenAI | alloy, nova, shimmer | $15.00/1M chars | βββββ | Best quality-to-price ratio |
| π° **Budget** | MiniMax | speech-02 | ~$0.50/1M chars (Chinese pricing) | ββββ | Great for Chinese voices |
| π΅ **Mid** | Azure | 500+ voices | $16.00/1M chars | βββββ | Most voice variety, many languages |
| π΅ **Mid** | ElevenLabs | Custom voices | $11.00/1M chars | βββββ | Most natural sounding |
| π **Advanced** | VoxCPM | Voice cloning | Self-hosted | ββββ | Clone any voice |
> **π‘ My recommendation:** Start with **Browser TTS** (free, decent quality in Chrome). Upgrade to **OpenAI TTS** ($15/1M chars) when you want natural voices.
### π€ ASR β Voice Input (Speech-to-Text)
| Tier | Provider | Price | Quality |
|------|----------|-------|---------|
| π **FREE** | Browser Native (Web Speech API) | **$0** | βββ β Works in Chrome/Edge |
| π° **Best** | OpenAI Whisper | $0.006/minute | βββββ β Best accuracy |
| π° **Budget** | Qwen ASR | Low (Chinese pricing) | ββββ β Great for Chinese |
> **π‘ My recommendation:** **Browser ASR** is free and good enough. Use **Whisper** only if you need high accuracy.
### πΌοΈ Image Generation (Optional)
| Tier | Provider | Model | Price per image | Quality |
|------|----------|-------|----------------|---------|
| π° **Budget** | OpenAI | `gpt-image-1-mini` | ~$0.02 | ββββ |
| π΅ **Mid** | OpenAI | `gpt-image-2` | ~$0.04-0.08 | βββββ |
| π΅ **Mid** | Grok | `grok-image` | ~$0.05 | ββββ |
| π΅ **Mid** | MiniMax | `image-01` | ~$0.03 | ββββ |
| π **Premium** | Seedream | `seedream-5.0` | ~$0.02 | βββββ (Chinese provider) |
> **π‘ My recommendation:** Skip images initially. When ready, **OpenAI gpt-image-1-mini** at $0.02/image is excellent value.
### π¬ Video Generation (Optional, Expensive)
| Provider | Model | Price | Duration |
|----------|-------|-------|----------|
| Kling | kling-v2.6 | ~$0.10-0.30/video | 5-10s |
| Seedance | seedance-1.5-pro | ~$0.05-0.15/video | 5-10s |
| Veo | veo-3 | ~$0.10/video | 5-8s |
> **π‘ My recommendation:** Skip video generation unless you specifically need it. It's expensive and slow (30-120s per video).
### π Web Search (Optional)
| Provider | Free Tier | Paid Price |
|----------|-----------|-----------|
| Tavily | **1,000 free searches/month** | $0.001/search after |
> **π‘ My recommendation:** Get a **free Tavily key** β 1,000 searches/month is plenty.
### π PDF Parsing
| Provider | Price | Quality |
|----------|-------|---------|
| unpdf (built-in) | **$0 β always free** | βββ β Good for simple PDFs |
| MinerU (local) | **$0 β self-hosted** | ββββ β Better for complex layouts |
| MinerU Cloud | Pay-per-use | βββββ β Best for scanned/complex PDFs |
> **π‘ My recommendation:** The built-in **unpdf** parser is free and works fine for most PDFs. No setup needed.
---
## 6. Feature-by-Feature Setup
### π§ Core: Classroom Generation
This is the only required feature. You need ONE LLM key.
**Option A: Google Gemini (FREE)**
1. Go to [aistudio.google.com](https://aistudio.google.com/)
2. Click "Get API key" β "Create API key"
3. Add to `.env`:
```env
GOOGLE_API_KEY=AIzaSy...your-key
```
4. In the app: Settings β Providers β Google β select `gemini-2.5-flash`
**Option B: OpenAI (Paid, best quality)**
1. Go to [platform.openai.com/api-keys](https://platform.openai.com/api-keys)
2. Create a new API key
3. Add credit ($5 minimum)
4. Add to `.env`:
```env
OPENAI_API_KEY=sk-...your-key
```
**Option C: DeepSeek (Cheapest paid)**
1. Go to [platform.deepseek.com](https://platform.deepseek.com/)
2. Create account β Get API key
3. Add to `.env`:
```env
DEEPSEEK_API_KEY=sk-...your-key
```
**Option D: Ollama (Free, local, needs GPU)**
1. Install Ollama: [ollama.ai](https://ollama.ai/)
2. Pull a model: `ollama pull llama3.3`
3. Add to `.env`:
```env
OLLAMA_BASE_URL=http://localhost:11434/v1
OLLAMA_MODELS=llama3.3
ALLOW_LOCAL_NETWORKS=true
```
### π£οΈ Voice Narration (TTS)
**Free option: Browser TTS (no setup needed)**
- Works out of the box in Chrome, Edge, Safari
- In the app: Settings β Audio β TTS Provider β "Browser"
**Paid option: OpenAI TTS**
- Same API key as LLM (if you're using OpenAI)
- In the app: Settings β Audio β TTS Provider β "OpenAI" β Voice β "nova" (recommended)
### π€ Voice Input (ASR)
**Free option: Browser ASR (no setup needed)**
- Works in Chrome and Edge (not Firefox/Safari)
- Click the microphone button in the chat area
### π Web Search
1. Go to [tavily.com](https://tavily.com/) β Sign up (free)
2. Get API key from dashboard
3. Add to `.env`:
```env
TAVILY_API_KEY=tvly-...your-key
```
4. Toggle "Web Search" on the home page when generating
### πΌοΈ Image Generation
**OpenAI Images (easiest):**
- Same API key as LLM
- In the app: Settings β Image β Provider β "OpenAI Image" β Model β "GPT Image 1 Mini"
- Toggle "Enable Image Generation" on the home page
### π¬ Video Generation
- Configure in Settings β Video β choose provider
- Video generation is slow (30-120 seconds per video) and expensive
- Only recommended for demo/showcase purposes
---
## 7. Free Tier & Zero-Cost Options
### Completely free setup (no credit card needed):
```env
# .env for 100% free setup
GOOGLE_API_KEY=your-gemini-key # Free: 500 requests/day
TAVILY_API_KEY=your-tavily-key # Free: 1,000 searches/month
```
**What you get for free:**
- β
Full classroom generation (slides, quizzes, interactive content)
- β
Multi-agent discussions
- β
Voice narration (browser TTS)
- β
Voice input (browser ASR)
- β
PDF parsing (built-in unpdf)
- β
Web search enrichment (1,000/month)
- β
Whiteboard
- β
PowerPoint export
- β
Classroom ZIP export/import
- β AI image generation (needs paid key)
- β AI video generation (needs paid key)
- β Premium voice quality (needs paid TTS key)
### Monthly cost estimates:
| Usage Level | LLM | TTS | Images | Total |
|-------------|-----|-----|--------|-------|
| **Hobby** (5 classrooms/week) | $0 (Gemini free) | $0 (browser) | $0 (skip) | **$0/month** |
| **Regular** (3 classrooms/day) | ~$2 (DeepSeek) | $0 (browser) | $0 (skip) | **~$2/month** |
| **Power user** (10/day, with images) | ~$5 (DeepSeek) | ~$3 (OpenAI TTS) | ~$5 (images) | **~$13/month** |
| **Premium** (full features) | ~$20 (GPT-5.5) | ~$10 (Azure TTS) | ~$15 (images+video) | **~$45/month** |
---
## 8. Recommended Starter Configurations
### π’ Configuration A: "Zero Cost Beginner"
```env
GOOGLE_API_KEY=your-key
```
- LLM: Gemini 2.5 Flash (free)
- TTS: Browser native (free)
- ASR: Browser native (free)
- PDF: unpdf built-in (free)
- Images/Video: disabled
- **Cost: $0/month**
### π‘ Configuration B: "Best Value"
```env
GOOGLE_API_KEY=your-key
DEEPSEEK_API_KEY=your-key
TAVILY_API_KEY=your-key
```
- LLM: DeepSeek Chat for generation, Gemini for backup
- TTS: Browser native
- Web Search: Tavily (1,000 free/month)
- **Cost: ~$2-5/month**
### π΅ Configuration C: "Full Experience"
```env
OPENAI_API_KEY=your-key
GOOGLE_API_KEY=your-key
TAVILY_API_KEY=your-key
```
- LLM: GPT-4o-mini (primary), Gemini 2.5 Pro (long docs)
- TTS: OpenAI TTS (same key)
- ASR: OpenAI Whisper (same key)
- Images: OpenAI Image (same key)
- Web Search: Tavily
- **Cost: ~$10-20/month**
### π£ Configuration D: "Chinese Content Focus"
```env
GLM_API_KEY=your-key
QWEN_API_KEY=your-key
DEEPSEEK_API_KEY=your-key
```
- LLM: GLM-4.7-Flash or DeepSeek
- TTS: GLM TTS or MiniMax
- Best for Chinese language classroom content
- **Cost: ~$2-5/month**
---
## 9. Docker Deployment
### Using Docker Compose (recommended for production)
```bash
# 1. Create .env file with your API keys
cp .env.example .env
# Edit .env with your keys
# 2. Build and run
docker compose up -d
# 3. Access the app
open http://localhost:3000
```
### Using Dockerfile directly
```bash
docker build -t multimind-classroom .
docker run -p 3000:3000 --env-file .env multimind-classroom
```
### Access Control (optional)
To password-protect your deployment:
```env
ACCESS_CODE=my-secret-password
```
Users will see a login screen and must enter this code.
---
## 10. Troubleshooting
### Build fails with "Cannot find module"
```bash
# Clean install
rm -rf node_modules package-lock.json
npm install --legacy-peer-deps
npm install ./packages/mathml2omml ./packages/pptxgenjs --legacy-peer-deps
npm run build
```
### "API key required" error
- Make sure your `.env` file is in the project root (same directory as `package.json`)
- Make sure you selected the correct provider in Settings β Providers
- Restart the dev server after changing `.env`
### Browser TTS not working
- Browser TTS only works in Chrome, Edge, and Safari
- Firefox does not support Web Speech API synthesis
- Make sure your browser is not muted
- Try a different voice in Settings β Audio β TTS
### Classroom generation is slow
- Gemini 2.5 Flash is fastest (2-5 seconds per scene)
- GPT-4o-mini is fast (3-8 seconds per scene)
- Claude models are slower (5-15 seconds per scene)
- A 10-slide classroom typically takes 30-120 seconds total
### "Failed to parse PDF"
- The built-in unpdf parser works for most text-based PDFs
- Scanned/image PDFs need MinerU Cloud
- Very large PDFs (>50MB) may need to be split
- Try copy-pasting the text content directly into the requirements field
### Images not loading in slides
- Check that you've enabled image generation in Settings
- Check that the image provider has a valid API key
- Generated images are stored in IndexedDB β clearing browser data removes them
### Whiteboard not showing
- Click the pencil (βοΈ) icon in the bottom toolbar
- Whiteboard only appears on slide-type scenes (not quiz or interactive)
---
## 11. FAQ
**Q: Do I need to pay for anything?**
A: No. You can run the entire app for free using Google Gemini's free tier + browser TTS/ASR.
**Q: Can I use my own local LLM?**
A: Yes! Install Ollama, pull a model (e.g., `ollama pull llama3.3`), and configure it in `.env`. You need a GPU with at least 8GB VRAM for good results.
**Q: How much does it cost to generate one classroom?**
A: With Gemini free tier: $0. With DeepSeek: ~$0.01-0.05. With GPT-5.5: ~$0.20-0.50. Depends on PDF length and number of slides.
**Q: Can I export to PowerPoint?**
A: Yes! Click the export button (β¬οΈ) in the classroom header and select "Export PPTX". All slides, text, shapes, charts, and images are included.
**Q: Does it work offline?**
A: The app itself runs locally, but AI generation needs internet access to call LLM APIs. If you use Ollama (local LLM), you can generate content offline. Previously generated classrooms are stored in IndexedDB and accessible offline.
**Q: What languages are supported?**
A: The UI supports 5 languages (Chinese, English, Japanese, Russian, Arabic). Classroom content can be generated in ANY language β just specify your desired language in the requirements field or let the AI auto-detect from your PDF.
**Q: Can multiple students use the same classroom?**
A: Currently, classrooms are stored locally in your browser. To share, export as a `.multimind.zip` file and share that file. Others can import it.
**Q: What PDF format works best?**
A: Text-based PDFs work best. The parser extracts text and images. For scanned PDFs, use MinerU Cloud. Maximum recommended size: 50MB.
**Q: How do I switch between AI providers mid-use?**
A: Click the Settings gear (βοΈ) β Providers tab β select a different provider and model. The change takes effect immediately for the next generation.
---
## Quick Start Cheat Sheet
```bash
# 1. Clone
git clone https://huggingface.co/muthuk1/OpenMAIC-React && cd OpenMAIC-React
# 2. Install
npm install --legacy-peer-deps
# 3. Build workspace packages
cd packages/mathml2omml && npm install && npm run build && cd ../..
# 4. Configure (minimum: one LLM key)
cp .env.example .env
echo "GOOGLE_API_KEY=your-key-here" >> .env
# 5. Run
npm run dev
# 6. Open http://localhost:5173 and generate your first classroom!
```
**That's it!** Type a topic, click Generate, and watch MultiMind Classroom create an interactive AI lesson. π
|