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

With ML dependencies:

pip install verlex[ml]

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.8.40.tar.gz (889.5 kB view details)

Uploaded Source

Built Distributions

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

verlex-0.8.40-cp312-cp312-win_amd64.whl (471.3 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.40-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.8.40-cp312-cp312-macosx_10_13_universal2.whl (1.1 MB view details)

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

verlex-0.8.40-cp311-cp311-win_amd64.whl (490.8 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.40-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.8.40-cp311-cp311-macosx_10_9_universal2.whl (1.1 MB view details)

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

verlex-0.8.40-cp310-cp310-win_amd64.whl (486.9 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.40-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.8.40-cp310-cp310-macosx_10_9_universal2.whl (1.1 MB view details)

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

File details

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

File metadata

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

File hashes

Hashes for verlex-0.8.40.tar.gz
Algorithm Hash digest
SHA256 c97dbfb5a49fa7462264ea697334447f050471f8490b04a369d6464cee89c8b4
MD5 a6e512cde68e00f2b926e244df6250bd
BLAKE2b-256 fd1f7a5fbcc00d2d45387f9f1d0b004b17c5f87588718b8e8573b21242643ff0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.40-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 471.3 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.8.40-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fd1142faf6643ca2369689fcc36c830d26293773bfa966b96eb8c4fcf9a4e340
MD5 c587e1dfaede44b2fb0168178925491b
BLAKE2b-256 c147a0b69b4e0b9a0fb1482b57bd3c7840ea01d7115cefbf3b3a60a001a14cfb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.40-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e9cebc3d25dbe528e75a8cfcdcc1f924ec4f5101cbc0f47f15c48c90e9940ad1
MD5 f85f7e5398aec143571bcc9f57734f11
BLAKE2b-256 28cf5eb525fe85d444e6541832979147fb0c184bb17a20ec7196579db26a1734

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.40-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 cf9efa6512b5d497a5ff946762beba842bef1dd9299354a5165464be1ff71092
MD5 19238fbeae60797838eab52ce96d7d02
BLAKE2b-256 d00dd6b421deb7ef8a52e5c4075f74198962cfd759ca9c3097ceda520d5ef22c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.40-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 490.8 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.8.40-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4572a8f9c89ee95c1389b271448d8a2a9d4e1a8b3780c00534bc66e95072a45c
MD5 16bdc08f10d78b4f729f2dff4d5c0a36
BLAKE2b-256 a756fb0628ebca2e6ca4571bea249d697f6ef65ee1a9a1b6f2ba6ebc66481070

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.40-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b217a8aee0a16f739f545a3ee95d3c2265c5792cf986b80220106a802137a46f
MD5 61a9e2ad67b4aaa43ddb8f30f66b2bce
BLAKE2b-256 5dbaa3b416176fad9629e945e0dff2b505b0d0827c6b6cf9663e5ba811818bd8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.40-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 578377f6cb4a15be0229af3b9bffbae9fab0c99600403f6d61c475fcd4db0716
MD5 ccc163b750096e345b150331c5a39593
BLAKE2b-256 31b9f19ed29c0174954f92c4f06920d8a848f8874356325702a002f2a2c4afcf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.40-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 486.9 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.8.40-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0cc15f43310b73cd33938156559602e5f92f886bd8401883385f1fa95a700aed
MD5 cb02fa0bd82ce0b9c8f50baf83477aa4
BLAKE2b-256 4c4006b8bb43a4235b792fa39f8ab0047bf624da6f5eefd0c7c7eace4175131c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.40-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8bc5c79cb21c97d0a93112a4ecb0df4bf32527f60f3274151edb76636c574e0f
MD5 08e14279a133cc5467357568615627fe
BLAKE2b-256 40a1665d3461095364fc0abe7a38348d9366412021266d224b85821aa5b5e085

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.40-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 e813c17473069e179ab8bf206424019afc8805d37252a35866a82b0ff5221a38
MD5 bbfa1da7a4ccd03c14e7b66cc3371819
BLAKE2b-256 f358c1d8712c99e55051f86f982df80b7743665419ece2afb39e6dfc5fab8b18

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