This document describes the defaults configuration feature for unattended deployment.
The --defaults flag allows you to run the deployment tool without interactive prompts. This is useful for:
- Unattended/automated deployments
- Quick one-command setups
- Scripting and CI/CD integration
- Aliases for frequently used configurations
When using --defaults, the tool reads configuration from environment variables in your .env file instead of prompting for input.
python main.py deploy --defaultsThis command will:
- Skip interactive prompts for template, network volume, and GPU selection
- Use default values from
.env - Automatically select the cheapest GPU matching your criteria
- Display reduced output (no GPU selection table)
The following environment variables can be set in your .env file:
Specifies the name of the template to use.
DEFAULT_TEMPLATE=simple_glm-4.7-flash
- Type: String
- Required: Yes (when using
--defaults) - Behavior: The tool will look for a template with exactly this name
- Error: If the template is not found, deployment will fail with an error
Specifies the network volume to use, or null for no network storage.
DEFAULT_NETWORK_VOLUME=null
# or
DEFAULT_NETWORK_VOLUME=storage-ro
- Type: String or "null"
- Required: No (defaults to null)
- Behavior:
- If set to a volume name: The tool will use the specified network volume
- If set to "null" or not set: No network volume will be used
- Note: When using
null, the pod will use container disk storage instead of a network volume. This allows for "zero costs when not running" setups, but provides no data persistence.
Controls whether dual GPU configurations are considered.
DEFAULT_ALLOW_TWO_GPUS=false
- Type: Boolean ("true" or "false")
- Required: No (defaults to false)
- Behavior:
true: Include both single and dual GPU configurationsfalse: Only include single GPU configurations
- Example: When
false, Qty=2 options are filtered out, even if they're cheaper
Minimum hourly cost filter for GPU selection.
DEFAULT_MIN_COST_PER_HOUR=0.30
- Type: Float (USD per hour)
- Required: No (no minimum filter)
- Behavior: GPUs with hourly cost below this value are excluded
- Use Case: Filter out very low-performance GPUs by setting a minimum cost threshold
Maximum hourly cost filter for GPU selection.
DEFAULT_MAX_COST_PER_HOUR=0.80
- Type: Float (USD per hour)
- Required: No (no maximum filter)
- Behavior: GPUs with hourly cost above this value are excluded
- Use Case: Avoid "overkill" setups by setting a maximum cost threshold
Specifies the Ollama model to preseed in container-only setups.
DEFAULT_MODEL=glm-4.7-flash
- Type: String
- Required: No (only used if
DEFAULT_PRESEED=true) - Behavior: Model name passed to
ollama pullcommand - Use Case: Preload models in ephemeral container setups (no network volume)
- Example: "llama3.1", "glm-4.7-flash", "mistral-7b"
Controls whether to automatically preseed the model in container-only setups.
DEFAULT_PRESEED=true
- Type: Boolean ("true" or "false")
- Required: No (defaults to false)
- Behavior: If
trueand no network volume is used, runsollama pullafter tunnels are established - Use Case: Automatically download models to container disk for faster startup
- Note: Only applies when
DEFAULT_NETWORK_VOLUME=null(container-only setup)
When you run python main.py deploy --defaults, the following happens:
-
Configuration Loading
- Load all default values from
.env - Validate that required defaults are set
- Load all default values from
-
Template Selection
- Find template matching
DEFAULT_TEMPLATEby name - Fail if template not found
- Find template matching
-
Network Volume Selection
- If
DEFAULT_NETWORK_VOLUMEis set: Find volume by name, use its datacenter - If
DEFAULT_NETWORK_VOLUMEis "null" or unset: No network volume, query GPUs across all regions
- If
-
GPU Selection
- Apply filters:
DEFAULT_MIN_COST_PER_HOUR,DEFAULT_MAX_COST_PER_HOUR,DEFAULT_ALLOW_TWO_GPUS - Query available GPUs in the datacenter (or across all regions)
- Filter GPUs by cost range and dual-GPU preference
- Select cheapest matching GPU automatically
- Display selected GPU (no table shown)
- Apply filters:
-
Pod Deployment
- Deploy pod with selected configuration
- Wait for pod to be running
- Create SSH tunnels
- Model Preseeding (if no network volume AND
DEFAULT_PRESEED=true):- Execute
ollama pull <model>on the pod via SSH - Continue with warning if preseeding fails
- Execute
-
Existing Pod Check
- Still prompts to reuse existing running pods (if any)
- This behavior can be skipped with
--no-reuseflag
When using --defaults, the output is reduced:
| Regular Mode | Defaults Mode |
|---|---|
| Available Templates table | ✗ Not shown (template auto-selected) |
| Available Network Volumes table | ✗ Not shown (volume auto-selected) |
| Available GPUs table | ✗ Not shown (GPU auto-selected) |
| Selected GPU info | ✓ Always shown |
| Connection details | ✓ Always shown |
| Progress bars | ✓ Always shown |
Example .env file for unattended deployment with model preseeding:
# Required: API key
RUNPOD_API_KEY=rpa_your_api_key_here
# Defaults configuration
DEFAULT_TEMPLATE=simple_glm-4.7-flash
DEFAULT_NETWORK_VOLUME=null
DEFAULT_ALLOW_TWO_GPUS=false
DEFAULT_MIN_COST_PER_HOUR=0.30
DEFAULT_MAX_COST_PER_HOUR=0.80
# Model preseeding (for container-only setups)
DEFAULT_MODEL=glm-4.7-flash
DEFAULT_PRESEED=trueWith this configuration:
- Uses the "simple_glm-4.7-flash" template
- No network volume (container disk storage)
- Only single GPU configurations
- GPUs between $0.30-$0.80/hr
- Cheapest matching GPU is selected automatically
- Preseeds "glm-4.7-flash" model after deployment
The --defaults flag can be combined with other flags:
# Skip existing pod check + use defaults
python main.py deploy --defaults --no-reuse
# Keep pod running after exit + use defaults
python main.py deploy --defaults --no-cleanup
# Skip existing pod, keep running, use defaults
python main.py deploy --defaults --no-reuse --no-cleanupIf DEFAULT_TEMPLATE doesn't match any existing template:
✗ Template 'my-template' not found. Available templates:
- simple_glm-4.7-flash
- another-template
The deployment will fail. You need to update .env with a valid template name.
If DEFAULT_NETWORK_VOLUME is set but the volume doesn't exist:
✗ Network volume 'my-storage' not found. Available volumes:
- storage-ro
- storage-rw
The deployment will fail. You need to update .env with a valid volume name or use "null".
If no GPUs match your cost filters:
✗ No available GPU configuration found matching criteria in All regions.
Try checking another datacenter or lowering requirements.
The deployment will fail. Adjust DEFAULT_MIN_COST_PER_HOUR or DEFAULT_MAX_COST_PER_HOUR.
When DEFAULT_NETWORK_VOLUME=null:
- No network volume is attached to pod
- Pod uses container disk storage (non-persistent)
- Data is lost when the pod is terminated
- Allows for "zero costs when not running" since you only pay for the pod while it's running
- GPU selection happens across all datacenters (not tied to a volume's datacenter)
- If
DEFAULT_PRESEED=true, the model specified byDEFAULT_MODELwill be automatically downloaded viaollama pull
You can create shell aliases for quick access:
# Add to ~/.bashrc or ~/.zshrc
alias runpod-deploy='python /path/to/runpod_simple/main.py deploy --defaults'Then simply run:
runpod-deployCommon error messages when using defaults:
| Error | Cause | Solution |
|---|---|---|
DEFAULT_TEMPLATE not set in .env |
Missing template name | Add DEFAULT_TEMPLATE=... to .env |
Template 'X' not found |
Template name doesn't match | Check available templates with python main.py deploy and update .env |
Network volume 'X' not found |
Volume name doesn't match | Check available volumes with python main.py deploy and update .env |
No available GPU configuration found |
Cost filters too restrictive | Adjust min/max cost filters in .env |
Model preseeding failed |
ollama pull command failed |
Check model name is correct, check pod logs, continue with warning |