Skip to main content

Run your code in the cloud with a single function call

Project description

Verlex

Run your code in the cloud for the price of a coffee.

Verlex is a Python SDK that lets you execute code on the cheapest available cloud infrastructure across AWS, GCP, and Azure — all with a single function call.

Installation

pip install verlex

Quick Start

import verlex

def train_model():
    import torch
    model = torch.nn.Linear(100, 10)
    # Your training code here...
    return {"accuracy": 0.95}

# Run it in the cloud — one line!
result = verlex.cloud(train_model, api_key="gw_your_key")
print(result)

Basic Usage

One-Liner (Simplest)

Every function works as a standalone call — just pass your api_key:

import verlex

# Run in the cloud
result = verlex.cloud(train_model, api_key="gw_your_key")

# Analyze resources
rec = verlex.analyze(train_model, api_key="gw_your_key")

# Estimate cost
costs = verlex.estimate_cost(train_model, api_key="gw_your_key")

Specifying Resources

result = verlex.cloud(
    train_model,
    api_key="gw_your_key",
    gpu="A100",       # Specific GPU type
    gpu_count=2,      # Multiple GPUs
    memory="64GB",    # Memory requirement
    timeout=7200,     # 2 hour timeout
)

Context Manager (Multi-step Sessions)

with verlex.GateWay(api_key="gw_your_key") as gw:
    rec = gw.analyze(train_model)
    costs = gw.estimate_cost(train_model)
    result = gw.run(train_model)

Async Execution

with verlex.GateWay(api_key="gw_your_key") as gw:
    # Submit jobs (non-blocking)
    job1 = gw.run_async(train_model_1)
    job2 = gw.run_async(train_model_2)

    # Wait for results when needed
    result1 = job1.result()
    result2 = job2.result()

Pricing Modes

Choose your price-speed tradeoff with a single fast flag:

Mode Wait Time Best For
Performance (fast=True) Immediate Time-sensitive workloads
Standard (fast=False) Up to 10 min Batch jobs, cost-sensitive
# Performance mode - immediate execution
result = verlex.cloud(my_function, api_key="gw_your_key", fast=True)

# Standard mode (default) - wait for lower prices
result = verlex.cloud(my_function, api_key="gw_your_key")

Authentication

Option 1: Direct API Key (Inline)

result = verlex.cloud(my_function, api_key="gw_your_key")

Option 2: Environment Variable

export VERLEX_API_KEY="gw_your_key"
result = verlex.cloud(my_function)  # picks up VERLEX_API_KEY

Automatic Cloud Offloading

Don't know which functions are heavy? Let Verlex figure it out:

import verlex
verlex.overflow(fast=True)

# Your code runs normally. When CPU or memory exceeds 85%,
# functions are automatically offloaded to the cheapest cloud.
data = load_data()
result = train_model(data)   # system overloaded? → cloud
evaluate(result)             # resources free → runs locally

Install with: pip install 'verlex[overflow]'

Agent Daemon

Monitor your system and offload heavy Python processes:

# Watch for heavy processes and offer to offload
verlex agent watch

# Auto-offload without prompting
verlex agent watch --auto

# Submit a script directly via source-code pipeline
verlex agent run train.py --gpu A100

Install with: pip install 'verlex[agent]'

CLI

# Login
verlex login

# Run a script
verlex run train.py

# Run with specific GPU
verlex run train.py --gpu A100

# Check job status
verlex jobs

# View account info
verlex whoami

Supported Cloud Providers

  • AWS - EC2, with Spot instances (up to 90% off)
  • GCP - Compute Engine, with Preemptible VMs (up to 91% off)
  • Azure - VMs, with Spot instances (up to 81% off)

Links

Contact

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

verlex-0.10.0.tar.gz (1.8 MB view details)

Uploaded Source

Built Distributions

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

