vastai


Namevastai JSON
Version 0.2.2 PyPI version JSON
download
home_pagehttps://github.com/vast-ai/vast-python
SummaryVast.ai Python CLI
upload_time2024-03-20 23:22:38
maintainerNone
docs_urlNone
authorVast.ai
requires_python>=3.7
licenseMIT
keywords cli vast.ai vast.ai vast vastai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Vast.ai Python CLI

The Vast.ai Python library provides convenient access to the VastAI API for applications written in the Python language.

This CLI has all of the main functionality of the vast.ai website GUI and uses the same underlying REST API. Most of the functionality is self-contained in the single script file `vast.py`, although the invoice generating commands require installing an additional second script called `vast_pdf.py`.

You can find usage examples and documentation for the VastAI Python library in our [API reference](https://vast.ai/docs/command-line-interface/overview-and-quickstart) and the code itself on our [github repository](https://github.com/vast-ai/vast-python).


## Installation

To update or install the package, just run:

```pip install --upgrade vastai```

Install from source with:

```python setup.py install```


## Usage


You can get a list of available commands with `vastai --help`.

Most commands require authentication through your api-key.  In order to proceed further you will need to login to the vast.ai website and get your api-key.

Go to [https://vast.ai/console/cli/](https://vast.ai/console/cli/). Copy the command under  the heading "Login / Set API Key" and run it. 
The command will be something like

```vast set api-key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx```

where the `xxxx...` is your api-key (a long hexadecimal number). Note that if the script is
named "vast" in this command on the website and your installed script is named "vast.py"
you will need to change the name of the script in the command you run. The `set api-key`
command saves your api-key in a hidden file in your home directory. Do not share your
api-key with anyone as it authenticates your other vast commands to your account.

## Usage

To see how the API works you can use it to find machines for rent. `vast.py search offers`. In this
form the command will show all available offers. To get more specific results try narrowing the search.
There is a large online help page on how to do this. Bring up the help by doing `vast.py search offers --help`.
There are many parameters that can be used to filter the results. The search command supports
all of the filters and sort options that the website GUI uses. To find Turing GPU instances
(compute capability 7.0 or higher):

```vast search offers 'compute_cap > 700 '```

To find instances with a reliability score >= 0.99 and at least 4 gpus, ordering by num of gpus
descending:

```vast search offers 'reliability > 0.99  num_gpus>=4' -o 'num_gpus-'```

The output of this command at the time of this writing is
```
ID       CUDA  Num  Model        PCIE_BW  vCPUs     RAM  Storage  $/hr     DLPerf  DLP/$  Nvidia Driver Version  Net_up  Net_down  R      Max_Days  machine_id
1596177  11.4  10x  GTX_1080     5.5      48.0    257.9  4628     2.0000   73.0    36.5   470.63.01              653.3   854.5     99.5   -         638
2459430  11.5   8x  RTX_A5000    9.1      128.0   515.8  3094     4.0000   209.4   52.3   495.46                 1844.2  2669.6    99.7   12.0      4384
2459380  11.4   8x  RTX_3070     6.3      12.0     64.0  710      1.4200   67.2    47.3   470.86                 0.0     0.0       99.8   -         4102
2456624  11.4   8x  RTX_2080_Ti  10.7     32.0    257.9  1653     2.8000   126.4   45.2   470.82.00              14.6    214.2     99.8   28.7      3047
2456622  11.4   8x  RTX_2080_Ti  10.8     32.0    128.9  1651     2.8000   127.1   45.4   470.82.00              14.9    214.7     99.1   28.7      1569
2456600  11.5   8x  RTX_2080_Ti  10.9     48.0    256.6  1704     2.4000   125.5   52.3   495.29.05              169.0   169.8     99.7   25.7      4058
2455617  11.2   8x  RTX_3090     21.7     64.0    515.8  6165     6.4000   261.1   40.8   460.67                 477.6   707.2     99.8   28.7      2980
2454397  11.2   8x  A100_SXM4    22.4     128.0  2064.1  21568    13.2000  300.1   22.7   460.106.00             708.7   1119.8    99.2   -         4762
2405590  11.4   8x  RTX_2080_Ti  11.2     48.0    257.9  1629     3.8000   125.5   33.0   470.82.00              389.4   608.8     100.0  1.8       2776
2364579  11.4   8x  A100_PCIE    18.5     128.0   515.8  4813     14.8000  278.8   18.8   470.74                 472.4   699.0     99.9   28.7      3459
2281839  11.2   8x  Tesla_V100   11.8     72.0    483.1  1171     5.6000   193.6   34.6   460.67                 493.0   697.8     100.0  28.7      2744
2281832  11.2   8x  A100_PCIE    17.7     64.0    515.9  5821     14.8000  276.7   18.7   460.91.03              478.2   655.5     99.9   28.7      2901
2452630  11.4   7x  RTX_3090     6.3      28.0     64.0  61       3.5000   165.5   47.3   470.86                 84.6    84.4      99.3   3.8       4420
2342561  11.4   7x  RTX_3090     6.1      96.0    257.6  1664     4.5500   149.2   32.8   470.82.00              476.9   671.7     99.4   1.7       4202
2237983  11.4   7x  RTX_3090     12.5     32.0    257.6  3228     3.1500   204.5   64.9   470.86                 194.4   183.8     99.1   -         4207
2459511  11.4   6x  RTX_3090     6.2      -       128.8  812      2.8200   150.2   53.2   470.94                 374.4   271.4     99.0   6.7       3129
2448342  11.5   6x  RTX_A6000    12.4     64.0    515.7  6695     3.6000   169.8   47.2   495.29.05              668.6   1082.6    99.6   -         3624
2437565  11.4   6x  RTX_3090     23.0     16.0    128.8  1676     5.4000   196.8   36.5   470.94                 34.1    131.5     99.4   -         4238
2332973  11.2   6x  RTX_3090     11.9     48.0    193.3  1671     3.3000   180.3   54.6   460.84                 582.1   737.6     99.9   25.6      3552
2459459  11.5   4x  RTX_3090     23.1     32.0    257.8  1363     2.0000   131.2   65.6   495.46                 1954.7  2725.8    99.6   12.0      3059
2459428  11.5   4x  RTX_A5000    24.6     64.0    515.8  1547     2.0000   104.9   52.4   495.46                 1844.2  2669.6    99.7   12.0      4384
2459368  11.4   4x  RTX_3090     25.3     48.0     64.2  133      1.3967   130.5   93.4   470.86                 0.0     0.0       99.4   -         4637
2458968  11.6   4x  RTX_3090     11.7     16.0    128.5  752      1.4000   79.8    57.0   510.39.01              797.8   842.7     99.9   4.0       2555
2458878  11.6   4x  RTX_3090     11.6     36.0    128.5  1531     1.4000   81.9    58.5   510.39.01              757.1   807.6     99.9   4.0       3646
2458845  11.6   4x  RTX_3090     3.1      12.0    128.5  369      1.4000   92.4    66.0   510.39.01              725.7   852.2     99.8   4.0       700
2458838  11.6   4x  RTX_3090     5.7      48.0    128.9  624      1.4000   85.3    60.9   510.39.01              574.9   731.7     99.8   4.0       2217
2454395  11.2   4x  A100_SXM4    22.9     64.0   2064.1  10784    6.6000   150.0   22.7   460.106.00             708.7   1119.8    99.2   -         4762
2452632  11.4   4x  RTX_3090     6.3      16.0     64.0  35       2.0000   123.5   61.8   470.86                 84.6    84.4      99.3   3.8       4420
2450275  11.4   4x  RTX_3080_Ti  12.5     32.0    128.7  817      1.8000   128.8   71.6   470.82.00              278.3   350.4     99.7   -         4260
2449210  11.5   4x  RTX_3090     11.2     48.0    128.9  324      2.0000   89.7    44.9   495.29.05              688.3   775.4     99.8   -         2764
2445175  11.4   4x  RTX_3090     11.9     32.0    257.6  1530     2.0000   135.4   67.7   470.86                 868.6   887.1     99.7   25.9      3055
2444916  11.4   4x  RTX_3090     11.9     16.0    128.7  1576     1.4000   131.8   94.2   470.82.00              39.4    402.3     99.9   -         3759
2437188  11.4   4x  Tesla_P100   11.7     24.0     95.2  2945     0.7200   44.8    62.2   470.82.00              10.9    76.2      99.5   0.1       3969
2437179  11.4   4x  Tesla_P100   11.7     32.0    192.1  3070     0.7200   44.8    62.3   470.82.00              11.1    66.0      99.2   0.0       4159
2431606  11.4   4x  RTX_3090     17.9     32.0    110.7  330      1.8400   134.3   73.0   470.82.01              584.6   813.4     99.7   4.4       4079
2419191  11.4   4x  RTX_2080_Ti  6.3      32.0     64.4  837      2.0000   64.7    32.4   470.63.01              40.5    205.9     99.7   -         162
2405589  11.4   4x  RTX_2080_Ti  10.8     24.0    257.9  815      1.9000   62.8    33.0   470.82.00              389.4   608.8     100.0  1.8       2776
2392087  11.4   4x  RTX_A6000    10.8     32.0    515.9  1247     1.8000   64.5    35.8   470.94                 669.9   705.4     99.1   10.9      4782
2377227  11.2   4x  RTX_3090     6.3      24.0     64.3  1638     2.0000   128.3   64.1   460.32.03              37.8    145.0     99.7   3.0       2672
2349173  11.4   4x  RTX_3090     23.2     48.0    128.7  1475     2.0000   107.4   53.7   470.86                 33.2    84.2      99.8   47.3      3949
2338635  11.4   4x  RTX_3090     23.0     32.0    128.5  3151     1.6000   108.8   68.0   470.86                 33.8    86.4      99.6   47.4      3948
2303959  11.2   4x  RTX_3090     11.7     28.0    128.8  791      2.1200   131.3   61.9   460.32.03              519.7   570.7     99.5   -         3042
2281830  11.2   4x  A100_PCIE    18.1     32.0    515.9  2910     7.4000   143.6   19.4   460.91.03              478.2   655.5     99.9   28.7      2901
2193726  11.4   4x  RTX_3090     12.4     32.0    128.8  1646     3.6000   153.9   42.8   470.82.01              33.3    137.5     99.5   -         3434
1737692  11.2   4x  RTX_3070     6.3      28.0    128.5  656      2.8000   37.5    13.4   460.91.03              452.6   703.2     99.6   -         3510
```

#### Launching Instances
To create an instance of type 2459368 (using an ID from the search) with the vastai/tensorflow image
and 32 GB of disk storage

```vast create instance 2459368 --image vastai/tensorflow --disk 32```

## Install

If you followed the instructions in [Quickstart](#Quickstart) you have already installed the script that contains
most of the CLI functionality. If you wish to print PDF format invoices you will need a few other
things. First, you'll need the vast_pdf.py script. This can be found in this repository in the main
directory at [vast_pdf.py](vast_pdf.py). This script should be present in the same directory as the
`vast.py` script. It makes use of a third party library called Borb to create the PDF invoices. To install
this run the command `pip3 install borb`

## Commands

The CLI API is all contained in a python script called `vast.py`.
This script can be called with various commands as arguments. Commands follow
a simple "verb-object" pattern. As an example, consider "show machines". To run this
command use `vast show machines`

## List of commands and associated help message

```
vast [-h] [--url URL] [--raw] [--api-key API_KEY] command ...

positional arguments:
  command               command to run. one of:
    help                print this help message
    copy                Copy directories between instances and/or local
    search offers       Search for instance types using custom query
    show instances      Display user's current instances
    ssh-url             ssh url helper
    scp-url             scp url helper
    show machines       [Host] Show hosted machines
    show invoices       Get billing history reports
    show user           Get current user data
    generate pdf-invoices
    list machine        [Host] list a machine for rent
    unlist machine      [Host] Unlist a listed machine
    remove defjob       [Host] Delete default jobs
    reboot instance     Reboot (stop/start) an instance
    start instance      Start a stopped instance
    stop instance       Stop a running instance
    label instance      Assign a string label to an instance
    destroy instance    Destroy an instance (irreversible, deletes data)
    execute             Execute a (constrained) remote command on a machine
    logs                Get the logs for an instance
    set defjob          [Host] Create default jobs for a machine
    create instance     Create a new instance
    change bid          Change the bid price for a spot/interruptible instance
    set min-bid         [Host] Set the minimum bid/rental price for a machine
    set api-key         Set api-key (get your api-key from the console/CLI)

optional arguments:
  -h, --help            show this help message and exit
  --url URL             server REST api url
  --raw                 output machine-readable json
  --api-key API_KEY     api key. defaults to using the one stored in
                        ~/.vast_api_key

Use 'vast COMMAND --help' for more info about a command

```
#### change bid -- Change the bid price for a spot/interruptible instance

```
vast change bid id [--price PRICE]

positional arguments:
  id                 id of instance type to change bid

optional arguments:
  -h, --help         show this help message and exit
  --price PRICE      per machine bid price in $/hour
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

Change the current bid price of instance id to PRICE.
If PRICE is not specified, then a winning bid price is used as the default.

```
---
#### copy -- Copy directories between instances and/or local

```
vast copy src dst

positional arguments:
  src                   instance_id:/path to source of object to copy.
  dst                   instance_id:/path to target of copy operation.

optional arguments:
  -h, --help            show this help message and exit
  -i IDENTITY, --identity IDENTITY
                        Location of ssh private key
  --url URL             server REST api url
  --raw                 output machine-readable json
  --api-key API_KEY     api key. defaults to using the one stored in
                        ~/.vast_api_key

Copies a directory from a source location to a target location. Each of source and destination
directories can be either local or remote, subject to appropriate read and write
permissions required to carry out the action. The format for both src and dst is [instance_id:]path.
Examples:
 vast copy 11824:/data/test 12371:/temp
 vast copy 11824:/data/test data/test
 vast copy data/test 11824:/data/test

The first example copy syncs the directory '/tmp' in instance 12371 from the directory '/data/test' in instance 11824.
The second example copy syncs the relative directory 'data/test' on the local machine from '/data/test' in instance 11824.
The third example copy syncs the directory '/data/test' in instance 11824 from the relative directory 'data/test' on the local machine.

```
---
#### create instance -- Create a new instance

```
vast create instance id [OPTIONS] [--args ...]

positional arguments:
  id                    id of instance type to launch

optional arguments:
  -h, --help            show this help message and exit
  --price PRICE         per machine bid price in $/hour
  --disk DISK           size of local disk partition in GB
  --image IMAGE         docker container image to launch
  --login LOGIN         docker login arguments for private repo
                        authentication, surround with ''
  --label LABEL         label to set on the instance
  --onstart ONSTART     filename to use as onstart script
  --onstart-cmd ONSTART_CMD
                        contents of onstart script as single argument
  --ssh                 Launch as an ssh instance type.
  --jupyter             Launch as a jupyter instance instead of an ssh
                        instance.
  --direct              Use (faster) direct connections for jupyter & ssh.
  --jupyter-dir JUPYTER_DIR
                        For runtype 'jupyter', directory in instance to use to
                        launch jupyter. Defaults to image's working directory.
  --jupyter-lab         For runtype 'jupyter', Launch instance with jupyter
                        lab.
  --lang-utf8           Workaround for images with locale problems: install
                        and generate locales before instance launch, and set
                        locale to C.UTF-8.
  --python-utf8         Workaround for images with locale problems: set
                        python's locale to C.UTF-8.
  --env ENV             env variables and port mapping options, surround with
                        ''
  --args ...            list of arguments passed to container ENTRYPOINT.
                        Onstart is recommended for this purpose.
  --create-from CREATE_FROM
                        Existing instance id to use as basis for new instance.
                        Instance configuration should usually be identical, as
                        only the difference from the base image is copied.
  --force               Skip sanity checks when creating from an existing
                        instance
  --url URL             server REST api url
  --raw                 output machine-readable json
  --api-key API_KEY     api key. defaults to using the one stored in
                        ~/.vast_api_key

Examples:
vast create instance 384827 --image bobsrepo/pytorch:latest --login '-u bob -p 9d8df!fd89ufZ docker.io' --jupyter --direct --env '-e TZ=PDT -e XNAME=XX4 -p 22:22 -p 8080:8080' --disk 20
vast create instance 344521 --image anthonytatowicz/eth-cuda-miner --disk 20 --args -U -S us-west1.nanopool.org:9999 -O 0x5C9314b28Fbf25D1d054a9184C0b6abF27E20d95 --farm-recheck 200

```
---
#### destroy instance -- Destroy an instance (irreversible, deletes data)

```
vast destroy instance id [-h] [--api-key API_KEY] [--raw]

positional arguments:
  id                 id of instance to delete

optional arguments:
  -h, --help         show this help message and exit
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### execute -- Execute a (constrained) remote command on a machine

```
vast execute ID COMMAND

positional arguments:
  ID                 id of instance to execute on
  COMMAND            command to execute

optional arguments:
  -h, --help         show this help message and exit
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### generate pdf-invoices -- 

```
vast generate pdf_invoices [OPTIONS]

optional arguments:
  -h, --help            show this help message and exit
  -q, --quiet           only display numeric ids
  -s START_DATE, --start_date START_DATE
                        start date and time for report. Many formats accepted
                        (optional)
  -e END_DATE, --end_date END_DATE
                        end date and time for report. Many formats accepted
                        (optional)
  -c, --only_charges    Show only charge items.
  -p, --only_credits    Show only credit items.
  --url URL             server REST api url
  --raw                 output machine-readable json
  --api-key API_KEY     api key. defaults to using the one stored in
                        ~/.vast_api_key

```
---
#### help -- print this help message

```
vast help [-h] [--url URL] [--raw] [--api-key API_KEY] [subcommand]

positional arguments:
  subcommand

optional arguments:
  -h, --help         show this help message and exit
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### label instance -- Assign a string label to an instance

```
vast label instance <id> <label>

positional arguments:
  id                 id of instance to label
  label              label to set

optional arguments:
  -h, --help         show this help message and exit
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### list machine -- [Host] list a machine for rent

```
vast list machine id [--price_gpu PRICE_GPU] [--price_inetu PRICE_INETU] [--price_inetd PRICE_INETD] [--api-key API_KEY]

positional arguments:
  id                    id of machine to list

optional arguments:
  -h, --help            show this help message and exit
  -g PRICE_GPU, --price_gpu PRICE_GPU
                        per gpu rental price in $/hour (price for active
                        instances)
  -s PRICE_DISK, --price_disk PRICE_DISK
                        storage price in $/GB/month (price for inactive
                        instances), default: $0.15/GB/month
  -u PRICE_INETU, --price_inetu PRICE_INETU
                        price for internet upload bandwidth in $/GB
  -d PRICE_INETD, --price_inetd PRICE_INETD
                        price for internet download bandwidth in $/GB
  -m MIN_CHUNK, --min_chunk MIN_CHUNK
                        minimum amount of gpus
  -e END_DATE, --end_date END_DATE
                        unix timestamp of the available until date (optional)
  --url URL             server REST api url
  --raw                 output machine-readable json
  --api-key API_KEY     api key. defaults to using the one stored in
                        ~/.vast_api_key

```
---
#### logs -- Get the logs for an instance

```
vast logs [OPTIONS] INSTANCE_ID

positional arguments:
  INSTANCE_ID        id of instance

optional arguments:
  -h, --help         show this help message and exit
  --tail TAIL        Number of lines to show from the end of the logs (default
                     '1000')
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### reboot instance -- Reboot (stop/start) an instance

```
vast reboot instance <id> [--raw]

positional arguments:
  id                 id of instance to reboot

optional arguments:
  -h, --help         show this help message and exit
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### remove defjob -- [Host] Delete default jobs

```
vast remove defjob [-h] [--url URL] [--raw] [--api-key API_KEY] id

positional arguments:
  id                 id of machine to remove default instance from

optional arguments:
  -h, --help         show this help message and exit
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### scp-url -- scp url helper

```
vast scp-url

optional arguments:
  -h, --help         show this help message and exit
  --id ID            id of instance
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### search offers -- Search for instance types using custom query

```
vast search offers [--help] [--api-key API_KEY] [--raw] <query>

positional arguments:
  query                 Query to search for. default: 'external=false
                        rentable=true verified=true', pass -n to ignore
                        default

optional arguments:
  -h, --help            show this help message and exit
  -t TYPE, --type TYPE  Show 'bid'(interruptible) or 'on-demand' offers.
                        default: on-demand
  -i, --interruptible   Alias for --type=bid
  -b, --bid             Alias for --type=bid
  -d, --on-demand       Alias for --type=on-demand
  -n, --no-default      Disable default query
  --disable-bundling    Show identical offers. This request is more heavily
                        rate limited.
  --storage STORAGE     Amount of storage to use for pricing, in GiB.
                        default=5.0GiB
  -o ORDER, --order ORDER
                        Comma-separated list of fields to sort on. postfix
                        field with - to sort desc. ex: -o
                        'num_gpus,total_flops-'. default='score-'
  --url URL             server REST api url
  --raw                 output machine-readable json
  --api-key API_KEY     api key. defaults to using the one stored in
                        ~/.vast_api_key

Query syntax:

    query = comparison comparison...
    comparison = field op value
    field = <name of a field>
    op = one of: <, <=, ==, !=, >=, >, in, notin
    value = <bool, int, float, etc> | 'any'

note: to pass '>' and '<' on the command line, make sure to use quotes

Examples:

    ./vast search offers 'compute_cap > 610 total_flops < 5'
    ./vast search offers 'reliability > 0.99  num_gpus>=4' -o 'num_gpus-'
    ./vast search offers 'rentable = any'

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_cores:              int       # virtual cpus
    cpu_cores_effective:    float     # virtual cpus you get
    cpu_ram:                float     system RAM in gigabytes
    cuda_vers:              float     cuda version
    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    driver version in use on a host.
    duration:               float     max rental duration in days
    external:               bool      show external offers
    flops_usd:              float     TFLOPs/$
    gpu_mem_bw:             float     GPU memory bandwidth in GB/s
    gpu_ram:                float     GPU RAM in GB
    gpu_frac:               float     Ratio of GPUs in the offer to gpus in the system
    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
    rented:                 bool      is the instance currently rented
    storage_cost:           float     storage cost in $/GB/month
    total_flops:            float     total TFLOPs from all GPUs
    verified:               bool      is the machine verified

```
---
#### set api-key -- Set api-key (get your api-key from the console/CLI)

```
vast set api-key APIKEY

positional arguments:
  new_api_key        Api key to set as currently logged in user

optional arguments:
  -h, --help         show this help message and exit
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### set defjob -- [Host] Create default jobs for a machine

```
vast set defjob id [--api-key API_KEY] [--price_gpu PRICE_GPU] [--price_inetu PRICE_INETU] [--price_inetd PRICE_INETD] [--image IMAGE] [--args ...]

positional arguments:
  id                    id of machine to launch default instance on

optional arguments:
  -h, --help            show this help message and exit
  --price_gpu PRICE_GPU
                        per gpu rental price in $/hour
  --price_inetu PRICE_INETU
                        price for internet upload bandwidth in $/GB
  --price_inetd PRICE_INETD
                        price for internet download bandwidth in $/GB
  --image IMAGE         docker container image to launch
  --args ...            list of arguments passed to container launch
  --url URL             server REST api url
  --raw                 output machine-readable json
  --api-key API_KEY     api key. defaults to using the one stored in
                        ~/.vast_api_key

```
---
#### set min-bid -- [Host] Set the minimum bid/rental price for a machine

```
vast set min_bid id [--price PRICE]

positional arguments:
  id                 id of machine to set min bid price for

optional arguments:
  -h, --help         show this help message and exit
  --price PRICE      per gpu min bid price in $/hour
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

Change the current min bid price of machine id to PRICE.

```
---
#### show instances -- Display user's current instances

```
vast show instances [--api-key API_KEY] [--raw]

optional arguments:
  -h, --help         show this help message and exit
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### show invoices -- Get billing history reports

```
vast show invoices [OPTIONS]

optional arguments:
  -h, --help            show this help message and exit
  -q, --quiet           only display numeric ids
  -s START_DATE, --start_date START_DATE
                        start date and time for report. Many formats accepted
                        (optional)
  -e END_DATE, --end_date END_DATE
                        end date and time for report. Many formats accepted
                        (optional)
  -c, --only_charges    Show only charge items.
  -p, --only_credits    Show only credit items.
  --url URL             server REST api url
  --raw                 output machine-readable json
  --api-key API_KEY     api key. defaults to using the one stored in
                        ~/.vast_api_key

```
---
#### show machines -- [Host] Show hosted machines

```
vast show machines [OPTIONS]

optional arguments:
  -h, --help         show this help message and exit
  -q, --quiet        only display numeric ids
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### show user -- Get current user data

```
vast show user [OPTIONS]

optional arguments:
  -h, --help         show this help message and exit
  -q, --quiet        display information about user
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### ssh-url -- ssh url helper

```
vast ssh-url

optional arguments:
  -h, --help         show this help message and exit
  --id ID            id of instance
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### start instance -- Start a stopped instance

```
vast start instance <id> [--raw]

positional arguments:
  id                 id of instance to start/restart

optional arguments:
  -h, --help         show this help message and exit
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### stop instance -- Stop a running instance

```
vast stop instance [--raw] <id>

positional arguments:
  id                 id of instance to stop

optional arguments:
  -h, --help         show this help message and exit
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---
#### unlist machine -- [Host] Unlist a listed machine

```
vast unlist machine <id>

positional arguments:
  id                 id of machine to unlist

optional arguments:
  -h, --help         show this help message and exit
  --url URL          server REST api url
  --raw              output machine-readable json
  --api-key API_KEY  api key. defaults to using the one stored in
                     ~/.vast_api_key

```
---



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/vast-ai/vast-python",
    "name": "vastai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "CLI, Vast.ai, vast.ai, vast, vastai",
    "author": "Vast.ai",
    "author_email": "\"vast.ai\" <support@vast.ai>",
    "download_url": "https://files.pythonhosted.org/packages/7e/26/6ef9914c05d2a28125723be88d584409c27eb0d1ab235cd44019c272956a/vastai-0.2.2.tar.gz",
    "platform": null,
    "description": "# Vast.ai Python CLI\n\nThe Vast.ai Python library provides convenient access to the VastAI API for applications written in the Python language.\n\nThis CLI has all of the main functionality of the vast.ai website GUI and uses the same underlying REST API. Most of the functionality is self-contained in the single script file `vast.py`, although the invoice generating commands require installing an additional second script called `vast_pdf.py`.\n\nYou can find usage examples and documentation for the VastAI Python library in our [API reference](https://vast.ai/docs/command-line-interface/overview-and-quickstart) and the code itself on our [github repository](https://github.com/vast-ai/vast-python).\n\n\n## Installation\n\nTo update or install the package, just run:\n\n```pip install --upgrade vastai```\n\nInstall from source with:\n\n```python setup.py install```\n\n\n## Usage\n\n\nYou can get a list of available commands with `vastai --help`.\n\nMost commands require authentication through your api-key.  In order to proceed further you will need to login to the vast.ai website and get your api-key.\n\nGo to [https://vast.ai/console/cli/](https://vast.ai/console/cli/). Copy the command under  the heading \"Login / Set API Key\" and run it. \nThe command will be something like\n\n```vast set api-key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx```\n\nwhere the `xxxx...` is your api-key (a long hexadecimal number). Note that if the script is\nnamed \"vast\" in this command on the website and your installed script is named \"vast.py\"\nyou will need to change the name of the script in the command you run. The `set api-key`\ncommand saves your api-key in a hidden file in your home directory. Do not share your\napi-key with anyone as it authenticates your other vast commands to your account.\n\n## Usage\n\nTo see how the API works you can use it to find machines for rent. `vast.py search offers`. In this\nform the command will show all available offers. To get more specific results try narrowing the search.\nThere is a large online help page on how to do this. Bring up the help by doing `vast.py search offers --help`.\nThere are many parameters that can be used to filter the results. The search command supports\nall of the filters and sort options that the website GUI uses. To find Turing GPU instances\n(compute capability 7.0 or higher):\n\n```vast search offers 'compute_cap > 700 '```\n\nTo find instances with a reliability score >= 0.99 and at least 4 gpus, ordering by num of gpus\ndescending:\n\n```vast search offers 'reliability > 0.99  num_gpus>=4' -o 'num_gpus-'```\n\nThe output of this command at the time of this writing is\n```\nID       CUDA  Num  Model        PCIE_BW  vCPUs     RAM  Storage  $/hr     DLPerf  DLP/$  Nvidia Driver Version  Net_up  Net_down  R      Max_Days  machine_id\n1596177  11.4  10x  GTX_1080     5.5      48.0    257.9  4628     2.0000   73.0    36.5   470.63.01              653.3   854.5     99.5   -         638\n2459430  11.5   8x  RTX_A5000    9.1      128.0   515.8  3094     4.0000   209.4   52.3   495.46                 1844.2  2669.6    99.7   12.0      4384\n2459380  11.4   8x  RTX_3070     6.3      12.0     64.0  710      1.4200   67.2    47.3   470.86                 0.0     0.0       99.8   -         4102\n2456624  11.4   8x  RTX_2080_Ti  10.7     32.0    257.9  1653     2.8000   126.4   45.2   470.82.00              14.6    214.2     99.8   28.7      3047\n2456622  11.4   8x  RTX_2080_Ti  10.8     32.0    128.9  1651     2.8000   127.1   45.4   470.82.00              14.9    214.7     99.1   28.7      1569\n2456600  11.5   8x  RTX_2080_Ti  10.9     48.0    256.6  1704     2.4000   125.5   52.3   495.29.05              169.0   169.8     99.7   25.7      4058\n2455617  11.2   8x  RTX_3090     21.7     64.0    515.8  6165     6.4000   261.1   40.8   460.67                 477.6   707.2     99.8   28.7      2980\n2454397  11.2   8x  A100_SXM4    22.4     128.0  2064.1  21568    13.2000  300.1   22.7   460.106.00             708.7   1119.8    99.2   -         4762\n2405590  11.4   8x  RTX_2080_Ti  11.2     48.0    257.9  1629     3.8000   125.5   33.0   470.82.00              389.4   608.8     100.0  1.8       2776\n2364579  11.4   8x  A100_PCIE    18.5     128.0   515.8  4813     14.8000  278.8   18.8   470.74                 472.4   699.0     99.9   28.7      3459\n2281839  11.2   8x  Tesla_V100   11.8     72.0    483.1  1171     5.6000   193.6   34.6   460.67                 493.0   697.8     100.0  28.7      2744\n2281832  11.2   8x  A100_PCIE    17.7     64.0    515.9  5821     14.8000  276.7   18.7   460.91.03              478.2   655.5     99.9   28.7      2901\n2452630  11.4   7x  RTX_3090     6.3      28.0     64.0  61       3.5000   165.5   47.3   470.86                 84.6    84.4      99.3   3.8       4420\n2342561  11.4   7x  RTX_3090     6.1      96.0    257.6  1664     4.5500   149.2   32.8   470.82.00              476.9   671.7     99.4   1.7       4202\n2237983  11.4   7x  RTX_3090     12.5     32.0    257.6  3228     3.1500   204.5   64.9   470.86                 194.4   183.8     99.1   -         4207\n2459511  11.4   6x  RTX_3090     6.2      -       128.8  812      2.8200   150.2   53.2   470.94                 374.4   271.4     99.0   6.7       3129\n2448342  11.5   6x  RTX_A6000    12.4     64.0    515.7  6695     3.6000   169.8   47.2   495.29.05              668.6   1082.6    99.6   -         3624\n2437565  11.4   6x  RTX_3090     23.0     16.0    128.8  1676     5.4000   196.8   36.5   470.94                 34.1    131.5     99.4   -         4238\n2332973  11.2   6x  RTX_3090     11.9     48.0    193.3  1671     3.3000   180.3   54.6   460.84                 582.1   737.6     99.9   25.6      3552\n2459459  11.5   4x  RTX_3090     23.1     32.0    257.8  1363     2.0000   131.2   65.6   495.46                 1954.7  2725.8    99.6   12.0      3059\n2459428  11.5   4x  RTX_A5000    24.6     64.0    515.8  1547     2.0000   104.9   52.4   495.46                 1844.2  2669.6    99.7   12.0      4384\n2459368  11.4   4x  RTX_3090     25.3     48.0     64.2  133      1.3967   130.5   93.4   470.86                 0.0     0.0       99.4   -         4637\n2458968  11.6   4x  RTX_3090     11.7     16.0    128.5  752      1.4000   79.8    57.0   510.39.01              797.8   842.7     99.9   4.0       2555\n2458878  11.6   4x  RTX_3090     11.6     36.0    128.5  1531     1.4000   81.9    58.5   510.39.01              757.1   807.6     99.9   4.0       3646\n2458845  11.6   4x  RTX_3090     3.1      12.0    128.5  369      1.4000   92.4    66.0   510.39.01              725.7   852.2     99.8   4.0       700\n2458838  11.6   4x  RTX_3090     5.7      48.0    128.9  624      1.4000   85.3    60.9   510.39.01              574.9   731.7     99.8   4.0       2217\n2454395  11.2   4x  A100_SXM4    22.9     64.0   2064.1  10784    6.6000   150.0   22.7   460.106.00             708.7   1119.8    99.2   -         4762\n2452632  11.4   4x  RTX_3090     6.3      16.0     64.0  35       2.0000   123.5   61.8   470.86                 84.6    84.4      99.3   3.8       4420\n2450275  11.4   4x  RTX_3080_Ti  12.5     32.0    128.7  817      1.8000   128.8   71.6   470.82.00              278.3   350.4     99.7   -         4260\n2449210  11.5   4x  RTX_3090     11.2     48.0    128.9  324      2.0000   89.7    44.9   495.29.05              688.3   775.4     99.8   -         2764\n2445175  11.4   4x  RTX_3090     11.9     32.0    257.6  1530     2.0000   135.4   67.7   470.86                 868.6   887.1     99.7   25.9      3055\n2444916  11.4   4x  RTX_3090     11.9     16.0    128.7  1576     1.4000   131.8   94.2   470.82.00              39.4    402.3     99.9   -         3759\n2437188  11.4   4x  Tesla_P100   11.7     24.0     95.2  2945     0.7200   44.8    62.2   470.82.00              10.9    76.2      99.5   0.1       3969\n2437179  11.4   4x  Tesla_P100   11.7     32.0    192.1  3070     0.7200   44.8    62.3   470.82.00              11.1    66.0      99.2   0.0       4159\n2431606  11.4   4x  RTX_3090     17.9     32.0    110.7  330      1.8400   134.3   73.0   470.82.01              584.6   813.4     99.7   4.4       4079\n2419191  11.4   4x  RTX_2080_Ti  6.3      32.0     64.4  837      2.0000   64.7    32.4   470.63.01              40.5    205.9     99.7   -         162\n2405589  11.4   4x  RTX_2080_Ti  10.8     24.0    257.9  815      1.9000   62.8    33.0   470.82.00              389.4   608.8     100.0  1.8       2776\n2392087  11.4   4x  RTX_A6000    10.8     32.0    515.9  1247     1.8000   64.5    35.8   470.94                 669.9   705.4     99.1   10.9      4782\n2377227  11.2   4x  RTX_3090     6.3      24.0     64.3  1638     2.0000   128.3   64.1   460.32.03              37.8    145.0     99.7   3.0       2672\n2349173  11.4   4x  RTX_3090     23.2     48.0    128.7  1475     2.0000   107.4   53.7   470.86                 33.2    84.2      99.8   47.3      3949\n2338635  11.4   4x  RTX_3090     23.0     32.0    128.5  3151     1.6000   108.8   68.0   470.86                 33.8    86.4      99.6   47.4      3948\n2303959  11.2   4x  RTX_3090     11.7     28.0    128.8  791      2.1200   131.3   61.9   460.32.03              519.7   570.7     99.5   -         3042\n2281830  11.2   4x  A100_PCIE    18.1     32.0    515.9  2910     7.4000   143.6   19.4   460.91.03              478.2   655.5     99.9   28.7      2901\n2193726  11.4   4x  RTX_3090     12.4     32.0    128.8  1646     3.6000   153.9   42.8   470.82.01              33.3    137.5     99.5   -         3434\n1737692  11.2   4x  RTX_3070     6.3      28.0    128.5  656      2.8000   37.5    13.4   460.91.03              452.6   703.2     99.6   -         3510\n```\n\n#### Launching Instances\nTo create an instance of type 2459368 (using an ID from the search) with the vastai/tensorflow image\nand 32 GB of disk storage\n\n```vast create instance 2459368 --image vastai/tensorflow --disk 32```\n\n## Install\n\nIf you followed the instructions in [Quickstart](#Quickstart) you have already installed the script that contains\nmost of the CLI functionality. If you wish to print PDF format invoices you will need a few other\nthings. First, you'll need the vast_pdf.py script. This can be found in this repository in the main\ndirectory at [vast_pdf.py](vast_pdf.py). This script should be present in the same directory as the\n`vast.py` script. It makes use of a third party library called Borb to create the PDF invoices. To install\nthis run the command `pip3 install borb`\n\n## Commands\n\nThe CLI API is all contained in a python script called `vast.py`.\nThis script can be called with various commands as arguments. Commands follow\na simple \"verb-object\" pattern. As an example, consider \"show machines\". To run this\ncommand use `vast show machines`\n\n## List of commands and associated help message\n\n```\nvast [-h] [--url URL] [--raw] [--api-key API_KEY] command ...\n\npositional arguments:\n  command               command to run. one of:\n    help                print this help message\n    copy                Copy directories between instances and/or local\n    search offers       Search for instance types using custom query\n    show instances      Display user's current instances\n    ssh-url             ssh url helper\n    scp-url             scp url helper\n    show machines       [Host] Show hosted machines\n    show invoices       Get billing history reports\n    show user           Get current user data\n    generate pdf-invoices\n    list machine        [Host] list a machine for rent\n    unlist machine      [Host] Unlist a listed machine\n    remove defjob       [Host] Delete default jobs\n    reboot instance     Reboot (stop/start) an instance\n    start instance      Start a stopped instance\n    stop instance       Stop a running instance\n    label instance      Assign a string label to an instance\n    destroy instance    Destroy an instance (irreversible, deletes data)\n    execute             Execute a (constrained) remote command on a machine\n    logs                Get the logs for an instance\n    set defjob          [Host] Create default jobs for a machine\n    create instance     Create a new instance\n    change bid          Change the bid price for a spot/interruptible instance\n    set min-bid         [Host] Set the minimum bid/rental price for a machine\n    set api-key         Set api-key (get your api-key from the console/CLI)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --url URL             server REST api url\n  --raw                 output machine-readable json\n  --api-key API_KEY     api key. defaults to using the one stored in\n                        ~/.vast_api_key\n\nUse 'vast COMMAND --help' for more info about a command\n\n```\n#### change bid -- Change the bid price for a spot/interruptible instance\n\n```\nvast change bid id [--price PRICE]\n\npositional arguments:\n  id                 id of instance type to change bid\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --price PRICE      per machine bid price in $/hour\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\nChange the current bid price of instance id to PRICE.\nIf PRICE is not specified, then a winning bid price is used as the default.\n\n```\n---\n#### copy -- Copy directories between instances and/or local\n\n```\nvast copy src dst\n\npositional arguments:\n  src                   instance_id:/path to source of object to copy.\n  dst                   instance_id:/path to target of copy operation.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -i IDENTITY, --identity IDENTITY\n                        Location of ssh private key\n  --url URL             server REST api url\n  --raw                 output machine-readable json\n  --api-key API_KEY     api key. defaults to using the one stored in\n                        ~/.vast_api_key\n\nCopies a directory from a source location to a target location. Each of source and destination\ndirectories can be either local or remote, subject to appropriate read and write\npermissions required to carry out the action. The format for both src and dst is [instance_id:]path.\nExamples:\n vast copy 11824:/data/test 12371:/temp\n vast copy 11824:/data/test data/test\n vast copy data/test 11824:/data/test\n\nThe first example copy syncs the directory '/tmp' in instance 12371 from the directory '/data/test' in instance 11824.\nThe second example copy syncs the relative directory 'data/test' on the local machine from '/data/test' in instance 11824.\nThe third example copy syncs the directory '/data/test' in instance 11824 from the relative directory 'data/test' on the local machine.\n\n```\n---\n#### create instance -- Create a new instance\n\n```\nvast create instance id [OPTIONS] [--args ...]\n\npositional arguments:\n  id                    id of instance type to launch\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --price PRICE         per machine bid price in $/hour\n  --disk DISK           size of local disk partition in GB\n  --image IMAGE         docker container image to launch\n  --login LOGIN         docker login arguments for private repo\n                        authentication, surround with ''\n  --label LABEL         label to set on the instance\n  --onstart ONSTART     filename to use as onstart script\n  --onstart-cmd ONSTART_CMD\n                        contents of onstart script as single argument\n  --ssh                 Launch as an ssh instance type.\n  --jupyter             Launch as a jupyter instance instead of an ssh\n                        instance.\n  --direct              Use (faster) direct connections for jupyter & ssh.\n  --jupyter-dir JUPYTER_DIR\n                        For runtype 'jupyter', directory in instance to use to\n                        launch jupyter. Defaults to image's working directory.\n  --jupyter-lab         For runtype 'jupyter', Launch instance with jupyter\n                        lab.\n  --lang-utf8           Workaround for images with locale problems: install\n                        and generate locales before instance launch, and set\n                        locale to C.UTF-8.\n  --python-utf8         Workaround for images with locale problems: set\n                        python's locale to C.UTF-8.\n  --env ENV             env variables and port mapping options, surround with\n                        ''\n  --args ...            list of arguments passed to container ENTRYPOINT.\n                        Onstart is recommended for this purpose.\n  --create-from CREATE_FROM\n                        Existing instance id to use as basis for new instance.\n                        Instance configuration should usually be identical, as\n                        only the difference from the base image is copied.\n  --force               Skip sanity checks when creating from an existing\n                        instance\n  --url URL             server REST api url\n  --raw                 output machine-readable json\n  --api-key API_KEY     api key. defaults to using the one stored in\n                        ~/.vast_api_key\n\nExamples:\nvast create instance 384827 --image bobsrepo/pytorch:latest --login '-u bob -p 9d8df!fd89ufZ docker.io' --jupyter --direct --env '-e TZ=PDT -e XNAME=XX4 -p 22:22 -p 8080:8080' --disk 20\nvast create instance 344521 --image anthonytatowicz/eth-cuda-miner --disk 20 --args -U -S us-west1.nanopool.org:9999 -O 0x5C9314b28Fbf25D1d054a9184C0b6abF27E20d95 --farm-recheck 200\n\n```\n---\n#### destroy instance -- Destroy an instance (irreversible, deletes data)\n\n```\nvast destroy instance id [-h] [--api-key API_KEY] [--raw]\n\npositional arguments:\n  id                 id of instance to delete\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### execute -- Execute a (constrained) remote command on a machine\n\n```\nvast execute ID COMMAND\n\npositional arguments:\n  ID                 id of instance to execute on\n  COMMAND            command to execute\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### generate pdf-invoices -- \n\n```\nvast generate pdf_invoices [OPTIONS]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -q, --quiet           only display numeric ids\n  -s START_DATE, --start_date START_DATE\n                        start date and time for report. Many formats accepted\n                        (optional)\n  -e END_DATE, --end_date END_DATE\n                        end date and time for report. Many formats accepted\n                        (optional)\n  -c, --only_charges    Show only charge items.\n  -p, --only_credits    Show only credit items.\n  --url URL             server REST api url\n  --raw                 output machine-readable json\n  --api-key API_KEY     api key. defaults to using the one stored in\n                        ~/.vast_api_key\n\n```\n---\n#### help -- print this help message\n\n```\nvast help [-h] [--url URL] [--raw] [--api-key API_KEY] [subcommand]\n\npositional arguments:\n  subcommand\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### label instance -- Assign a string label to an instance\n\n```\nvast label instance <id> <label>\n\npositional arguments:\n  id                 id of instance to label\n  label              label to set\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### list machine -- [Host] list a machine for rent\n\n```\nvast list machine id [--price_gpu PRICE_GPU] [--price_inetu PRICE_INETU] [--price_inetd PRICE_INETD] [--api-key API_KEY]\n\npositional arguments:\n  id                    id of machine to list\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -g PRICE_GPU, --price_gpu PRICE_GPU\n                        per gpu rental price in $/hour (price for active\n                        instances)\n  -s PRICE_DISK, --price_disk PRICE_DISK\n                        storage price in $/GB/month (price for inactive\n                        instances), default: $0.15/GB/month\n  -u PRICE_INETU, --price_inetu PRICE_INETU\n                        price for internet upload bandwidth in $/GB\n  -d PRICE_INETD, --price_inetd PRICE_INETD\n                        price for internet download bandwidth in $/GB\n  -m MIN_CHUNK, --min_chunk MIN_CHUNK\n                        minimum amount of gpus\n  -e END_DATE, --end_date END_DATE\n                        unix timestamp of the available until date (optional)\n  --url URL             server REST api url\n  --raw                 output machine-readable json\n  --api-key API_KEY     api key. defaults to using the one stored in\n                        ~/.vast_api_key\n\n```\n---\n#### logs -- Get the logs for an instance\n\n```\nvast logs [OPTIONS] INSTANCE_ID\n\npositional arguments:\n  INSTANCE_ID        id of instance\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --tail TAIL        Number of lines to show from the end of the logs (default\n                     '1000')\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### reboot instance -- Reboot (stop/start) an instance\n\n```\nvast reboot instance <id> [--raw]\n\npositional arguments:\n  id                 id of instance to reboot\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### remove defjob -- [Host] Delete default jobs\n\n```\nvast remove defjob [-h] [--url URL] [--raw] [--api-key API_KEY] id\n\npositional arguments:\n  id                 id of machine to remove default instance from\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### scp-url -- scp url helper\n\n```\nvast scp-url\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --id ID            id of instance\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### search offers -- Search for instance types using custom query\n\n```\nvast search offers [--help] [--api-key API_KEY] [--raw] <query>\n\npositional arguments:\n  query                 Query to search for. default: 'external=false\n                        rentable=true verified=true', pass -n to ignore\n                        default\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -t TYPE, --type TYPE  Show 'bid'(interruptible) or 'on-demand' offers.\n                        default: on-demand\n  -i, --interruptible   Alias for --type=bid\n  -b, --bid             Alias for --type=bid\n  -d, --on-demand       Alias for --type=on-demand\n  -n, --no-default      Disable default query\n  --disable-bundling    Show identical offers. This request is more heavily\n                        rate limited.\n  --storage STORAGE     Amount of storage to use for pricing, in GiB.\n                        default=5.0GiB\n  -o ORDER, --order ORDER\n                        Comma-separated list of fields to sort on. postfix\n                        field with - to sort desc. ex: -o\n                        'num_gpus,total_flops-'. default='score-'\n  --url URL             server REST api url\n  --raw                 output machine-readable json\n  --api-key API_KEY     api key. defaults to using the one stored in\n                        ~/.vast_api_key\n\nQuery syntax:\n\n    query = comparison comparison...\n    comparison = field op value\n    field = <name of a field>\n    op = one of: <, <=, ==, !=, >=, >, in, notin\n    value = <bool, int, float, etc> | 'any'\n\nnote: to pass '>' and '<' on the command line, make sure to use quotes\n\nExamples:\n\n    ./vast search offers 'compute_cap > 610 total_flops < 5'\n    ./vast search offers 'reliability > 0.99  num_gpus>=4' -o 'num_gpus-'\n    ./vast search offers 'rentable = any'\n\nAvailable fields:\n\n      Name                  Type       Description\n\n    bw_nvlink               float     bandwidth NVLink\n    compute_cap:            int       cuda compute capability*100  (ie:  650 for 6.5, 700 for 7.0)\n    cpu_cores:              int       # virtual cpus\n    cpu_cores_effective:    float     # virtual cpus you get\n    cpu_ram:                float     system RAM in gigabytes\n    cuda_vers:              float     cuda version\n    direct_port_count       int       open ports on host's router\n    disk_bw:                float     disk read bandwidth, in MB/s\n    disk_space:             float     disk storage space, in GB\n    dlperf:                 float     DL-perf score  (see FAQ for explanation)\n    dlperf_usd:             float     DL-perf/$\n    dph:                    float     $/hour rental cost\n    driver_version          string    driver version in use on a host.\n    duration:               float     max rental duration in days\n    external:               bool      show external offers\n    flops_usd:              float     TFLOPs/$\n    gpu_mem_bw:             float     GPU memory bandwidth in GB/s\n    gpu_ram:                float     GPU RAM in GB\n    gpu_frac:               float     Ratio of GPUs in the offer to gpus in the system\n    has_avx:                bool      CPU supports AVX instruction set.\n    id:                     int       instance unique ID\n    inet_down:              float     internet download speed in Mb/s\n    inet_down_cost:         float     internet download bandwidth cost in $/GB\n    inet_up:                float     internet upload speed in Mb/s\n    inet_up_cost:           float     internet upload bandwidth cost in $/GB\n    machine_id              int       machine id of instance\n    min_bid:                float     current minimum bid price in $/hr for interruptible\n    num_gpus:               int       # of GPUs\n    pci_gen:                float     PCIE generation\n    pcie_bw:                float     PCIE bandwidth (CPU to GPU)\n    reliability:            float     machine reliability score (see FAQ for explanation)\n    rentable:               bool      is the instance currently rentable\n    rented:                 bool      is the instance currently rented\n    storage_cost:           float     storage cost in $/GB/month\n    total_flops:            float     total TFLOPs from all GPUs\n    verified:               bool      is the machine verified\n\n```\n---\n#### set api-key -- Set api-key (get your api-key from the console/CLI)\n\n```\nvast set api-key APIKEY\n\npositional arguments:\n  new_api_key        Api key to set as currently logged in user\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### set defjob -- [Host] Create default jobs for a machine\n\n```\nvast set defjob id [--api-key API_KEY] [--price_gpu PRICE_GPU] [--price_inetu PRICE_INETU] [--price_inetd PRICE_INETD] [--image IMAGE] [--args ...]\n\npositional arguments:\n  id                    id of machine to launch default instance on\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --price_gpu PRICE_GPU\n                        per gpu rental price in $/hour\n  --price_inetu PRICE_INETU\n                        price for internet upload bandwidth in $/GB\n  --price_inetd PRICE_INETD\n                        price for internet download bandwidth in $/GB\n  --image IMAGE         docker container image to launch\n  --args ...            list of arguments passed to container launch\n  --url URL             server REST api url\n  --raw                 output machine-readable json\n  --api-key API_KEY     api key. defaults to using the one stored in\n                        ~/.vast_api_key\n\n```\n---\n#### set min-bid -- [Host] Set the minimum bid/rental price for a machine\n\n```\nvast set min_bid id [--price PRICE]\n\npositional arguments:\n  id                 id of machine to set min bid price for\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --price PRICE      per gpu min bid price in $/hour\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\nChange the current min bid price of machine id to PRICE.\n\n```\n---\n#### show instances -- Display user's current instances\n\n```\nvast show instances [--api-key API_KEY] [--raw]\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### show invoices -- Get billing history reports\n\n```\nvast show invoices [OPTIONS]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -q, --quiet           only display numeric ids\n  -s START_DATE, --start_date START_DATE\n                        start date and time for report. Many formats accepted\n                        (optional)\n  -e END_DATE, --end_date END_DATE\n                        end date and time for report. Many formats accepted\n                        (optional)\n  -c, --only_charges    Show only charge items.\n  -p, --only_credits    Show only credit items.\n  --url URL             server REST api url\n  --raw                 output machine-readable json\n  --api-key API_KEY     api key. defaults to using the one stored in\n                        ~/.vast_api_key\n\n```\n---\n#### show machines -- [Host] Show hosted machines\n\n```\nvast show machines [OPTIONS]\n\noptional arguments:\n  -h, --help         show this help message and exit\n  -q, --quiet        only display numeric ids\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### show user -- Get current user data\n\n```\nvast show user [OPTIONS]\n\noptional arguments:\n  -h, --help         show this help message and exit\n  -q, --quiet        display information about user\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### ssh-url -- ssh url helper\n\n```\nvast ssh-url\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --id ID            id of instance\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### start instance -- Start a stopped instance\n\n```\nvast start instance <id> [--raw]\n\npositional arguments:\n  id                 id of instance to start/restart\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### stop instance -- Stop a running instance\n\n```\nvast stop instance [--raw] <id>\n\npositional arguments:\n  id                 id of instance to stop\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n#### unlist machine -- [Host] Unlist a listed machine\n\n```\nvast unlist machine <id>\n\npositional arguments:\n  id                 id of machine to unlist\n\noptional arguments:\n  -h, --help         show this help message and exit\n  --url URL          server REST api url\n  --raw              output machine-readable json\n  --api-key API_KEY  api key. defaults to using the one stored in\n                     ~/.vast_api_key\n\n```\n---\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Vast.ai Python CLI",
    "version": "0.2.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/vast-ai/vast-python/issues",
        "Homepage": "https://github.com/vast-ai/vast-python"
    },
    "split_keywords": [
        "cli",
        " vast.ai",
        " vast.ai",
        " vast",
        " vastai"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c7e22ac542d22f56388aab92956c54cc8c46f0e9398cdf97303f063880554c0",
                "md5": "ee7b4b384136b255d6398c124b68b48c",
                "sha256": "5ae16ad728f9f8ffdbcdfb40ec7edbc2de6c6f58c6d190a016fda9c8fba56e34"
            },
            "downloads": -1,
            "filename": "vastai-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ee7b4b384136b255d6398c124b68b48c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 43579,
            "upload_time": "2024-03-20T23:22:37",
            "upload_time_iso_8601": "2024-03-20T23:22:37.042434Z",
            "url": "https://files.pythonhosted.org/packages/3c/7e/22ac542d22f56388aab92956c54cc8c46f0e9398cdf97303f063880554c0/vastai-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7e266ef9914c05d2a28125723be88d584409c27eb0d1ab235cd44019c272956a",
                "md5": "d830d48fa63298459ce7d405567095dc",
                "sha256": "a506c257176de8a01774ef18fd0a28075668d5173fb362a67e7779eab2399bc5"
            },
            "downloads": -1,
            "filename": "vastai-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d830d48fa63298459ce7d405567095dc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 59009,
            "upload_time": "2024-03-20T23:22:38",
            "upload_time_iso_8601": "2024-03-20T23:22:38.504455Z",
            "url": "https://files.pythonhosted.org/packages/7e/26/6ef9914c05d2a28125723be88d584409c27eb0d1ab235cd44019c272956a/vastai-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-20 23:22:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vast-ai",
    "github_project": "vast-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "vastai"
}
        
Elapsed time: 0.19997s