Spaces:
Running
Running
Create modal_params.txt
Browse files- modal_params.txt +42 -0
modal_params.txt
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# All possible @app.function() parameters
|
| 2 |
+
@app.function(
|
| 3 |
+
# Resource Configuration
|
| 4 |
+
cpu=float, # CPU cores (e.g., 4.0)
|
| 5 |
+
cpu=(float, float), # (request, limit) tuple
|
| 6 |
+
memory=int, # Memory in MB
|
| 7 |
+
memory=(int, int), # (request, limit) tuple
|
| 8 |
+
gpu="T4" | "L4" | "A10G" | "A100-40GB" | "A100-80GB" | "L40S" | "H100" | "H200" | "B200",
|
| 9 |
+
gpu="GPU_TYPE:count", # Multiple GPUs
|
| 10 |
+
gpu=["GPU_TYPE", "GPU_TYPE:count"], # GPU fallback list
|
| 11 |
+
ephemeral_disk=int, # Ephemeral disk in MB
|
| 12 |
+
|
| 13 |
+
# Container Configuration
|
| 14 |
+
image=modal.Image, # Container image
|
| 15 |
+
secrets=[modal.Secret], # List of secrets
|
| 16 |
+
volumes={"/path": modal.Volume}, # Volume mounts
|
| 17 |
+
cloud_bucket_mounts={}, # Cloud storage mounts
|
| 18 |
+
|
| 19 |
+
# Networking & Concurrency
|
| 20 |
+
allow_concurrent_inputs=int, # Concurrent requests per container
|
| 21 |
+
concurrency_limit=int, # Max concurrent containers
|
| 22 |
+
container_idle_timeout=int, # Idle timeout in seconds
|
| 23 |
+
timeout=int, # Function timeout in seconds
|
| 24 |
+
|
| 25 |
+
# Scheduling & Retry
|
| 26 |
+
schedule=modal.Cron | modal.Period, # Scheduling
|
| 27 |
+
retries=int, # Retry attempts
|
| 28 |
+
retry=modal.Retry, # Custom retry policy
|
| 29 |
+
|
| 30 |
+
# Environment & Runtime
|
| 31 |
+
environment=dict, # Environment variables
|
| 32 |
+
keep_warm=int, # Warm containers count
|
| 33 |
+
architecture="x86_64" | "arm64", # CPU architecture
|
| 34 |
+
cloud="aws" | "gcp", # Cloud provider
|
| 35 |
+
|
| 36 |
+
# Batch Processing
|
| 37 |
+
batch_max_size=int, # Max batch size
|
| 38 |
+
|
| 39 |
+
# Metadata
|
| 40 |
+
name=str, # Function name
|
| 41 |
+
is_generator=bool, # Generator function flag
|
| 42 |
+
)
|