Skip to main content
Create a new Flash project with a ready-to-use template structure including a FastAPI server, example GPU and CPU workers, and configuration files.
flash init [PROJECT_NAME] [OPTIONS]

Example

Create a new project directory:
flash init PROJECT_NAME
cd PROJECT_NAME
pip install -r requirements.txt
flash run
Initialize in the current directory:
flash init .

Arguments

PROJECT_NAME
string
Name of the project directory to create. If omitted or set to ., initializes in the current directory.

Flags

--force, -f
Overwrite existing files if they already exist in the target directory.

What it creates

The command creates the following project structure:
PROJECT_NAME
lb_worker.py
gpu_worker.py
cpu_worker.py
.env.example
.flashignore
.gitignore
pyproject.toml
requirements.txt
README.md

Template contents

  • lb_worker.py: load-balanced endpoint with HTTP routes. Contains @Endpoint functions with custom HTTP methods and paths (e.g., POST /process, GET /health). Multiple routes can share the same endpoint.
  • gpu_worker.py: GPU queue-based endpoint. Contains an @Endpoint function that runs on GPU hardware. Provides /run or /runsync routes for job submission. Creates one Serverless endpoint when deployed.
  • cpu_worker.py: CPU queue-based endpoint. Contains an @Endpoint function that runs on CPU-only instances. Provides /run or /runsync routes for job submission. Creates one Serverless endpoint when deployed.
  • .env: Template for environment variables including RUNPOD_API_KEY.

Next steps

After initialization:
  1. Copy .env.example to .env (if needed) and add your RUNPOD_API_KEY.
  2. Install dependencies: pip install -r requirements.txt
  3. Start the development server: flash run
  4. Open http://localhost:8888/docs to explore the API.
  5. Customize the workers for your use case.
  6. Deploy with flash deploy when ready.
This command only creates local files. It doesn’t interact with Runpod or create any cloud resources. Cloud resources are created when you run flash run or flash deploy.