A FastAPI-based backend service for generating project details and talent requirements using Groq LLM.
- Project details generation using Groq LLM
- Secure encryption for prompt templates
- Rate limiting for API endpoints
- CORS middleware support
- Docker containerization
- Health check monitoring
- FastAPI - Modern web framework for building APIs
- Groq - LLM provider for natural language processing
- Pydantic - Data validation using Python type annotations
- Cryptography - Secure encryption handling
- Docker - Containerization
- Uvicorn - ASGI server implementation
- Python 3.8+
- Docker and Docker Compose (optional)
- Groq API key
Create a .env
file with the following variables:
SERVER_HOST=0.0.0.0
SERVER_PORT=8000
DEBUG=false
GROQ_API_KEY=your_groq_api_key
GROQ_MODEL_NAME=mixtral-8x7b-32768
GROQ_MODEL_PARSER=mixtral-8x7b-32768
GROQ_TEMPERATURE=0.5
ENCRYPTION_KEY=your_encryption_key
- Create virtual environment:
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
- Install dependencies:
pip install -r requirements.txt
- Run the application:
python app.py
docker-compose up -d
Method | Endpoint | Description |
---|---|---|
GET | /api/v1/health |
Check if service is running |
POST | /api/v1/generate |
Generate project details and talent requirements |
{
"project_name": "E-Commerce Platform Revamp 2024",
"project_description": "Complete overhaul of existing e-commerce platform...",
"project_duration": "...",
"project_budget": 0,
"talents_required": [
{
"job_title": "...",
"budget_allocation": 0,
"scope_of_work": "...",
"url_redirect": "..."
}
]
}
- PBKDF2 key derivation for secure encryption
- Rate limiting (10 requests per minute)
- CORS protection
- Environment variable configuration
The application includes Docker support with:
- Multi-stage builds
- Volume mounting for development
- Health check monitoring
- Automatic restart policy
- Environment variable configuration
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
The API implements rate limiting of 10 requests per minute per IP address to prevent abuse.
For support, please open an issue in the GitHub repository.