AI-powered resume and cover letter generation API optimized for high-concurrency deployment.
This microservice provides a JSON-only API that takes job descriptions and user data as input, and returns:
- Structured job analysis
- Tailored resume (JSON format)
- Customized cover letter text
No PDF generation. No Google Drive integration. Pure JSON I/O.
build/
├── api.py # FastAPI application entry point
├── orchestrator.py # Async pipeline orchestration
├── modules/ # Core processing modules
│ ├── structuring/ # Job description analysis
│ ├── enhancing/ # Resume enhancement (coordinator, bullets, profile, skills)
│ └── cover_letter/ # Cover letter generation
├── deployment/ # Deployment files
│ ├── Dockerfile
│ ├── .dockerignore
│ ├── deploy_cloudrun.sh
│ └── deploy_cloudrun.ps1
└── requirements.txt # Python dependencies
- High Concurrency: 4 Uvicorn workers, 100 concurrent requests per instance
- Async Pipeline: Maximized parallelization (3 parallel bullet generations)
- Auto-scaling: 1-3 instances on Cloud Run (300 max concurrent users)
- JSON Output: Resume and cover letter returned as structured JSON
- Multi-language: Supports English and French job descriptions
- ATS Optimized: Keyword matching and scoring for applicant tracking systems
Main endpoint - Full pipeline processing with dynamic experience configuration
Request:
{
"job_text": "Job description text here...",
"user_json": {
"personal": { "name": "John Doe", "title": "Software Engineer" },
"contact": { "email": "john@example.com", "phone": "+33..." },
"projects_database": {
"Project A": { "contexte": "...", "technologies": [...], "metiers": [...], "realisations": [...] },
"Project B": { "..." },
"Project C": { "..." }
},
"skills_database": { "skills": {...}, "essential_skills": [...] },
"experiences_config": [
{
"candidate_projects": [0, 1],
"role_strategy": "enhanced",
"content_strategy": "enhanced"
},
{
"candidate_projects": [1, 2],
"role_strategy": "enhanced",
"content_strategy": "direct"
},
{
"candidate_projects": [2],
"role_strategy": "direct",
"content_strategy": "direct"
}
],
"education": [...],
"languages": [...]
},
"config_json": { /* configuration */ }
}Experience Configuration Options:
candidate_projects: List of project indexes (0-based) referencing projects_database orderrole_strategy:"direct"- Use role title exactly as-is from project"enhanced"- Adapt role title for ATS optimization
content_strategy:"direct"- Use bullet points directly from project (no AI enhancement)"enhanced"- Generate AI-enhanced bullet points for job fit
Response:
{
"success": true,
"structured_job": { /* analyzed job data */ },
"resume": {
"personal": { "name": "...", "title": "..." },
"contact": { "email": "...", "phone": "..." },
"profile": "Professional summary text...",
"experience": [
{
"role": "Software Engineer",
"company": "Company Name",
"location": "Paris, France",
"start_date": "2023-01",
"end_date": "2024-12",
"bullets": ["Bullet 1", "Bullet 2", "..."],
"is_direct": false
}
],
"skills": {
"technical": ["Python", "FastAPI", "..."],
"soft": ["Leadership", "Communication", "..."]
},
"education": [...],
"certifications": [...],
"languages": [...]
},
"cover_letter": "Cover letter text...",
"metadata": {
"processing_time_seconds": 12.5,
"language": "en",
"experiences": {
"total": 3,
"enhanced": 2,
"direct": 1,
"projects_used": ["Project A", "Project B", "Project C"]
},
"average_ats_score": 85.3
}
}Job description structuring only
Health check endpoint
Service information
- Python 3.13+
- OpenAI API key
# Install dependencies
pip install -r requirements.txt
# Set environment variables
export OPENAI_API_KEY="your-openai-key"
export API_SECRET_KEY="your-secret-key"
# Run locally
python api.pyAPI will be available at:
- API: http://localhost:8080
- Docs: http://localhost:8080/docs
- Google Cloud SDK installed and configured
- Docker Desktop installed
- Environment variables set:
OPENAI_API_KEYAPI_SECRET_KEY
cd deployment
.\deploy_cloudrun.ps1cd deployment
./deploy_cloudrun.sh# Build Docker image locally
docker build -f deployment/Dockerfile -t gcr.io/castal-job-tracker/resume-processor .
# Configure Docker auth
gcloud auth configure-docker gcr.io
# Push image
docker push gcr.io/castal-job-tracker/resume-processor
# Deploy to Cloud Run
gcloud run deploy resume-processor \
--image gcr.io/castal-job-tracker/resume-processor \
--region europe-west9 \
--memory 8Gi \
--cpu 4 \
--timeout 600 \
--concurrency 100 \
--min-instances 1 \
--max-instances 3 \
--set-env-vars "OPENAI_API_KEY=${OPENAI_API_KEY},API_SECRET_KEY=${API_SECRET_KEY},WORKERS=4" \
--allow-unauthenticated- Workers per instance: 4
- Requests per instance: 100
- Min instances: 1 (always warm, no cold starts)
- Max instances: 3 (budget constraint: <$100/month)
- Total capacity: 300 concurrent users
- Baseline: ~$40/month (1 instance always running)
- Typical: ~$60-80/month (1-2 instances average)
- Maximum: ~$120/month (3 instances 24/7)
# Health check
curl https://your-service-url.run.app/health
# Full pipeline test
curl -X POST "https://your-service-url.run.app/process" \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d @test_request.jsonExpected metrics:
- Processing time: 10-20s per request
- Success rate: >95%
- Median latency: <30s
- Throughput: ~5-10 req/s (with auto-scaling)
- API key authentication required (Bearer token)
- Secrets passed via environment variables (never in code)
- No file storage (stateless service)
- HTTPS only (enforced by Cloud Run)
View logs and metrics:
# Logs
gcloud run services logs tail resume-processor --region europe-west9
# Metrics dashboard
https://console.cloud.google.com/run/detail/europe-west9/resume-processor/metrics- Check OpenAI API response times
- Verify worker count is appropriate
- Check instance memory usage
- Increase
max-instancesif needed - Check OpenAI API quotas
- Reduce concurrency per instance
- Increase memory allocation
For issues or questions, refer to the main project documentation.
v3.0.0 - Dynamic Experience Configuration (January 2025)
- Dynamic number of experiences (not limited to 3)
- Per-experience project candidate pools
- Direct vs Enhanced content strategies
- Direct vs Enhanced role strategies
- Intelligent coordinator that respects constraints