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.3.tar.gz (30.7 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.3-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fastvm-0.2.3.tar.gz
Algorithm Hash digest
SHA256 c2d219cb08e84f6a32c7a2240be22e3c4060309bd242561b855a3a3483e5f17d
MD5 21d656a7a48b9ac990c4a4ed66decc38
BLAKE2b-256 a2447ea1c7c10fec9c865306919cbb213ea23f3c9baf4e02367b88c22f1a021d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for fastvm-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cc8f62aa61a50d8a9a360d03c9d2302db83b6899a1a070529ab38d46ea8887fa
MD5 5ad59e826337d7a206c56e6af9ba7ebc
BLAKE2b-256 3e2541e406dd95d1b6e2521d5ae06bd625adb885654b444394576155e33e42d0

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