Example
Create a new project directory:Arguments
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
@Endpointfunctions 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
@Endpointfunction that runs on GPU hardware. Provides/runor/runsyncroutes for job submission. Creates one Serverless endpoint when deployed. - cpu_worker.py: CPU queue-based endpoint. Contains an
@Endpointfunction that runs on CPU-only instances. Provides/runor/runsyncroutes for job submission. Creates one Serverless endpoint when deployed. - .env: Template for environment variables including
RUNPOD_API_KEY.
Next steps
After initialization:- Copy
.env.exampleto.env(if needed) and add yourRUNPOD_API_KEY. - Install dependencies:
pip install -r requirements.txt - Start the development server:
flash run - Open http://localhost:8888/docs to explore the API.
- Customize the workers for your use case.
- Deploy with
flash deploywhen 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.Related commands
flash run- Start the development serverflash deploy- Build and deploy to Runpod