verlex-0.10.0-cp312-cp312-win_amd64.whl (950.7 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.10.0-cp312-cp312-macosx_10_13_universal2.whl (2.3 MB view details)

Uploaded CPython 3.12macOS 10.13+ universal2 (ARM64, x86-64)

verlex-0.10.0-cp311-cp311-win_amd64.whl (965.5 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.10.0-cp311-cp311-macosx_10_9_universal2.whl (2.3 MB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

verlex-0.10.0-cp310-cp310-win_amd64.whl (958.1 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.10.0-cp310-cp310-macosx_10_9_universal2.whl (2.3 MB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file verlex-0.10.0.tar.gz.

File metadata

  • Download URL: verlex-0.10.0.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for verlex-0.10.0.tar.gz
Algorithm Hash digest
SHA256 7120588e843d3fc8bf3071fa511dc0eb2a0994964c899bf15c161e0fc8dcd11c
MD5 2e151d29cb4745fbe6dead94550767ab
BLAKE2b-256 8fe2a4492566a3f5f39e7ad4b4a24326798032dfc9f4e12c7f45d02dc49ed8ee

See more details on using hashes here.

File details

Details for the file verlex-0.10.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: verlex-0.10.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 950.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for verlex-0.10.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bef0b0e9fc9d6119521c4bc368bdc0c7955fa9ef505785bf1d5d85b48f1a2396
MD5 dede03495b6027cccaa46cac692cf7f4
BLAKE2b-256 ba1ff1e8297783b4073486c11a4f78ec23b70db404146e2ad0d0e8a27da8372e

See more details on using hashes here.

File details

Details for the file verlex-0.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for verlex-0.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ac7088383c2987042461fcdfcf63ccf7480a95acf7037163141963d1befeee49
MD5 06f340779244a484cb1b70d3f7204319
BLAKE2b-256 938bdf7add4d714671077911c52c705bdde9fbf881b4b0887f42ac5ea4f45755

See more details on using hashes here.

File details

Details for the file verlex-0.10.0-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for verlex-0.10.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 e3779e36f165cbb3f29394e5b65883fef7e771340658921bda9056a83fb0aca3
MD5 a3ad9c091e010e13e35b1ef93d09139d
BLAKE2b-256 2e211056f9947ad88db0655f0400f77754dc7bacf3f7bf49aa67356e433646e0

See more details on using hashes here.

File details

Details for the file verlex-0.10.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: verlex-0.10.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 965.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for verlex-0.10.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c85b171045712f603ff9d3810cffceec2674b04524c6fd7c46a7c3ab2e944ad5
MD5 a1db468979166f427d52fea69ac88801
BLAKE2b-256 6ff9b2cf7ad108ec0e06560bd4e08947005f31b2cb3a075b1b01510a07616aff

See more details on using hashes here.

File details

Details for the file verlex-0.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for verlex-0.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61f47670bce6405484270c8126296b47ec413d00d78950bba819d800be8de788
MD5 73c99b3823ccb1e44dd8b1030386afb2
BLAKE2b-256 c33d4045ec36d2a4047b219301653d437a601b67271114f9910f1bfa1d19bf73

See more details on using hashes here.

File details

Details for the file verlex-0.10.0-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for verlex-0.10.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ec267fd566c9d4e8adcab2209e05e9656e07ed3609c40705ff6c6ed5bbc2e8d1
MD5 a66369f30092f8f53da90d3b6e9a6268
BLAKE2b-256 0b7aa7406273cdda9eac3dbe0dbc160c3f0d8821c7bd3fa18e133ae9fb01cea7

See more details on using hashes here.

File details

Details for the file verlex-0.10.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: verlex-0.10.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 958.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for verlex-0.10.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 67454cb69b4741e4916f45c13fbc770dd43a8d4e5a172e626515147c544829c6
MD5 bd26205b087bbde505cf0268acde790d
BLAKE2b-256 84e9d67a64c238742d5ef1bec611f4d434d09c45bf3805b948bc453bce1ab072

See more details on using hashes here.

File details

Details for the file verlex-0.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for verlex-0.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7a1fedf2b7341bbba9a0a5bd53e29d1effd188d0d336de94e86fbb4c46e132e8
MD5 98b01068594aa9018215cb4705d2f18f
BLAKE2b-256 bf248d47225f58327bfc1af8310db92f2decb067571f3ca7e1a18712ed921919

See more details on using hashes here.

File details

Details for the file verlex-0.10.0-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for verlex-0.10.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 870affbcc22397a59f3bdba3c226acddf874bba2d572f023cededcb6db7fd5c7
MD5 b01171edf905b594bf12346767eee141
BLAKE2b-256 d941001e893c0a31d7ea08d512f6483f58fd715fb0afb2a76835cf1ca8ec9bac

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