> ## Documentation Index
> Fetch the complete documentation index at: https://vastai-80aa3a82-auto-cli-sdk-preview-pr-398.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# vastai search offers

Search for instance types using custom query

## Usage

```bash theme={null}
vastai search offers [--help] [--api-key API_KEY] [--raw] <query>
```

## Arguments

<ParamField path="query" type="string" required>
  Query to search for. default: 'external=false rentable=true verified=true', pass -n to ignore default
</ParamField>

## Options

<ParamField path="--type" type="string" default="on-demand">
  Show 'on-demand', 'reserved', or 'bid'(interruptible) pricing. default: on-demand
</ParamField>

<ParamField path="--interruptible" type="string">
  Alias for --type=bid
</ParamField>

<ParamField path="--bid" type="string">
  Alias for --type=bid
</ParamField>

<ParamField path="--reserved" type="string">
  Alias for --type=reserved
</ParamField>

<ParamField path="--on-demand" type="string">
  Alias for --type=on-demand
</ParamField>

<ParamField path="--no-default" type="boolean">
  Disable default query
</ParamField>

<ParamField path="--new" type="boolean">
  New search exp
</ParamField>

<ParamField path="--limit" type="integer" />

<ParamField path="--storage" type="number" default="5.0">
  Amount of storage to use for pricing, in GiB. default=5.0GiB
</ParamField>

<ParamField path="--order" type="string" default="score-">
  Comma-separated list of fields to sort on. postfix field with - to sort desc. ex: -o 'num\_gpus,total\_flops-'.  default='score-'
</ParamField>

## Description

Query syntax:

query = comparison comparison...
comparison = field op value
field = \<name of a field>
op = one of: \<, \<=, ==, !=, >=, >, in, notin
value = \<bool, int, float, string> | 'any' | \[value0, value1, ...]
bool: True, False

note: to pass '>' and '\<' on the command line, make sure to use quotes
note: to encode a string query value (ie for gpu\_name), replace any spaces ' ' with underscore '\_'

## Examples

```bash theme={null}
# search for somewhat reliable single RTX 3090 instances
    vastai search offers 'reliability > 0.98 num_gpus=1 gpu_name=RTX_3090'

    # search for datacenter gpus with minimal compute_cap and total_flops
    vastai search offers 'compute_cap > 610 total_flops > 5 datacenter=True'

    # search for reliable 4 gpu offers in Taiwan or Sweden
    vastai search offers 'reliability>0.99 num_gpus=4 geolocation in [TW,SE]'

    # search for reliable RTX 3090 or 4090 gpus NOT in China or Vietnam
    vastai search offers 'reliability>0.99 gpu_name in ["RTX 4090", "RTX 3090"] geolocation notin [CN,VN]'

    # search for machines with nvidia drivers 535.86.05 or greater (and various other options)
    vastai search offers 'disk_space>146 duration>24 gpu_ram>10 cuda_vers>=12.1 direct_port_count>=2 driver_version >= 535.86.05'

    # search for reliable machines with at least 4 gpus, unverified, order by num_gpus
    vastai search offers 'reliability > 0.99  num_gpus>=4 verified=False' -o 'num_gpus-'

    # search for arm64 cpu architecture
    vastai search offers 'cpu_arch=arm64'

Available fields:

      Name                  Type       Description

    bw_nvlink               float     bandwidth NVLink
    compute_cap:            int       cuda compute capability*100  (ie:  650 for 6.5, 700 for 7.0)
    cpu_arch                string    host machine cpu architecture (e.g. amd64, arm64)
    cpu_cores:              int       # virtual cpus
    cpu_ghz:                Float     # cpu clock speed GHZ
    cpu_cores_effective:    float     # virtual cpus you get
    cpu_ram:                float     system RAM in gigabytes
    cuda_vers:              float     machine max supported cuda version (based on driver version)
    datacenter:             bool      show only datacenter offers
    direct_port_count       int       open ports on host's router
    disk_bw:                float     disk read bandwidth, in MB/s
    disk_space:             float     disk storage space, in GB
    dlperf:                 float     DL-perf score  (see FAQ for explanation)
    dlperf_usd:             float     DL-perf/$
    dph:                    float     $/hour rental cost
    driver_version:         string    machine's nvidia/amd driver version as 3 digit string ex. "535.86.05,"
    duration:               float     max rental duration in days
    external:               bool      show external offers in addition to datacenter offers
    flops_usd:              float     TFLOPs/$
    geolocation:            string    Two letter country code. Works with operators =, !=, in, notin (e.g. geolocation not in ['XV','XZ'])
    gpu_arch                string    host machine gpu architecture (e.g. nvidia, amd)
    gpu_max_power           float     GPU power limit (watts)
    gpu_max_temp            float     GPU temp limit (C)
    gpu_mem_bw:             float     GPU memory bandwidth in GB/s
    gpu_name:               string    GPU model name (no quotes, replace spaces with underscores, ie: RTX_3090 rather than 'RTX 3090')
    gpu_ram:                float     per GPU RAM in GB
    gpu_total_ram:          float     total GPU RAM in GB
    gpu_frac:               float     Ratio of GPUs in the offer to gpus in the system
    gpu_display_active:     bool      True if the GPU has a display attached
    has_avx:                bool      CPU supports AVX instruction set.
    id:                     int       instance unique ID
    inet_down:              float     internet download speed in Mb/s
    inet_down_cost:         float     internet download bandwidth cost in $/GB
    inet_up:                float     internet upload speed in Mb/s
    inet_up_cost:           float     internet upload bandwidth cost in $/GB
    machine_id              int       machine id of instance
    min_bid:                float     current minimum bid price in $/hr for interruptible
    num_gpus:               int       # of GPUs
    pci_gen:                float     PCIE generation
    pcie_bw:                float     PCIE bandwidth (CPU to GPU)
    reliability:            float     machine reliability score (see FAQ for explanation)
    rentable:               bool      is the instance currently rentable
    storage_cost:           float     storage cost in $/GB/month
    static_ip:              bool      is the IP addr static/stable
    total_flops:            float     total TFLOPs from all GPUs
    ubuntu_version          string    host machine ubuntu OS version
    verified:               bool      is the machine verified
    vms_enabled:            bool      is the machine a VM instance
```

## Global Options

The following options are available for all commands:

| Option          | Description                                           |
| --------------- | ----------------------------------------------------- |
| `--url URL`     | Server REST API URL                                   |
| `--retry N`     | Retry limit                                           |
| `--raw`         | Output machine-readable JSON                          |
| `--explain`     | Verbose explanation of API calls                      |
| `--api-key KEY` | API key (defaults to `~/.config/vastai/vast_api_key`) |
