Tech Cost Projections - Production Launch
Executive Summaryβ
This document provides detailed cost projections for the Toto ecosystem as user base grows. Costs are broken down by service category and include scaling scenarios from 1,000 to 100,000+ active users.
Key Cost Drivers:
- AI/ML Services (Google Gemini) - Largest variable cost
- Firebase App Hosting (Cloud Run) - Scales with traffic
- Firestore Database - Scales with data operations
- Firebase Storage - Scales with image/file uploads
- Email Services (SendGrid) - Scales with user engagement
- Payment Processing (Stripe) - Transaction-based fees
π Infrastructure Overviewβ
Firebase Projectsβ
toto-f9d2f- Main application (production)toto-f9d2f-stg- Main application (staging)toto-bo- Backoffice (production)toto-bo-stg- Backoffice (staging)toto-ai-hub- AI servicestoto-wallet- Payment processingtoto-landing- Landing pagestoto-investors- Investor pages
Current Configurationβ
toto-app (Production):
- Min instances: 2
- Max instances: 100
- CPU: 2 vCPU
- Memory: 1024 MiB
- Concurrency: 100
toto-bo (Production):
- Min instances: 1
- Max instances: 10
- CPU: 1 vCPU
- Memory: 1024 MiB
- Concurrency: 80
toto-ai-hub:
- Min instances: 2
- Max instances: 20
- CPU: 2 vCPU
- Memory: 2048 MiB
- Concurrency: 100
π΅ Cost Breakdown by Serviceβ
1. AI/ML Services (Google Gemini) π΄ HIGHEST COSTβ
Current Usage:
- Gemini 2.0 Flash (primary, 85-90% of usage) - $0.075 per 1M input tokens, $0.30 per 1M output tokens
- Gemini 2.0 PRO (complex tasks, 10-15% of usage) - $1.25 per 1M input tokens, $5.00 per 1M output tokens
- Model Selection Service optimizes Flash vs PRO usage (saves 30-50%)
Realistic Token Usage per Interaction:
- System prompt: 800-1,200 tokens (agent persona, rules, context)
- User message: 100-200 tokens
- Knowledge context (RAG): 200-500 tokens
- Conversation history: 200-500 tokens (if multi-turn)
- Average input: 1,200-2,200 tokens per interaction
- Average output: 200-400 tokens per interaction
Estimated Usage per User:
- 2-3 sessions per month
- 2-3 AI interactions per session
- Total: 6-9 AI interactions per user per month
- Plus: Intent detection, image analysis, RAG retrieval
Monthly Cost Projections (Realistic Estimates):
| Users | AI Interactions/Month | Flash (85%) | PRO (15%) | Monthly Cost |
|---|---|---|---|---|
| 1,000 | 10,000 | 8,500 Γ $0.000285 | 1,500 Γ $0.00575 | $14-50 |
| 5,000 | 50,000 | 42,500 Γ $0.000285 | 7,500 Γ $0.00575 | $70-250 |
| 10,000 | 100,000 | 85,000 Γ $0.000285 | 15,000 Γ $0.00575 | $140-500 |
| 25,000 | 250,000 | 212,500 Γ $0.000285 | 37,500 Γ $0.00575 | $350-1,250 |
| 50,000 | 500,000 | 425,000 Γ $0.000285 | 75,000 Γ $0.00575 | $700-2,500 |
| 100,000 | 1,000,000 | 850,000 Γ $0.000285 | 150,000 Γ $0.00575 | $1,400-5,000 |
Note: Cost range reflects conservative (higher) vs realistic (lower) estimates. Actual costs depend on:
- Token usage per interaction (varies with context size)
- PRO model usage percentage (varies with conversation complexity)
- Additional services (embeddings, vector search if enabled)
Cost Optimization (Already Implemented):
- β Model Selection Service (30-50% savings) - Automatically uses Flash for simple tasks
- β Semantic Caching (reduces duplicate queries) - Saves 10-20%
- β Function Calling (reduces token usage) - Saves 5-10%
Additional Optimization Opportunities:
- β οΈ Rate limiting per user (potential 20-30% savings)
- β οΈ Prompt optimization (potential 15-20% savings)
- β οΈ Context window management (potential 10-15% savings)
Annual Cost Range: $168 - $60,000 (1K - 100K users, realistic estimates)
For detailed AI cost breakdown, see: AI_COSTS_DETAILED.md
2. Firebase App Hosting (Cloud Run) π‘ MEDIUM-HIGH COSTβ
Pricing:
- CPU: $0.00002400 per vCPU-second
- Memory: $0.00000250 per GiB-second
- Requests: $0.40 per million requests
- Minimum billable time: 100ms
toto-app Costs:
| Users | Avg Requests/Month | Avg Instances | CPU Hours | Memory Hours | Monthly Cost |
|---|---|---|---|---|---|
| 1,000 | 500K | 2-5 | 720 | 360 | $180 |
| 5,000 | 2.5M | 3-8 | 1,800 | 900 | $450 |
| 10,000 | 5M | 5-15 | 3,600 | 1,800 | $900 |
| 25,000 | 12.5M | 8-25 | 9,000 | 4,500 | $2,250 |
| 50,000 | 25M | 15-50 | 18,000 | 9,000 | $4,500 |
| 100,000 | 50M | 25-100 | 36,000 | 18,000 | $9,000 |
toto-bo Costs (Lower Traffic):
| Users | Avg Requests/Month | Avg Instances | Monthly Cost |
|---|---|---|---|
| 1,000 | 50K | 1-2 | $25 |
| 5,000 | 250K | 1-3 | $125 |
| 10,000 | 500K | 1-5 | $250 |
| 25,000 | 1.25M | 2-8 | $625 |
| 50,000 | 2.5M | 3-10 | $1,250 |
| 100,000 | 5M | 5-10 | $2,500 |
toto-ai-hub Costs:
| Users | Avg Requests/Month | Avg Instances | Monthly Cost |
|---|---|---|---|
| 1,000 | 6K | 2-3 | $50 |
| 5,000 | 30K | 2-5 | $250 |
| 10,000 | 60K | 2-8 | $500 |
| 25,000 | 150K | 3-12 | $1,250 |
| 50,000 | 300K | 5-20 | $2,500 |
| 100,000 | 600K | 8-20 | $5,000 |
Total App Hosting Monthly: $255 - $16,500 (1K - 100K users)
3. Firestore Database π‘ MEDIUM COSTβ
Pricing:
- Document reads: $0.06 per 100K
- Document writes: $0.18 per 100K
- Document deletes: $0.02 per 100K
- Storage: $0.18 per GiB/month
- Network egress: $0.12 per GiB (first 10 GiB free)
Estimated Operations per User:
- Reads: ~500/month (case views, user data, etc.)
- Writes: ~50/month (updates, new data)
- Storage: ~5MB/user (cases, images metadata, etc.)
Monthly Cost Projections:
| Users | Reads/Month | Writes/Month | Storage (GB) | Monthly Cost |
|---|---|---|---|---|
| 1,000 | 500K | 50K | 5 | $330 |
| 5,000 | 2.5M | 250K | 25 | $1,650 |
| 10,000 | 5M | 500K | 50 | $3,300 |
| 25,000 | 12.5M | 1.25M | 125 | $8,250 |
| 50,000 | 25M | 2.5M | 250 | $16,500 |
| 100,000 | 50M | 5M | 500 | $33,000 |
Cost Optimization:
- β Index optimization (reduces unnecessary reads)
- β Caching strategies
- β οΈ Consider: Data archival for old cases
Annual Cost Range: $3,960 - $396,000 (1K - 100K users)
4. Firebase Storage π’ LOW-MEDIUM COSTβ
Pricing:
- Storage: $0.026 per GiB/month
- Downloads: $0.12 per GiB (first 1 GiB free/day)
- Uploads: $0.05 per GiB
Estimated Usage per User:
- Average storage: 50MB/user (case images, profile photos)
- Downloads: 200MB/user/month (image views)
Monthly Cost Projections:
| Users | Storage (GB) | Downloads (GB) | Monthly Cost |
|---|---|---|---|
| 1,000 | 50 | 200 | $30 |
| 5,000 | 250 | 1,000 | $150 |
| 10,000 | 500 | 2,000 | $300 |
| 25,000 | 1,250 | 5,000 | $750 |
| 50,000 | 2,500 | 10,000 | $1,500 |
| 100,000 | 5,000 | 20,000 | $3,000 |
Annual Cost Range: $360 - $36,000 (1K - 100K users)
5. Email Services (SendGrid) π’ LOW COSTβ
Pricing:
- Free tier: 100 emails/day
- Essentials: $19.95/month for 50K emails
- Pro: $89.95/month for 100K emails
- Additional: $0.20 per 1,000 emails over plan
Estimated Usage:
- Welcome emails: 1 per new user
- Transactional: 2-3 per active user/month
- Notifications: 1-2 per active user/month
Monthly Cost Projections:
| Users | Emails/Month | Plan | Monthly Cost |
|---|---|---|---|
| 1,000 | 3,000 | Free | $0 |
| 5,000 | 15,000 | Essentials | $20 |
| 10,000 | 30,000 | Essentials | $20 |
| 25,000 | 75,000 | Pro | $90 |
| 50,000 | 150,000 | Pro + 50K | $190 |
| 100,000 | 300,000 | Pro + 200K | $390 |
Annual Cost Range: $0 - $4,680 (1K - 100K users)
6. Payment Processing (Stripe) π‘ TRANSACTION-BASEDβ
Pricing:
- Standard: 2.9% + $0.30 per transaction
- International: 3.9% + $0.30
- ACH: 0.8% (max $5)
Estimated Usage:
- Average donation: $50
- Conversion rate: 5% of active users donate monthly
- Average transactions per donor: 1.5/month
Monthly Cost Projections:
| Users | Donors | Transactions | Revenue | Stripe Fees |
|---|---|---|---|---|
| 1,000 | 50 | 75 | $3,750 | $109 |
| 5,000 | 250 | 375 | $18,750 | $544 |
| 10,000 | 500 | 750 | $37,500 | $1,088 |
| 25,000 | 1,250 | 1,875 | $93,750 | $2,719 |
| 50,000 | 2,500 | 3,750 | $187,500 | $5,438 |
| 100,000 | 5,000 | 7,500 | $375,000 | $10,875 |
Note: These are fees, not costs - they're deducted from revenue.
Annual Fee Range: $1,308 - $130,500 (1K - 100K users)
7. Error Monitoring (Sentry) π’ LOW COSTβ
Pricing:
- Developer: Free (5K events/month)
- Team: $26/month (50K events)
- Business: $80/month (100K events)
Estimated Usage:
- ~10 events per user per month (errors, warnings)
Monthly Cost Projections:
| Users | Events/Month | Plan | Monthly Cost |
|---|---|---|---|
| 1,000 | 10K | Team | $26 |
| 5,000 | 50K | Team | $26 |
| 10,000 | 100K | Business | $80 |
| 25,000 | 250K | Business + Overage | $380 |
| 50,000 | 500K | Business + Overage | $880 |
| 100,000 | 1M | Business + Overage | $1,880 |
Annual Cost Range: $312 - $22,560 (1K - 100K users)
8. Twitter API π’ LOW COST (if used)β
Pricing:
- Basic: $100/month (10K tweets/month)
- Pro: $5,000/month (1M tweets/month)
Estimated Usage:
- Social media monitoring for guardians
- ~100 monitored accounts
- ~1,000 tweets analyzed/month
Monthly Cost: $100 (Basic plan sufficient for most scenarios)
Annual Cost: $1,200
9. Vertex AI Vector Search π‘ OPTIONALβ
Pricing:
- Index creation: $0.10 per GB indexed
- Query: $0.10 per 1,000 queries
- Storage: $0.10 per GB/month
Current Status: Optional (code supports it, but using in-memory by default)
If Enabled:
- Estimated: 1M vectors, 10K queries/month
- Monthly Cost: ~$200
π Total Monthly Cost Summaryβ
Note: AI costs shown as ranges (realistic - conservative estimates)
| Users | AI (Range) | App Hosting | Firestore | Storage | Sentry | TOTAL (Range) | ||
|---|---|---|---|---|---|---|---|---|
| 1,000 | $14-50 | $255 | $330 | $30 | $0 | $26 | $100 | $755-791 |
| 5,000 | $70-250 | $825 | $1,650 | $150 | $20 | $26 | $100 | $2,841-3,021 |
| 10,000 | $140-500 | $1,650 | $3,300 | $300 | $20 | $80 | $100 | $5,590-5,950 |
| 25,000 | $350-1,250 | $4,125 | $8,250 | $750 | $90 | $380 | $100 | $14,045-14,945 |
| 50,000 | $700-2,500 | $8,250 | $16,500 | $1,500 | $190 | $880 | $100 | $28,120-29,920 |
| 100,000 | $1,400-5,000 | $16,500 | $33,000 | $3,000 | $390 | $1,880 | $100 | $56,270-60,870 |
Annual Cost Range: $9,060 - $730,440 (1K - 100K users, realistic estimates)
Key Changes from Previous Estimates:
- AI costs updated to reflect realistic token usage patterns
- Lower end of range represents typical usage with optimizations
- Higher end represents conservative estimates with buffers
- See AI_COSTS_DETAILED.md for detailed breakdown
π― Cost Optimization Strategiesβ
Immediate Actions (Already Implemented)β
- β Model Selection Service - Saves 30-50% on AI costs
- β Function Calling - Reduces token usage
- β Semantic Caching - Avoids duplicate AI queries
Recommended Actionsβ
-
AI Cost Optimization:
- Implement rate limiting per user (e.g., 10 AI interactions/day free, then paid)
- Add usage quotas for premium features
- Cache common queries/responses
- Consider batch processing for non-real-time tasks
-
Firestore Optimization:
- Implement data archival for cases older than 1 year
- Use composite indexes efficiently
- Batch operations where possible
- Consider read replicas for heavy read workloads
-
App Hosting Optimization:
- Right-size min instances based on actual traffic patterns
- Implement CDN caching for static assets
- Optimize bundle sizes to reduce cold start times
- Use regional deployments to reduce latency
-
Storage Optimization:
- Implement image compression/optimization
- Use CDN for frequently accessed images
- Archive old images to cheaper storage tiers
- Implement lazy loading for images
-
Email Optimization:
- Batch notifications where possible
- Implement email preferences (reduce unnecessary emails)
- Use transactional email templates efficiently
π Growth Scenariosβ
Conservative Growth (Year 1)β
- Month 1-3: 1,000 users β $1,191/month
- Month 4-6: 5,000 users β $5,021/month
- Month 7-9: 10,000 users β $9,950/month
- Month 10-12: 15,000 users β ~$14,000/month
Year 1 Total: ~$90,000
Moderate Growth (Year 1)β
- Month 1-2: 1,000 users β $1,191/month
- Month 3-4: 5,000 users β $5,021/month
- Month 5-6: 10,000 users β $9,950/month
- Month 7-8: 25,000 users β $24,945/month
- Month 9-12: 50,000 users β $49,920/month
Year 1 Total: ~$240,000
Aggressive Growth (Year 1)β
- Month 1: 1,000 users β $1,191/month
- Month 2-3: 5,000 users β $5,021/month
- Month 4-5: 10,000 users β $9,950/month
- Month 6-7: 25,000 users β $24,945/month
- Month 8-9: 50,000 users β $49,920/month
- Month 10-12: 100,000 users β $101,870/month
Year 1 Total: ~$600,000
β οΈ Cost Risk Factorsβ
High Risk:β
- AI Usage Spikes - Viral content could cause 10x AI usage
- Storage Growth - Image-heavy cases could exceed estimates
- Database Scaling - Complex queries could increase Firestore costs
Medium Risk:β
- Traffic Spikes - Marketing campaigns could spike App Hosting costs
- Email Volume - Notification preferences could increase email costs
Mitigation:β
- Set up billing alerts at 50%, 75%, 90%, 100% of budget
- Implement usage quotas and rate limiting
- Monitor costs daily during launch period
- Have cost optimization plan ready
π Monitoring & Alertsβ
Recommended Billing Alerts:β
- Daily Budget: Set at 1/30th of monthly budget
- Weekly Budget: Set at 1/4th of monthly budget
- Monthly Budget: Set based on user growth projections
Key Metrics to Track:β
- AI token usage (input/output split)
- Firestore read/write operations
- App Hosting instance hours
- Storage growth rate
- Email send volume
- Error rate (Sentry events)
π Review Scheduleβ
- Weekly: Review cost trends and anomalies
- Monthly: Compare actual vs projected costs
- Quarterly: Update projections based on actual growth
- Annually: Comprehensive cost optimization review
π Support & Questionsβ
For questions about cost projections:
- Technical Issues: Review Firebase/Google Cloud billing console
- Optimization Ideas: Review this document's optimization strategies
- Budget Planning: Use growth scenarios as starting point
Last Updated: January 2025
Next Review: Quarterly
Status: π Active Monitoring