🤖 AI Chat Setup Guide
Enable your free AI oncology consultant in 5 minutes
📌 What you're setting up:
Your website will use
100% FREE AI services:
- Google Gemini Flash 2.0: 60 free requests per minute
- Groq with Llama 3.1: 14,400 free requests per day (backup)
Both are completely free, no credit card required!
1Get Free Google Gemini API Key
- Visit: https://aistudio.google.com/app/apikey
- Sign in with your Google account
- Click "Create API Key"
- Select "Create API key in new project" (or choose existing project)
- Copy the API key (starts with
AIza...)
✓ Your Gemini API key is: Free forever, 60 requests/minute, no credit card required
2Get Free Groq API Key (Backup)
- Visit: https://console.groq.com/keys
- Sign up for free (email + password, or Google login)
- Verify your email
- Click "Create API Key"
- Give it a name (e.g., "FightCancer Website")
- Copy the API key (starts with
gsk_...)
✓ Your Groq API key is: Free forever, 14,400 requests/day, lightning-fast responses
3Add API Keys to Your Website
- Open
fightcancer_final.html in a text editor (Notepad++, VS Code, etc.)
- Press
Ctrl+F to search for: AI_CONFIG
- Find these two lines:
const AI_CONFIG = {
gemini: {
apiKey: 'YOUR_GEMINI_API_KEY', // ← Replace this
endpoint: 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp:generateContent'
},
groq: {
apiKey: 'YOUR_GROQ_API_KEY', // ← Replace this
endpoint: 'https://api.groq.com/openai/v1/chat/completions',
model: 'llama-3.1-70b-versatile'
}
};
- Replace
'YOUR_GEMINI_API_KEY' with your actual Gemini key
- Replace
'YOUR_GROQ_API_KEY' with your actual Groq key
- Save the file
⚠️ Important: Keep the quotes around the API keys! Example:
apiKey: 'AIzaSyC7x...' ✓ Correct
apiKey: AIzaSyC7x... ✗ Wrong (missing quotes)
4Test Your AI Chat
- Open
fightcancer_final.html in your web browser
- Look for the ◉ button in the bottom-right corner
- Click it to open the AI chat panel
- Try asking:
what is allulose?
- You should get an instant response from the local knowledge base
- Try asking:
tell me something random about cancer treatment
- This should trigger the Gemini API (check browser console for confirmation)
✓ If you see responses: Everything is working! Your AI consultant is now active.
💡
Check Browser Console: Press
F12 → Console tab to see which AI is responding:
✓ Answer from cache = Instant response from local knowledge
✓ Answer from Gemini = Google AI responded
✓ Answer from Groq = Groq backup AI responded
5Troubleshooting
Problem: "I'm having trouble connecting to my AI systems"
- ✓ Check that API keys are correctly pasted (no extra spaces)
- ✓ Ensure quotes are around the keys:
'your-key-here'
- ✓ Open browser console (F12) to see error messages
- ✓ Verify API keys are active (visit the provider's website)
Problem: CORS errors in console
- ✓ Upload website to a web server (GitHub Pages, Netlify, Vercel)
- ✓ APIs may not work when opening HTML file directly from disk
Problem: Rate limits exceeded
- ✓ Gemini: 60 requests/minute (wait 1 minute)
- ✓ Groq: 14,400 requests/day (extremely generous)
- ✓ Most questions are answered from cache instantly (no API calls)
💰 Is This Really Free?
YES! 100% Free forever.
- Google Gemini Flash 2.0: Free tier includes 60 requests/minute, 1500 requests/day
- Groq (Llama 3.1 70B): Free tier includes 14,400 requests/day
- Local Knowledge Base: 20+ pre-loaded answers, instant responses, zero API calls
For a patient asking ~50 questions per day:
- ✓ 95% answered from cache (instant, free)
- ✓ 5% need AI (~3 questions) = well within free limits
- ✓ Monthly cost: $0.00
🎉 Setup Complete!
Your AI oncology consultant is now ready to help patients 24/7 with:
- Ketogenic diet guidance
- Supplement protocols
- Fasting strategies
- Allulose metabolic deception
- Cannabis dosing
- Cortisol management
- ...and more!
Chat history is saved privately on each patient's device (localStorage) for complete privacy.