Intelligent 4-agent pipeline for production-ready 3D model generation.
User Request
↓
[1] Prompt Enhancement Agent (Gemini)
↓
[2] Generation Coordinator Agent → GPU Service
↓
[3] Quality Assurance Agent (Gemini + Rules)
↓
[4] Enhancement Agent (Gemini) [if needed]
↓
Production-Ready 3D Model
- Optimizes user prompts for 3D generation
- Adds materials, details, rendering hints
- Uses Gemini for intelligent enhancement
- Communicates with GPU service
- Handles retries and errors
- Returns model URLs and statistics
- Analyzes mesh topology and statistics
- Uses Gemini for intelligent QA
- Assigns quality scores (0-10)
- Determines production-readiness
- Proposes improvements for failed models
- Suggests parameter adjustments
- Recommends post-processing steps
Main endpoint - executes complete pipeline
Request:
{
"prompt": "a medieval sword",
"num_inference_steps": 75,
"guidance_scale": 4.0
}Response:
{
"pipeline_id": "20250109_120000",
"status": "success",
"user_prompt": "a medieval sword",
"enhanced_prompt": "A medieval longsword with steel blade...",
"model_urls": {
"glb": "https://...",
"obj": "https://...",
"stl": "https://..."
},
"quality_score": 8.5,
"is_production_ready": true,
"stages": { /* all agent outputs */ }
}Health check for service and all agents
Test prompt enhancement only (no generation)
This service uses Cloud Run IAM authentication when calling the GPU service:
- Automatically obtains identity tokens via metadata server
- GPU service only accepts requests with valid service account credentials
- Prevents unauthorized access to expensive GPU operations
# Install dependencies
pip install -r requirements.txt
# Set environment variables
export GOOGLE_API_KEY=your-key
export GPU_SERVICE_URL=https://your-gpu-service-url
# Run server
python main.py
# Test
python test_local.py# Set environment
export GOOGLE_API_KEY=your-key
export GPU_SERVICE_URL=https://your-gpu-service-url
export PROJECT_ID=your-project
export BUCKET_NAME=your-bucket
# Deploy
./deploy.shGOOGLE_API_KEY- Gemini API key (required)GPU_SERVICE_URL- GPU service URL from Phase 2 (required)PROJECT_ID- GCP project IDBUCKET_NAME- Cloud Storage bucketREGION- GCP region (default: europe-west1)GEMINI_MODEL- Gemini model (default: gemini-2.0-flash-exp)