Skip to main content

Async Python SDK and CLI for the FastVM microVM platform

Project description

FastVM Python SDK & CLI

Async Python SDK and CLI for the FastVM microVM platform. Launch, snapshot, restore, and run commands on microVMs over HTTP/2 with multiplexed connections.

Installation

pip install fastvm

or with uv:

uv add fastvm

For CLI-only use (isolated install, puts fastvm on your PATH):

pipx install fastvm
# or
uv tool install fastvm

CLI Quick Start

# Set your API key (one-time)
export FASTVM_API_KEY=your-key
# or persist it:
fastvm config set api_key your-key

# Launch a VM and open an interactive console
fastvm launch --name dev --console

# List VMs
fastvm vm ls

# Run a command on a VM (by name or short ID)
fastvm vm exec dev "uname -a"

# Ephemeral one-shot: launch, run, destroy
fastvm run "apt update && python3 --version"

# Snapshots
fastvm snapshot create dev --name my-snap
fastvm snapshot restore my-snap --console

# Quotas
fastvm quota

VMs and snapshots can be referenced by full ID, short ID prefix (git-style), or name.

Enable tab completion (one-time):

# bash
eval "$(_FASTVM_COMPLETE=bash_source fastvm)"
# zsh
eval "$(_FASTVM_COMPLETE=zsh_source fastvm)"

Run fastvm --help for the full command reference.

SDK Quick Start

from fastvm import FastVM

# Also configurable via the FASTVM_API_KEY environment variable.
async with FastVM(api_key="your-key") as client:
    vm = await client.launch(machine="c1m2")
    snapshot = await client.snapshot(vm, name="my-snap")
    restored = await client.restore(snapshot)
    result = await client.run(restored, "echo hello")

    print(result.stdout)  # hello

SDK API Overview

Method Description
launch() Launch a new microVM
restore() Restore a VM from a snapshot
run() Execute a command on a VM
snapshot() Create a point-in-time snapshot
get() / list() Fetch VM state
remove() Delete a VM
list_snapshots() / remove_snapshot() Manage snapshots
set_firewall() / patch_firewall() Configure IPv6 ingress firewall
console_token() Request a console session token
quotas() Fetch organization quota usage

Documentation

See the FastVM documentation for the full API reference and guides.

Examples

uv run examples/create-vm.py      # launch a VM and run commands
uv run examples/large_fanout.py   # snapshot + restore 10 VMs concurrently

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastvm-0.2.1.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastvm-0.2.1-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file fastvm-0.2.1.tar.gz.

File metadata

  • Download URL: fastvm-0.2.1.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for fastvm-0.2.1.tar.gz
Algorithm Hash digest
SHA256 15a2befdb49e286a5db2a23c16e97e08f0564d9d4924147b40619f49a60ae681
MD5 d427f858adf7b50668f1d955795300b3
BLAKE2b-256 2e492d823ba2ad0fcf32c3f595959436624ad3d89e9f9b933df31c67734798fb

See more details on using hashes here.

File details

Details for the file fastvm-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: fastvm-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for fastvm-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f9ae8e33154c556db1c6facdb940c81ffb3b3267ac2abbb2f28043fcabc4027c
MD5 7b6d840945e42620fae67d5d12563a85
BLAKE2b-256 949ab3022a5d9468e9cb06b9461bbbebe26d8eb5a8c53ea2545778029603b678

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page