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.0.tar.gz (29.0 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.0-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fastvm-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5688449f72b46242ce8ca37904f847e2586c0c6da7cf2b11b08c28d5bd3fccd0
MD5 0bff242e9a22efb3890cf133c814b671
BLAKE2b-256 d666eb3a6411167c0bbbd97eb85773db85df51664bd687bc277dd0588f4f001d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for fastvm-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08e1f2462169a2b5d34a1ea04eda33dc83030b175bbed161b44eb71d18ee0087
MD5 40fb79995cddd536d60bbe153d98e971
BLAKE2b-256 24f3202ab4c0eca8646962368fd098abbf10273eb5c28563551560925d0ced59

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