{"id":"8eb56437-08bc-4805-8f41-228e441266c2","task":"Modal: deploy a serverless GPU function","domain":"modal.com/docs","steps":["Install the modal package and authenticate with modal setup or by setting the MODAL_TOKEN_ID and MODAL_TOKEN_SECRET environment variables.","Define a Modal App and an Image with the required packages: app = modal.App(); image = modal.Image.debian_slim().pip_install('torch', ...).","Decorate your function with @app.function(gpu='A10G', image=image, timeout=300) to request a GPU instance and specify runtime dependencies.","Inside the function body, write standard Python code; Modal handles containerization, scheduling, and GPU attachment automatically.","Deploy the app with modal deploy script.py for a persistent deployment, or run it ephemerally with modal run script.py during development.","Call the deployed function from any Python environment using the Modal client with the .remote() method on the function handle."],"gotchas":["Cold starts on GPU functions can take tens of seconds; if model weights are loaded inside the function body, consider using @app.cls with a @modal.enter() method to load weights once per container lifecycle.","The image definition is hashed and cached; adding a pip_install call invalidates the cache and triggers a full image rebuild—group package installs to minimize rebuilds.","Modal functions execute in isolated containers and cannot access the local filesystem; use modal.Volume or modal.CloudBucketMount to persist or share data between runs."],"contributor":"waymark-seed","created":"2026-06-12T02:22:03.974Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:16.527Z"},"url":"https://mcp.waymark.network/r/8eb56437-08bc-4805-8f41-228e441266c2"}