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 - that's it!
with verlex.GateWay(api_key="gw_your_key") as gw:
    result = gw.run(train_model)
    print(result)

Basic Usage

Context Manager (Recommended)

import verlex

with verlex.GateWay(api_key="gw_your_key") as gw:
    result = gw.run(my_function)

Specifying Resources

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

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
with verlex.GateWay(api_key="gw_your_key", fast=True) as gw:
    result = gw.run(my_function)

# Standard mode (default) - wait for lower prices
with verlex.GateWay(api_key="gw_your_key") as gw:
    result = gw.run(my_function)

Authentication

Option 1: Direct API Key

with verlex.GateWay(api_key="gw_your_key") as gw:
    result = gw.run(my_function)

Option 2: Environment Variable

export VERLEX_API_KEY="gw_your_key"
with verlex.GateWay() as gw:
    result = gw.run(my_function)

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.35.tar.gz (858.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.35-cp312-cp312-win_amd64.whl (444.1 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.35-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.8.35-cp312-cp312-macosx_10_13_universal2.whl (1.0 MB view details)

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

verlex-0.8.35-cp311-cp311-win_amd64.whl (460.9 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.35-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.8.35-cp311-cp311-macosx_10_9_universal2.whl (1.0 MB view details)

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

verlex-0.8.35-cp310-cp310-win_amd64.whl (457.4 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.35-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.8.35-cp310-cp310-macosx_10_9_universal2.whl (1.0 MB view details)

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

File details

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

File metadata

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

File hashes

Hashes for verlex-0.8.35.tar.gz
Algorithm Hash digest
SHA256 d9128700884fbbf160105e4cf9a6260a519724dc8cf79cbce18d454de9aeabb7
MD5 ef2a6ad60c4297593521c257a895444b
BLAKE2b-256 7097dbbd3f7483842f9121c6b6ab674a0b0b8eac942e628e70864a5e9cbf860e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for verlex-0.8.35-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 710d86d2daf36e3f074fa5c814930e1f126d6257db5e110b14d412c27f4abfd5
MD5 548e1964d98d3de2f380074d003b9ecd
BLAKE2b-256 e0149ce10cf2179a03e8dab9c6ae688d9b99edf47531331cec5d1277dc172ea2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.35-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1a90847603cf4dbe070fe909f81d4503664c4b04627160b23633aee959040c6f
MD5 691b2d3296873aa527c84ad7f017b7ca
BLAKE2b-256 8ebaf928f336541f5d36d6518207bf9053823eab0d1151ca17e40b1652999dfc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.35-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 27fb32181bcca9172b111749b3fb9a8bd40c31969b5f3da0b509bfa8a64ffa56
MD5 99d83df5fec6ce72fa98965e826209b0
BLAKE2b-256 27ae2001633d9034212cc1709ec18fae68c18d21937500c345eae579f1037ff1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for verlex-0.8.35-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 568c056b29c58418034f53cee17986b7e980f1a2ee28a172f47b437cc4415dc8
MD5 3378e304096789c7430f980994b192bc
BLAKE2b-256 1808db19d26d4210373ffa14a3b5f0385289c184b356a22082a7a77b1af138b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.35-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f6c57490609f27c033a4e6fd34d30294811c7164a49cb041a6151dbeb20f558a
MD5 b9a467f779158878c334e9a41cd1be00
BLAKE2b-256 6b2fd3aaf69957652fc94305fabb17c59694853e41de10a3e0e00a4403ebd60f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.35-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ccc60effc7ed404f49c3875c0b30391290116584fb65dba605ab1ef9ab71d122
MD5 c4bc47dd1e9a3990566882c1e4a01987
BLAKE2b-256 a8ecd10432a3925859609a3b5af6f04e9f6b220b013192011761d3839e7c4c96

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for verlex-0.8.35-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f05ecff694c3d36628b736ba41e1f1bc9b6d06421e9f4196f266835286a1d5c1
MD5 ac6ce8e7f17ff9a31cc1606179ab8cc0
BLAKE2b-256 5f9610806f64983304d3eaf0b5f3fc6710f4a44d71795d421fee5535861fa194

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.35-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8f31a8775442b171482d33ddc9a71477a9f7b4bdbe907bfb8287f765ef8f30af
MD5 a74f9f1fbb4455dd961733bd08aec270
BLAKE2b-256 c83981297c65c03b20b22970e82a7ee1961999661027d7ac0887f047137b704f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.35-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d940166fa738b36a9a4de71bad2f0f95f879cb9589f3a4011b4ea2cd63f1ad69
MD5 01c911f6daec531c2cfc72fef129ab41
BLAKE2b-256 8c63202ab7ba7fc85f4c8a1530d002e8d9097149bb3a8fe32b50f9fbc12d1a5f

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