Why Gemini?
- Free tier - Generous limits for developers at no cost
- Fast - Quick response times for rapid analysis
- High quality - Excellent code understanding capabilities
- No credit card required - Start analyzing immediately
Get an API key
Visit Google AI Studio
Go to aistudio.google.com and sign in with your Google account.
No credit card is required for the free tier. You can start using Gemini immediately.
Setup
Option 1: Environment variable (recommended)
Set the environment variable in your shell:Option 2: Alternative environment variable
You can also use the shorterGEMINI_API_KEY variable:
Option 3: .env file
Create a.env file in your project directory:
.env
Option 4: Configuration file
Create avibrant.config.js file:
vibrant.config.js
Usage
Run Vibrant with Gemini:Available models
Vibrant uses gemini-2.0-flash-lite by default for optimal speed and quality.gemini-2.0-flash-lite (default)
gemini-2.0-flash-lite (default)
- Context: 1M tokens
- Cost: Free tier available
- Speed: Very fast
- Quality: Excellent for code analysis
- Best for: Daily development, CI/CD pipelines
- Free tier: 15 RPM, 1M TPM, 1500 RPD
gemini-1.5-flash
gemini-1.5-flash
- Context: 1M tokens
- Cost: Free tier available
- Speed: Very fast
- Quality: High performance
- Best for: Fast analysis of large codebases
- Free tier: 15 RPM, 1M TPM, 1500 RPD
gemini-1.5-pro
gemini-1.5-pro
- Context: 2M tokens
- Cost: Free tier available
- Speed: Fast
- Quality: Superior reasoning
- Best for: Complex analysis, large projects
- Free tier: 2 RPM, 32K TPM, 50 RPD
RPM = Requests per minute, TPM = Tokens per minute, RPD = Requests per day
Change the model
Set theGEMINI_MODEL environment variable:
.env file:
.env
Free tier limits
| Model | Requests/min | Tokens/min | Requests/day |
|---|---|---|---|
| gemini-2.0-flash-lite | 15 | 1M | 1500 |
| gemini-1.5-flash | 15 | 1M | 1500 |
| gemini-1.5-pro | 2 | 32K | 50 |
- Regular development workflows
- Small to medium team usage
- CI/CD pipeline integration
- Learning and experimentation
If you need higher limits, you can enable billing in Google Cloud Console. Pay-as-you-go pricing is very affordable.
Example output
Troubleshooting
Error: API key not found
GOOGLE_GENERATIVE_AI_API_KEY or GEMINI_API_KEY environment variable:
Error: Quota exceeded
- Wait and retry: Free tier resets per minute/day. Wait a few minutes.
- Use Ollama: Switch to local models:
vibrant . --ai --provider ollama - Use OpenRouter: Try free models:
vibrant . --ai --provider openrouter - Enable billing: Add payment method for higher limits (very affordable)
Error: Resource exhausted
Best practices
Use for daily development
Geminiโs free tier is perfect for frequent code analysis during development.
Enable billing for teams
If multiple team members are using the same API key, consider enabling pay-as-you-go billing.
CI/CD integration
For GitHub Actions:.github/workflows/code-quality.yml
Add
GOOGLE_GENERATIVE_AI_API_KEY as a secret in your repository settings.Paid tier (optional)
If you need higher limits, enable billing:Enable billing
Visit Google Cloud Console and add a payment method.
Very affordable pricing
- gemini-2.0-flash-lite: ~$0.01 per 1M tokens
- gemini-1.5-flash: ~$0.04 per 1M tokens
- gemini-1.5-pro: ~$1.25 per 1M tokens
Next steps
AI providers overview
Compare all available providers
Ollama setup
Try local models for unlimited free usage