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.11.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.11.0-cp312-cp312-win_amd64.whl (952.1 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.11.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.11.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.11.0-cp311-cp311-win_amd64.whl (966.9 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.11.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.11.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.11.0-cp310-cp310-win_amd64.whl (959.4 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.11.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.11.0-cp310-cp310-macosx_10_9_universal2.whl (2.4 MB view details)

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

File details

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

File metadata

  • Download URL: verlex-0.11.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.11.0.tar.gz
Algorithm Hash digest
SHA256 e43dd921948e0f4fc1024dce5e9b9b49382d04ab2519f2b868eaac05b1ed1208
MD5 760399e4375c6caacfa25b08a0a93ca1
BLAKE2b-256 68d38853823667fbb4887397d4dff71a10da6c84559cc7e57c73ab5e0fa800fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.11.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 952.1 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.11.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 11d22774231c69ea0c697d2f6c1877ee780eb294c7f213d8e873bb609a63c10a
MD5 c91bce60a188993b95b89f82359060e3
BLAKE2b-256 9e867245f0987646fb823b3f3631e0b9339cdf76cb8e6c00f34b288f2c14fb1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e43a1c762149272ae75910360e915204e2bead63ef6595c317e218dd9111450b
MD5 e6753c04b27a3be709c45fa001d4350e
BLAKE2b-256 51f4befb1960d50bf0fdcbf210aca159324923cf58d5bce6d7cfd8ceaaa77c6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.11.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 cc919dc10584ba08fa5f262e9a444922b7cfe93e03e1008ba436307d81308d7f
MD5 02022546c25657e4dcb4af9938426ade
BLAKE2b-256 3ca08a13d72f2eaf2d89cdd9fed2da6686303d956a0025bd5241cb5ac49c9fac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.11.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 966.9 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.11.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c6c92ca64ab8f615c613aa6a51d4921695db1d9061f7e7e90e8abc612c210b5d
MD5 dc0b0e5ca1791da22acd94dd5bdc37fe
BLAKE2b-256 b813ccffa3794b9c7dd7816f6b8bb74d437e26baca7782e8aaf16033191a7d20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a560b40604db27e348252381dd715c7a87ca9c876b982a657c37d24b1df50d60
MD5 248e515c243ac40e123980f1e54adb41
BLAKE2b-256 5fbf6016be2af43659e5a8e76a189fffd9464900273254f7f900ed54d178bbf5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.11.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 02c8c8afbe14027f39be8724ccb3910856d30de1e9b3045f3514cde1a5cfa7b2
MD5 f3a1c2666266bf03d12a7182813fa011
BLAKE2b-256 392635d0d94234c98a7ae821652b31bf0d83b1901f36de612d73a7e191d1a6a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.11.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 959.4 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.11.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 38529d896fd2c2d08da1e01bcd0ccad89ad8a86d955b394f475765c4ac67fb1e
MD5 30df347c1d6c9f51f2df120f363b6095
BLAKE2b-256 c02adcf1df8f7d870e89f0aef1b2a5558a3baca4d7a1df0dd85bebf144e7d617

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6c6c083b9ea5f9c14a3b8f376387563ee103f77b1e7eb79548537af8c15e6f61
MD5 ca30beadd10473889ef4ea5cc37604bc
BLAKE2b-256 511b956d18c4f8e4691ac7c4a47c089a48f1487e4c96c6737de51de63f4a65b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.11.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 68b7f6174164a6689a9997a96020bf380059d4419b62c5b6014d3388f3e89b93
MD5 ba2bdeb33b03304c3000cda0864b904f
BLAKE2b-256 12862fccae5dbfa6bd099653f957daad24a8a792c025a882738c7d0814c1b713

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