forge deploy
Deploy a compute template.
Command
forge deploy <template> [--gpu <type>] [--count <n>] [--env KEY=VAL] [--cpu <n>] [--memory <n>] [--port <n>] [--timeout <sec>] [--max-cost <usd>] [--wait] [--service|--job]
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
| string | yes | Compute template name |
Flags
| Flag | Type | Default | Notes |
|---|---|---|---|
| enum | — | | | | |
| int | — | GPU count |
| string[] | — | Environment variables (repeatable: ) |
| int | — | CPU cores |
| int | — | Memory in GB |
| int[] | — | Ports to expose (repeatable) |
| int | — | Timeout in seconds |
| float | — | Max cost in USD (required unless template sets default) |
| bool | | Poll until terminal state |
| bool | — | Long-running service |
| bool | — | One-off job (default) |
Examples
Deploy a CPU job:
forge deploy my-template --cpu 4 --memory 8 --max-cost 5.00
Deploy a GPU service:
forge deploy training-job --gpu A100 --count 1 --service --wait
With environment variables:
forge deploy my-template --env MODEL=llama --env BATCH_SIZE=32
Errors
| Exit code | Meaning |
|---|---|
| 0 | Deploy triggered successfully |
| 1 | Missing template name |
| 2 | Auth failure |
Pitfalls
- Compute credentials required — the API key must have compute access.
- Cost cap —
is required unless the template defines a default.--max-cost - Service vs job —
keeps the deployment running;--service
(default) runs to completion.--job
See also
{auto-injected}
Tested against
{auto-injected}