Gemini Agent
Gemini is Google's AI model, offering fast responses and a generous free tier.
Overview
Gemini provides:
- Speed - Fast response times
- Free tier - Great for getting started
- Efficiency - Good quality at lower cost
- Multimodal - Can understand images
When to Use Gemini
Ideal For
- ✅ Quick prototypes
- ✅ Simple bug fixes
- ✅ Documentation tasks
- ✅ Cost-conscious projects
- ✅ High-volume tasks
Less Ideal For
- ⚠️ Complex multi-file changes
- ⚠️ Security-critical code
- ⚠️ Nuanced business logic
Setup
API Key
- Go to Google AI Studio
- Click "Get API key"
- Create new key or use existing
export GEMINI_API_KEY="your-gemini-api-key"
Configuration
{
"agents": {
"gemini": {
"enabled": true,
"model": "gemini-2.5-pro",
"autonomy": "workspace-write"
}
}
}
Model Options
| Model | Speed | Quality | Cost |
|---|---|---|---|
gemini-2.5-flash | Fastest | Good | Free |
gemini-2.5-pro | Fast | Better | $ |
gemini-2.0-flash-exp | Fast | Good | Free |
Free Tier
Gemini offers a generous free tier:
- 60 requests/minute (Gemini 1.5 Flash)
- 2 requests/minute (Gemini 1.5 Pro)
- No credit card required
Perfect for:
- Learning Friday Dev
- Personal projects
- Side projects
Usage
From UI
- Open task
- Click "Run Agent"
- Select "Gemini"
- Start
From CLI
# Use default Gemini model
friday-dev run --task 123 --agent gemini
# Use specific model
friday-dev run --task 123 --agent gemini --model gemini-2.5-flash
Comparison
| Feature | Gemini | Claude | Friday |
|---|---|---|---|
| Speed | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ |
| Quality | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| Cost | Free/$ | $$$ | $$$ |
| Autonomy | Medium | Low | High |
Best Practices
Task Descriptions
Gemini works well with direct instructions:
## Task
Add a loading spinner to the login button
## Instructions
1. Import Spinner from @/components/ui
2. Add isLoading state to LoginForm
3. Show spinner when isLoading is true
4. Disable button while loading
Keep It Simple
Gemini excels at focused tasks:
# Good - Single focus
Fix the TypeScript error in src/utils/date.ts line 45
# Less Good - Multiple concerns
Fix all TypeScript errors, add tests, and improve performance
Example Output
Quick Bug Fix
Task: "Fix the off-by-one error in pagination"
// Before
const startIndex = page * pageSize;
const endIndex = startIndex + pageSize;
// After - Fixed off-by-one
const startIndex = (page - 1) * pageSize; // Changed
const endIndex = startIndex + pageSize;
Documentation
Task: "Add JSDoc to the formatDate function"
/**
* Formats a date into a human-readable string.
*
* @param date - The date to format (Date object or ISO string)
* @param format - Output format ('short' | 'long' | 'relative')
* @returns Formatted date string
*
* @example
* formatDate(new Date(), 'short') // "Jan 15"
* formatDate(new Date(), 'long') // "January 15, 2024"
* formatDate(new Date(), 'relative') // "2 hours ago"
*/
export function formatDate(
date: Date | string,
format: 'short' | 'long' | 'relative' = 'short'
): string {
// ... implementation
}
Rate Limits
Free Tier Limits
| Model | Requests/Min | Tokens/Min |
|---|---|---|
| Flash | 60 | 1M |
| Pro | 2 | 32K |
Handling Limits
{
"agents": {
"gemini": {
"retryOnRateLimit": true,
"retryDelay": 60000
}
}
}
Pricing
Free Tier (Recommended Start)
- No cost
- No credit card
- Perfect for learning
Paid Tier
When you need more:
- Higher rate limits
- Priority access
- See Google AI pricing
Troubleshooting
Rate Limit Errors
Error: 429 Too Many Requests
Solutions:
- Wait 60 seconds
- Use Gemini Flash (higher limits)
- Upgrade to paid tier
- Switch to another agent
Quality Issues
If output quality is low:
- Add more detail to task
- Use Gemini Pro instead of Flash
- Switch to Claude/Friday for complex tasks
API Key Issues
- Verify key at aistudio.google.com
- Check key permissions
- Regenerate key if needed
Next Steps
- Claude - Higher quality alternative
- Friday Agent - More autonomous option
- AI Agents Overview - Compare all agents