Skip to main content
Build and deploy your Flash application to Runpod Serverless endpoints in one step. This is the primary command for getting your application running in the cloud.

Examples

Build and deploy a Flash app from the current directory (auto-selects environment if only one exists):
Deploy to a specific environment:
Deploy with additional excluded packages:
Build and test locally before deploying:

Flags

--env, -e
string
Target environment name (e.g., dev, staging, production). Auto-selected if only one exists. Creates the environment if it doesn’t exist.
--app, -a
string
Flash app name. Auto-detected from the current directory if not specified.
--no-deps
Skip transitive dependencies during pip install. Useful when the base image already includes dependencies.
--exclude
string
Comma-separated packages to exclude (e.g., torch,torchvision). Use this to stay under the 1.5GB deployment limit.
--output, -o
string
default:"artifact.tar.gz"
Custom archive name for the build artifact.
--preview
Build and launch a local Docker-based preview environment instead of deploying to Runpod.
--python-version
string
Target Python version for worker images (3.10, 3.11, 3.12, or 3.13). Overrides per-resource python_version declarations and local interpreter detection.

What happens during deployment

  1. Build phase: Creates the deployment artifact (same as flash build).
  2. Environment resolution: Detects or creates the target environment.
  3. Upload: Sends the artifact to Runpod storage.
  4. Provisioning: Creates or updates Serverless endpoints.
  5. Configuration: Sets up environment variables and service discovery.

Rolling releases for code changes

When you run flash deploy on an already-deployed application, Flash compares your current build against the previous deployment to determine what needs updating. Flash triggers a rolling release when your source code changes, even if your resource configuration stays the same. During the build phase, Flash computes a fingerprint of your source files. If this fingerprint differs from the previous deployment, Flash treats it as a configuration change and initiates a rolling update to your endpoints. This means you can iterate on your code without modifying resource configurations like GPU types or worker counts. Run flash deploy after making code changes, and Flash rolls out the updated code to your endpoints.

Architecture

After deployment, your Flash app runs as independent Serverless endpoints on Runpod:
Each resource configuration in your code creates an independent endpoint. You can call any endpoint directly based on your needs.

App and environment management

Automatic creation

Flash automatically creates apps and environments as needed during deployment:
  • If the app doesn’t exist, Flash creates it along with the target environment.
  • If only the environment doesn’t exist, Flash creates it within the existing app.

Auto-selection

When you have only one environment, it’s selected automatically:
When multiple environments exist, you must specify one:

Default environment

If no app or environment exists and none is specified, Flash creates the app with a production environment by default.

Post-deployment

After successful deployment, Flash displays all deployed endpoints:
Each endpoint is independent with its own URL and can be called directly.

Authentication

All deployed endpoints require authentication with your Runpod API key:

Preview mode

Test locally before deploying:
This builds your project and runs it in Docker containers locally:
  • Each endpoint runs in its own container.
  • All containers communicate via Docker network.
  • Endpoints exposed on local ports for testing.
  • Press Ctrl+C to stop.

Managing deployment size

Runpod Serverless has a 1.5GB limit. Flash automatically excludes packages that are pre-installed in the base image (torch, torchvision, torchaudio, numpy, triton). If the deployment is still too large, use --exclude to skip additional packages:
See flash build - Managing deployment size for more details.

flash dev vs flash deploy

See flash dev for a detailed comparison of local development vs production deployment.

Troubleshooting

Multiple environments error

Specify the target environment:

Deployment size limit

Base image packages are auto-excluded. If the deployment is still too large, use --exclude to skip additional packages:

Authentication fails

Ensure your API key is set: