> ## Documentation Index
> Fetch the complete documentation index at: https://docs.murmur.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# machine-type

> Catalog resource that defines a VM shape — vCPU count, memory, architecture, optional GPU, and per-region on-demand pricing for agent VMs.

A [machine type](/concepts/environments) is a catalog resource that defines the compute shape of an agent VM. Each [environment](/concepts/environments) references one [machine type](/concepts/environments) by name via `machine_type_ref`.

The platform provides built-in [machine types](/concepts/environments) for common VM shapes on GCP and AWS. Built-in [machine types](/concepts/environments) are immutable — they cannot be modified or deleted.

## Fields

| Name           | Type   | Required    | Description                                                                                                     |
| -------------- | ------ | ----------- | --------------------------------------------------------------------------------------------------------------- |
| `name`         | string | yes         | Unique identifier. DNS label format: `[a-z][a-z0-9-]{0,62}`.                                                    |
| `description`  | string | no          | Human-readable description shown in the dashboard. Maximum 1024 bytes.                                          |
| `vcpus`        | int32  | yes         | Number of virtual CPUs. Must be positive.                                                                       |
| `memory_gb`    | int32  | yes         | Memory in GiB. Must be positive.                                                                                |
| `architecture` | string | yes         | CPU architecture. Values: `ARCHITECTURE_AMD64`, `ARCHITECTURE_ARM64`.                                           |
| `has_gpu`      | bool   | no          | Whether this [machine type](/concepts/environments) includes a GPU. Default: `false`.                           |
| `gpu_kind`     | string | conditional | GPU kind (e.g. `t4`, `l4`, `a100`). Required when `has_gpu` is `true`. Must be empty when `has_gpu` is `false`. |
| `spec`         | object | yes         | Cloud-specific configuration. Exactly one of `gce`, `aws`, or `docker`.                                         |

## GCE spec fields

Set `spec.gce` for GCP [machine types](/concepts/environments):

| Name                         | Type   | Required    | Description                                                                                                                      |
| ---------------------------- | ------ | ----------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `spec.gce.machine_type`      | string | yes         | GCE machine type (e.g. `n2-standard-32`). Must match `^[a-z][a-z0-9]([a-z0-9-]*[a-z0-9])?$`.                                     |
| `spec.gce.accelerator_type`  | string | conditional | GCE accelerator type (e.g. `nvidia-tesla-t4`). Required when `has_gpu` is `true`.                                                |
| `spec.gce.accelerator_count` | int32  | conditional | Number of GPU accelerators. Must be positive when `has_gpu` is `true`.                                                           |
| `spec.gce.regions`           | map    | yes         | Available regions with per-region cost configuration. At least one entry required. Keys are region strings (e.g. `us-central1`). |

## AWS spec fields

Set `spec.aws` for AWS [machine types](/concepts/environments):

| Name                     | Type   | Required | Description                                                                                                                    |
| ------------------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `spec.aws.instance_type` | string | yes      | EC2 instance type (e.g. `m5.8xlarge`). Must match `^[a-z][a-z0-9-]*\.[a-z0-9]+$`.                                              |
| `spec.aws.regions`       | map    | yes      | Available regions with per-region cost configuration. At least one entry required. Keys are region strings (e.g. `us-east-1`). |

## Region configuration

Each entry in a `regions` map is a `RegionConfig` object:

| Name            | Type   | Required | Description                                             |
| --------------- | ------ | -------- | ------------------------------------------------------- |
| `cost_per_hour` | double | yes      | On-demand cost per hour in USD. Must be greater than 0. |

## Examples

### Listing machine types

```bash theme={null}
murmur get machine-type
```

```
NAME                        VCPUS  MEMORY  ARCH   GPU  DESCRIPTION
murmur-n2-standard-32       32     128     amd64  no   Platform managed — GCE n2-standard-32
murmur-m5-8xlarge           32     128     amd64  no   Platform managed — EC2 m5.8xlarge
```

### Reading a single machine type

```bash theme={null}
murmur get machine-type murmur-n2-standard-32
```

### GCE machine type

```yaml theme={null}
name: my-gce-gpu
description: "GCE GPU machine type with T4"
vcpus: 16
memory_gb: 64
architecture: ARCHITECTURE_AMD64
has_gpu: true
gpu_kind: t4
spec:
  gce:
    machine_type: n2-standard-16
    accelerator_type: nvidia-tesla-t4
    accelerator_count: 1
    regions:
      us-central1:
        cost_per_hour: 1.25
```

### AWS machine type

```yaml theme={null}
name: my-aws-large
description: "EC2 m5.8xlarge"
vcpus: 32
memory_gb: 128
architecture: ARCHITECTURE_AMD64
has_gpu: false
spec:
  aws:
    instance_type: m5.8xlarge
    regions:
      us-east-1:
        cost_per_hour: 1.536
      us-west-2:
        cost_per_hour: 1.536
```

### Creating a machine type

```bash theme={null}
cat <<'EOF' | murmur set machine-type my-aws-large
name: my-aws-large
description: "EC2 m5.8xlarge"
vcpus: 32
memory_gb: 128
architecture: ARCHITECTURE_AMD64
has_gpu: false
spec:
  aws:
    instance_type: m5.8xlarge
    regions:
      us-east-1:
        cost_per_hour: 1.536
EOF
```

## Errors

| Code                  | Meaning                                                                                  | What to do                                                                                                                                            |
| --------------------- | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `INVALID_ARGUMENT`    | `name is required`                                                                       | Provide a `name` field.                                                                                                                               |
| `INVALID_ARGUMENT`    | `name must match [a-z][a-z0-9-]{0,62}`                                                   | Use a lowercase DNS label for the name.                                                                                                               |
| `INVALID_ARGUMENT`    | `description exceeds 1024 byte limit`                                                    | Shorten the `description` to 1024 bytes or fewer.                                                                                                     |
| `INVALID_ARGUMENT`    | `vcpus must be positive`                                                                 | Set `vcpus` to a value greater than 0.                                                                                                                |
| `INVALID_ARGUMENT`    | `memory_gb must be positive`                                                             | Set `memory_gb` to a value greater than 0.                                                                                                            |
| `INVALID_ARGUMENT`    | `architecture is required`                                                               | Set `architecture` to `ARCHITECTURE_AMD64` or `ARCHITECTURE_ARM64`.                                                                                   |
| `INVALID_ARGUMENT`    | `unknown architecture value <N>`                                                         | Use a valid `architecture` value.                                                                                                                     |
| `INVALID_ARGUMENT`    | `gpu_kind is required when has_gpu is true`                                              | Provide `gpu_kind` when `has_gpu` is `true`.                                                                                                          |
| `INVALID_ARGUMENT`    | `gpu_kind must be empty when has_gpu is false`                                           | Remove `gpu_kind` or set `has_gpu` to `true`.                                                                                                         |
| `INVALID_ARGUMENT`    | `spec is required (aws, gce, or docker)`                                                 | Provide exactly one of `spec.aws`, `spec.gce`, or `spec.docker`.                                                                                      |
| `INVALID_ARGUMENT`    | `aws.instance_type "<value>" does not match EC2 format`                                  | Use a valid EC2 instance type string (e.g. `m5.8xlarge`).                                                                                             |
| `INVALID_ARGUMENT`    | `gce.machine_type "<value>" does not match GCE format`                                   | Use a valid GCE machine type string (e.g. `n2-standard-32`).                                                                                          |
| `INVALID_ARGUMENT`    | `gce.accelerator_type is required when has_gpu is true`                                  | Provide `spec.gce.accelerator_type` for GPU [machine types](/concepts/environments).                                                                  |
| `INVALID_ARGUMENT`    | `gce.accelerator_count must be positive when has_gpu is true`                            | Set `spec.gce.accelerator_count` to a value greater than 0.                                                                                           |
| `INVALID_ARGUMENT`    | `aws.regions must be non-empty`                                                          | Add at least one region to `spec.aws.regions`.                                                                                                        |
| `INVALID_ARGUMENT`    | `gce.regions must be non-empty`                                                          | Add at least one region to `spec.gce.regions`.                                                                                                        |
| `INVALID_ARGUMENT`    | `aws.regions["<region>"].cost_per_hour must be > 0`                                      | Set `cost_per_hour` to a positive value for the given region.                                                                                         |
| `INVALID_ARGUMENT`    | `gce.regions["<region>"].cost_per_hour must be > 0`                                      | Set `cost_per_hour` to a positive value for the given region.                                                                                         |
| `INVALID_ARGUMENT`    | `docker machine types cannot request GPU`                                                | Remove `has_gpu` or use a GCE or AWS spec instead.                                                                                                    |
| `INVALID_ARGUMENT`    | `platform machine types are reserved for builtins and cannot be written via the catalog` | Do not set the `platform` field. Built-in [machine types](/concepts/environments) are managed by the platform.                                        |
| `FAILED_PRECONDITION` | `cannot delete machine-type "<name>": referenced by environment: <names>`                | Remove the `machine_type_ref` from the referencing [environments](/concepts/environments) before deleting the [machine type](/concepts/environments). |

## Related

* [Environments and placements](/concepts/environments) — concept overview
* [Catalog](/catalog/overview) — how catalog resources work
* [`murmur set`](/cli/set) — CLI command for creating and updating catalog resources
* [`murmur get`](/cli/get) — CLI command for reading catalog resources
