SmartResume AI now supports two AI providers:
- Google Gemini (Primary, recommended)
- OpenRouter (Alternative, includes free models)
- Free Models Available: Access to Google Gemma and other free models
- No Credit Card Required: Get started immediately
- Fallback Option: Works if Gemini quota is exceeded
- Multiple Models: Switch between different AI models
- Visit https://openrouter.ai/keys
- Sign up or log in
- Click "Create Key"
- Copy your API key
Add these lines to your .env file:
# OpenRouter API Configuration
OPENROUTER_API_KEY=your_api_key_here
OPENROUTER_SITE_URL=http://localhost:8503
OPENROUTER_SITE_NAME=SmartResume AIEdit utils/openrouter_client.py and change the model:
# Free models available:
self.model = "google/gemma-2-9b-it:free" # Fast, free (recommended)
# self.model = "meta-llama/llama-3.2-3b-instruct:free" # Alternative free model
# self.model = "nousresearch/hermes-3-llama-3.1-405b:free" # Larger free model
# Paid models (better quality):
# self.model = "google/gemini-pro"
# self.model = "anthropic/claude-3.5-sonnet"
# self.model = "openai/gpt-4-turbo"The app automatically:
- Tries to use Gemini first (if API key exists)
- Falls back to OpenRouter if Gemini fails
- Shows which provider is active in the UI
OpenRouter free models have limits:
- Gemma 2 9B: Unlimited requests, rate limited
- Llama 3.2: Unlimited requests, rate limited
- No credit card required
The OpenRouter client uses the same interface as Gemini:
from utils.ai_client import AIClient
client = AIClient() # Automatically picks Gemini or OpenRouter
response = client.generate_content("Write a professional summary...")All SmartResume AI features work with OpenRouter:
- ✅ Professional Summary Generation
- ✅ Experience Bullet Points
- ✅ Project Descriptions
- ✅ Skills Suggestions
- ✅ Cover Letter Generation
- ✅ Resume Quality Analysis
Error: "No AI API keys found"
- Add either
GEMINI_API_KEYorOPENROUTER_API_KEYto.env
Error: "Rate limit exceeded"
- Wait a few seconds and try again
- Free models have rate limits
Error: "Invalid API key"
- Check your API key is correct in
.env - Make sure you copied the full key
| Provider | Model | Cost | Speed | Quality |
|---|---|---|---|---|
| Gemini | gemini-2.5-flash | Free* | Fast | Excellent |
| OpenRouter | gemma-2-9b-it:free | Free | Fast | Good |
| OpenRouter | llama-3.2-3b:free | Free | Fast | Good |
| OpenRouter | gemini-pro | Paid | Fast | Excellent |
*Gemini has free tier with daily limits
For best experience:
- Use Gemini as primary (faster, better quality)
- Add OpenRouter as backup (free, no quota issues)
- Configure both API keys in
.env
The app will automatically use the best available option!