{"id":48,"library":"modal","title":"Modal","description":"Serverless cloud infrastructure for AI workloads. Run Python functions on GPUs with sub-second cold starts. v1.0 released May 2025 with multiple breaking API changes. Rapid release cadence — multiple versions per week.","status":"active","version":"1.3.3","language":"python","source_language":"en","source_url":"https://github.com/modal-labs/modal-client","tags":["serverless","gpu","cloud","agents","python","inference","deployment"],"install":[{"cmd":"pip install modal","lang":"bash","label":"Python"},{"cmd":"modal setup","lang":"bash","label":"CLI authentication (run after install)"}],"dependencies":[{"reason":"Async HTTP transport used internally.","package":"aiohttp","optional":false},{"reason":"gRPC communication with Modal backend.","package":"grpclib","optional":false},{"reason":"Modal's own library for bridging sync/async. Installed automatically.","package":"synchronicity","optional":false},{"reason":"Required when using modal.fastapi_endpoint decorator for web endpoints.","package":"fastapi","optional":true}],"imports":[{"note":"modal.Stub was renamed to modal.App in v0.x. All tutorials using Stub() are outdated and will raise AttributeError.","wrong":"import modal\nstub = modal.Stub()","symbol":"App","correct":"import modal\napp = modal.App()"},{"note":"modal.web_endpoint renamed to modal.fastapi_endpoint in v0.73.89 / v1.0. Old decorator still works but is deprecated.","wrong":"@modal.web_endpoint()","symbol":"fastapi_endpoint","correct":"@modal.fastapi_endpoint()"},{"note":"allow_concurrent_inputs parameter replaced by @modal.concurrent decorator in v1.0.","wrong":"@app.function(allow_concurrent_inputs=10)","symbol":"concurrent","correct":"@modal.concurrent(max_inputs=10)"}],"quickstart":{"code":"import modal\n\napp = modal.App()\n\n@app.function(\n    gpu=\"A10G\",\n    image=modal.Image.debian_slim().pip_install(\"torch\")\n)\ndef run_inference(prompt: str) -> str:\n    import torch\n    # your model code here\n    return \"result\"\n\n@app.local_entrypoint()\ndef main():\n    result = run_inference.remote(\"hello\")\n    print(result)","lang":"python","description":"Deploy a GPU function to Modal. Run with: modal run script.py"},"warnings":[{"fix":"Replace all modal.Stub() with modal.App().","message":"modal.Stub renamed to modal.App. Any code using modal.Stub() raises AttributeError on current versions.","severity":"breaking","affected_versions":"< 0.55.0"},{"fix":"Use Image.add_local_file() or Image.add_local_dir() instead of modal.Mount.","message":"modal.Mount removed from public API in v1.0. Passing mount= to @app.function or @app.cls raises TypeError.","severity":"breaking","affected_versions":"< 1.0.0"},{"fix":"Explicitly add local dependencies with Image.add_local_python_source('your_module').","message":"Automounting of local Python modules removed in v1.0. Remote containers no longer automatically include local imports.","severity":"breaking","affected_versions":"< 1.0.0"},{"fix":"Find-and-replace all three parameter names in function decorators.","message":"Autoscaler parameters renamed in v1.0: keep_warm → min_containers, concurrency_limit → max_containers, container_idle_timeout → scaledown_window.","severity":"breaking","affected_versions":"< 0.73.76"},{"fix":"Use modal.Volume to store model weights instead. Mount the Volume to the framework's cache directory.","message":"@modal.build decorator deprecated in v1.0. Using it for model weight downloads is no longer the recommended pattern.","severity":"breaking","affected_versions":"< 1.0.0"},{"fix":"Use Image.add_local_dir() / Image.add_local_file(). Pass copy=True if subsequent build steps need the files.","message":"Image.copy_local_dir and Image.copy_local_file deprecated. Replaced by Image.add_local_dir and Image.add_local_file.","severity":"deprecated","affected_versions":"< 0.72.11"},{"fix":"Replace @modal.web_endpoint() with @modal.fastapi_endpoint().","message":"modal.web_endpoint renamed to modal.fastapi_endpoint. Old name still works but will be removed in a future v1.x release.","severity":"deprecated","affected_versions":"< 0.73.89"},{"fix":"Pin to a stable release in production: pip install modal==1.3.3. Avoid pip install modal --pre in automated environments.","message":"Modal releases multiple versions per week including pre-release .devN builds. Unpinned installs in CI can pick up pre-release versions unexpectedly.","severity":"gotcha","affected_versions":"all"},{"fix":"Do not use modal.Dict for persistent storage. Use modal.Volume for data that must survive beyond 7 days of inactivity.","message":"modal.Dict values expire after 7 days of inactivity on the new backend (introduced May 2025). Previously created Dicts use the old backend with no expiry.","severity":"gotcha","affected_versions":">= 0.75.0"},{"fix":"It is recommended to use a virtual environment for pip operations or run pip as a non-root user. To update pip, run 'pip install --upgrade pip'.","message":"Pip output includes warnings about running as a root user and an available update. Running pip as root can lead to permission issues and conflicting behavior with the system package manager.","severity":"gotcha","affected_versions":"all"}],"env_vars":{"optional":[{"name":"MODAL_ENVIRONMENT","note":"Target a specific Modal environment (e.g. dev, prod). Defaults to main."}],"required":[{"name":"MODAL_TOKEN_ID","note":"Set automatically by modal setup CLI. Required for programmatic auth."},{"name":"MODAL_TOKEN_SECRET","note":"Set automatically by modal setup CLI. Required for programmatic auth."}]},"last_verified":"2026-05-12T05:53:07.888Z","next_check":"2026-04-01T00:00:00.000Z","problems":[{"fix":"Use `python -m modal` instead of `modal` for CLI commands, or reconfigure your system's environment variables to include the Python package executables in your PATH.","cause":"The Modal CLI executable is not in your system's PATH environment variable, meaning the shell cannot locate the command.","error":"modal: command not found"},{"fix":"Replace all instances of `modal.Stub()` with `modal.App()` in your code.","cause":"The `modal.Stub` class was renamed to `modal.App` in Modal v1.0, and directly referencing `modal.Stub` or its methods will now raise an AttributeError.","error":"AttributeError: type object 'Stub' has no attribute 'function'"},{"fix":"Ensure you are importing the correct library as `import modal` (for Modal Labs) and not `from modAL.models import ActiveLearner` or similar, which belongs to the `modAL` library. If you intend to use Modal Labs, ensure you have installed `modal-client` (or `modal`) and not `modAL-python`.","cause":"This error often occurs when developers confuse the `modal-client` library (used for serverless cloud functions) with a different, similarly named active learning library called `modAL`.","error":"ModuleNotFoundError: No module named 'modAL'"},{"fix":"Add your local Python package to your Modal image using `image.add_local_python_package('your_local_package_path')` or `image.add_local_python_source('your_local_source_directory')`.","cause":"Prior to Modal v1.0, local Python packages were 'automounted'. In v1.0 and later, local dependencies must be explicitly included in your Modal image definition.","error":"ModuleNotFoundError: No module named 'your_local_package'"},{"fix":"While Modal is investigating a root cause fix, you can try re-running your job, as this might be a transient issue. Ensure your Modal Image has the necessary CUDA versions and drivers if you are building a custom image.","cause":"This error indicates an issue with the NVIDIA CUDA driver initialization on the GPU instance, which can be a flaky issue with certain L4 GPU types within Modal's fleet.","error":"RuntimeError: CUDA driver initialization failed, you might not have a CUDA gpu."}],"ecosystem":"pypi","meta_description":null,"install_score":95,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.5,"mem_mb":28.9,"disk_size":"55.8M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.08,"mem_mb":17,"disk_size":"58M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.75,"mem_mb":30.6,"disk_size":"61.8M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.84,"mem_mb":19.4,"disk_size":"64M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.54,"mem_mb":29.9,"disk_size":"53.2M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.98,"mem_mb":18.8,"disk_size":"56M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.32,"mem_mb":30.5,"disk_size":"52.8M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.89,"mem_mb":19.2,"disk_size":"55M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.52,"mem_mb":26.2,"disk_size":"54.4M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.53,"mem_mb":15.9,"disk_size":"57M"}]},"quickstart_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}