Skip to main content
Build a deployment-ready artifact for your Flash application without deploying. Use this for more control over the build process or to inspect the artifact before deploying.
flash build [OPTIONS]

Examples

Build with all dependencies:
flash build
Build with additional excluded packages:
flash build --exclude scipy,pandas
Build with custom output name:
flash build -o my-app.tar.gz

Flags

--no-deps
Skip transitive dependencies during pip install. Only installs direct dependencies specified in @Endpoint decorators. Useful when the base image already includes dependencies.
--output, -o
string
default:"artifact.tar.gz"
Custom name for the output archive file.
--exclude
string
Comma-separated list of packages to exclude from the build (e.g., torch,torchvision). Use this to skip packages already in the base image.

What happens during build

  1. Function discovery: Finds all @Endpoint decorated functions.
  2. Grouping: Groups functions by their endpoint configuration.
  3. Manifest generation: Creates .flash/flash_manifest.json with endpoint definitions.
  4. Dependency installation: Installs Python packages for Linux x86_64.
  5. Packaging: Bundles everything into .flash/artifact.tar.gz.

Build artifacts

After running flash build:
File/DirectoryDescription
.flash/artifact.tar.gzDeployment package ready for Runpod
.flash/flash_manifest.jsonService discovery configuration
.flash/.build/Build directory (kept for inspection)

Cross-platform builds

Flash automatically handles cross-platform builds:
  • Automatic platform targeting: Dependencies are installed for Linux x86_64, regardless of your build platform.
  • Binary wheel enforcement: Only pre-built wheels are used, preventing compilation issues.

Python version in deployed workers

Your local Python version does not affect what runs in the cloud. flash build downloads wheels for the container’s Python version automatically.
Worker typePython versionNotes
GPU3.12 onlyThe GPU base image includes multiple interpreters (3.9–3.14) for interactive pod use, but torch and CUDA libraries are installed only for 3.12.
CPU3.10, 3.11, or 3.12Configurable via the PYTHON_VERSION build arg.
Image tags follow the pattern py{version}-{tag} (for example, runpod/flash:py3.12-latest).

Managing deployment size

Runpod Serverless has a 500MB deployment limit. Flash automatically excludes packages that are pre-installed in the base image:
  • torch, torchvision, torchaudio
  • numpy, triton
These packages are excluded at archive time, so you don’t need to specify them manually.

Manual exclusions

Use --exclude to skip additional packages that are already in a custom base image or not needed:
flash build --exclude scipy,pandas

Base image reference

Resource typeBase imageAuto-excluded packages
GPUPyTorch basetorch, torchvision, torchaudio, numpy, triton
CPUPython slimtorch, torchvision, torchaudio, numpy, triton
Check the worker-flash repository for current base images and pre-installed packages.

Troubleshooting

Build fails with “functions not found”

Ensure your project has @Endpoint decorated functions:
from runpod_flash import Endpoint, GpuGroup

@Endpoint(name="my-worker", gpu=GpuGroup.ANY)
def my_function(data):
    return {"result": data}

Archive is too large

Base image packages (torch, numpy, triton, etc.) are auto-excluded. If the archive is still too large, use --exclude to skip additional packages or --no-deps to skip transitive dependencies:
flash build --exclude scipy,pandas

Dependency installation fails

If a package doesn’t have Linux x86_64 wheels:
  1. Ensure standard pip is installed: python -m ensurepip --upgrade
  2. Check PyPI for Linux wheel availability.
  3. For Python 3.13+, some packages may require newer manylinux versions.

Need to examine generated files

The build directory is kept after building. Inspect it with:
ls .flash/.build/
  • flash deploy - Build and deploy in one step (includes --preview option for local testing)
  • flash run - Start development server
  • flash env - Manage environments
Most users should use flash deploy instead, which runs build and deploy in one step. Use flash build when you need more control or want to inspect the artifact.