flash init command creates a new Flash project with a complete project structure, including example and , and configuration files. This gives you a working starting point for building Flash applications.
Use flash init whenever you want to start a new Flash project, fully configured for you to run flash run and flash deploy.
Create a new project
Create a new project in a new directory:Project structure
flash init creates the following structure:
PROJECT_NAME
lb_worker.py
gpu_worker.py
cpu_worker.py
.env.example
.flashignore
.gitignore
pyproject.toml
requirements.txt
README.md
Key files
lb_worker.py: An example load-balanced worker with HTTP routes. Contains@Endpoint functions with custom HTTP methods and paths (e.g., POST /process, GET /health). Creates one endpoint when deployed.
gpu_worker.py: An example GPU queue-based worker. Contains @Endpoint functions that run on GPU hardware. Provides /runsync route for job submission. Creates one endpoint when deployed.
cpu_worker.py: An example CPU queue-based worker. Contains @Endpoint functions that run on CPU-only instances. Provides /runsync route for job submission. Creates one endpoint when deployed.
.flashignore: Lists files and directories to exclude from the deployment artifact (similar to .gitignore).
Each worker file defines a resource configuration and its associated functions. When you deploy, Flash creates one Serverless endpoint per unique resource configuration.
Set up the project
After initialization, complete the setup:How it fits into the workflow
flash init is the first step in the Flash development workflow:
flash init: Creates project structure and boilerplate.flash run: Starts local development server for testing.flash deploy: Builds and deploys to Runpod Serverless.
Handle existing files
If you runflash init in a directory with existing files, Flash detects conflicts and prompts for confirmation:
--force to skip the prompt and overwrite files:
Start developing
Once your project is set up:Next steps
- Customize your app to add endpoints and modify configurations.
- Test locally with
flash run. - Deploy to production with
flash deploy. - View the flash init reference for all options.