*** title: Instance Creation description: >- Create GPU and CPU instances with smart defaults, fallback chains, startup scripts, and composable piping using the Brev CLI. -------------------------------------------------- Create instances with automatic GPU type selection, fallback chains, startup scripts, and composable piping. ## brev create ```bash brev create [name] [flags] ``` **Aliases:** `provision`, `gpu-create`, `gpu-retry`, `gcreate` ## Flags | Flag | Short | Description | | ------------------ | ----- | ------------------------------------------------------ | | `--name` | `-n` | Instance name. | | `--type` | `-t` | Comma-separated instance types to try (fallback chain) | | `--count` | `-c` | Number of instances to create (default: 1) | | `--parallel` | `-p` | Parallel creation attempts (default: 1) | | `--startup-script` | `-s` | Script to run on boot (inline string or `@filepath`) | | `--timeout` | | Seconds to wait for ready (default: 300) | | `--detached` | `-d` | Don't wait for instance to be ready. | | `--dry-run` | | Show matching instance types without creating. | ### Search Filter Flags All [search filter flags](/docs/cli/search-discovery) are also available on `brev create`: | Flag | Short | Description | | ------------------ | ----- | ------------------------------------------ | | `--gpu-name` | `-g` | Filter by GPU name (partial match) | | `--provider` | | Filter by cloud provider. | | `--min-vram` | `-v` | Minimum VRAM per GPU (GB) | | `--min-total-vram` | | Minimum total VRAM (GB) | | `--min-capability` | | Minimum GPU compute capability. | | `--min-disk` | | Minimum disk size (GB) | | `--max-boot-time` | | Maximum boot time (minutes) | | `--stoppable` | | Only stoppable instances. | | `--rebootable` | | Only rebootable instances. | | `--flex-ports` | | Only instances with configurable firewall. | | `--sort` | | Sort by: price, vram, boot-time, etc. | | `--desc` | | Sort descending. | ## Smart Defaults When you run `brev create` without specifying `--type` or any filter flags, the CLI applies these defaults: * **20 GB** minimum total VRAM * **500 GB** minimum disk * **Compute 8.0+** (Ampere or newer) * **\< 7 min** boot time * Sorted by **price** (cheapest first) ```bash # Uses smart defaults — picks the cheapest GPU matching the above criteria brev create my-instance ``` ## Specifying Instance Types ### Single Type ```bash brev create my-instance --type g5.xlarge ``` ### Fallback Chain Provide a comma-separated list of types. The CLI tries each in order until one succeeds: ```bash brev create my-instance --type g5.xlarge,g5.2xlarge,g5.4xlarge ``` ### Using Search Filters Apply the same filters available in `brev search` to narrow the type selection: ```bash brev create my-instance --gpu-name A100 --min-vram 40 ``` ### Piping from Search Pipe `brev search` output directly into `brev create`: ```bash brev search --gpu-name A100 | brev create my-instance ``` ## Startup Scripts Run scripts or commands automatically when the instance boots. ### Inline Script ```bash brev create my-instance -s 'pip install torch' ``` ### File Reference (`@filepath` Syntax) Prefix a local file path with `@` to use its contents as the startup script: ```bash brev create my-instance -s @setup.sh brev create my-instance -s @./scripts/install-deps.sh ``` ## Clusters Create multiple instances at once with `--count`: ```bash brev create my-cluster --count 3 --type g5.xlarge ``` ## Dry Run Preview matching instance types without actually creating anything: ```bash brev create my-instance --dry-run brev create my-instance --gpu-name A100 --dry-run ``` ## Detached Mode Skip waiting for the instance to be ready: ```bash brev create my-instance --detached ``` ## Output Piping `brev create` outputs the instance name to stdout, enabling chaining with other commands: ```bash # Create and open in an editor brev create my-instance | brev open cursor # Create and run a command brev create my-instance | brev exec "nvidia-smi" # Create and run a setup script brev create my-instance | brev exec @setup.sh # Full pipeline: search, create, open brev search --gpu-name A100 | brev create my-box | brev open cursor ``` ## Examples ```bash # Simple creation with smart defaults brev create my-instance # Specific type with startup script brev create my-instance --type g5.xlarge -s @setup.sh # High-VRAM GPU with fallback brev create training-box --gpu-name A100 --min-vram 40 # Create 3-node cluster brev create my-cluster --count 3 --type g5.xlarge # Preview what would be created brev create my-instance --dry-run # Full pipeline: search → create → setup → open brev search --gpu-name A100 | brev create my-box | brev exec @setup.sh ```