| def init_chute(username: str, name: str) -> Chute: | |
| image = ( | |
| ChutesImage( | |
| username=username, | |
| name=name, | |
| tag="latest", | |
| ) | |
| .from_base("parachutes/python:3.12") | |
| .run_command("pip install --upgrade setuptools wheel") | |
| .run_command( | |
| "pip install huggingface_hub==0.19.4") | |
| .run_command( | |
| # RAG-specific dependencies | |
| # Note: faiss-cpu 1.8.0+ supports Python 3.12 | |
| "pip install sentence-transformers==2.2.2 faiss-cpu pydantic chutes==0.3.61" | |
| ) | |
| .set_workdir("/app") | |
| ) | |
| node_selector = NodeSelector( | |
| gpu_count=1, | |
| min_vram_gb_per_gpu=16, # RAG uses less GPU than transformers | |
| ) | |
| return Chute( | |
| username=username, | |
| name=name, | |
| image=image, | |
| node_selector=node_selector, | |
| concurrency=4, | |
| timeout_seconds=300, | |
| shutdown_after_seconds=36000, # 10 hours - prevents cooldowns during testing | |
| ) | |