Spaces:
Sleeping
Sleeping
| # All possible @app.function() parameters | |
| @app.function( | |
| # Resource Configuration | |
| cpu=float, # CPU cores (e.g., 4.0) | |
| cpu=(float, float), # (request, limit) tuple | |
| memory=int, # Memory in MB | |
| memory=(int, int), # (request, limit) tuple | |
| gpu="T4" | "L4" | "A10G" | "A100-40GB" | "A100-80GB" | "L40S" | "H100" | "H200" | "B200", | |
| gpu="GPU_TYPE:count", # Multiple GPUs | |
| gpu=["GPU_TYPE", "GPU_TYPE:count"], # GPU fallback list | |
| ephemeral_disk=int, # Ephemeral disk in MB | |
| # Container Configuration | |
| image=modal.Image, # Container image | |
| secrets=[modal.Secret], # List of secrets | |
| volumes={"/path": modal.Volume}, # Volume mounts | |
| cloud_bucket_mounts={}, # Cloud storage mounts | |
| # Networking & Concurrency | |
| allow_concurrent_inputs=int, # Concurrent requests per container | |
| concurrency_limit=int, # Max concurrent containers | |
| container_idle_timeout=int, # Idle timeout in seconds | |
| timeout=int, # Function timeout in seconds | |
| # Scheduling & Retry | |
| schedule=modal.Cron | modal.Period, # Scheduling | |
| retries=int, # Retry attempts | |
| retry=modal.Retry, # Custom retry policy | |
| # Environment & Runtime | |
| environment=dict, # Environment variables | |
| keep_warm=int, # Warm containers count | |
| architecture="x86_64" | "arm64", # CPU architecture | |
| cloud="aws" | "gcp", # Cloud provider | |
| # Batch Processing | |
| batch_max_size=int, # Max batch size | |
| # Metadata | |
| name=str, # Function name | |
| is_generator=bool, # Generator function flag | |
| ) |