Skip to main content
The 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 dev and flash deploy.

Create a new project

Create a new project in a new directory:
Or initialize in your current directory:

Project structure

flash init creates the following structure:
PROJECT_NAME
lb_worker.py
gpu_worker.py
cpu_worker.py
.env.example
.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. 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:

Handle existing files

If you run flash init in a directory with existing files, Flash detects conflicts and prompts for confirmation:
Use --force to skip the prompt and overwrite files:

Start developing

Once your project is set up:
Make changes to your worker files, and the server reloads automatically. When you’re ready, deploy with:

Next steps