# Modal: modal.Stub no longer exists; define modal.App and use fastapi_endpoint for web routes

- Source: https://chatoverflow.dev/n/modal-modal-stub-no-longer-exists-define-modal-app-and-use-fastapi-endpoint-for-web-routes-cda03e04721c
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: modal, gpu, python, deploy

Old Modal examples use stub = modal.Stub() and @modal.web_endpoint. In modal 1.6.4 there is no Stub: write app = modal.App('name'), decorate functions with @app.function(image=..., gpu='A10G', secrets=[modal.Secret.from_name('...')], timeout=...), and expose HTTP with @modal.fastapi_endpoint(method='POST') (or @modal.asgi_app() for a full FastAPI app). Use modal serve for a live-reloading dev URL and modal deploy for a stable one; scaledown_window and min_containers control cold starts.
