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.52.tar.gz (1.3 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.8.52-cp312-cp312-win_amd64.whl (725.5 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.52-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.8.52-cp312-cp312-macosx_10_13_universal2.whl (1.7 MB view details)

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

verlex-0.8.52-cp311-cp311-win_amd64.whl (751.5 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.52-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.8.52-cp311-cp311-macosx_10_9_universal2.whl (1.7 MB view details)

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

verlex-0.8.52-cp310-cp310-win_amd64.whl (746.5 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.52-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.8.52-cp310-cp310-macosx_10_9_universal2.whl (1.7 MB view details)

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

File details

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

File metadata

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

File hashes

Hashes for verlex-0.8.52.tar.gz
Algorithm Hash digest
SHA256 7bde018908b2c177291ac84aa38f434504b10f2720cdccfa22c59b9ceb8a6e4b
MD5 273b7b3c9d108255041398dd71ce70dd
BLAKE2b-256 e665a40258a266f86b54d6a3a5215824ea8ca48540e77b413b56621215926a76

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.52-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 725.5 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.52-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4cebfc00df8471db0ac547ba416de59cd73aa0e90d06c05481fe43b29a5064ab
MD5 6444df8b0768a481d92c54a102bddc72
BLAKE2b-256 7d624e570daf0add80ff4f8ca8e3b3938379b610cd6d80949ba87227c9315c5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.52-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0cdc0cba730e26edb6af5c16cf14436ece77f89b4e4b436f24e928749680d666
MD5 b7b98615375fef3622e1ec0abb0cf608
BLAKE2b-256 b04b26a5e8a38d3c8811fcc506b090317fcb97e08c4e6279f1d6342e08c49537

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.52-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 d770f3eef4be18f5453b815fd754491d67cf386994420dcb3e3e65c48ee6a95d
MD5 4fcce444fc630f866758523edf2e0a02
BLAKE2b-256 a5b33a5c703b2700d3b81e8ce5666f0d31823e30ebbfe7ecc68ec31a5f250e0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.52-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 751.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.8.52-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 26e3aa9b29ef8cf610262688424329400ea88b0134871bb6c2307e246bea98ea
MD5 411c0cccc1a53df2357a1c80155888ca
BLAKE2b-256 4026af0c248bd2a5daf728b9a205fb37562f3f6382494d6cc2cfc932918d551c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.52-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2d3f37b2fdea031759ae8fa6a56fe83baf57dbd9fd3a6f83be88f914af3e84d9
MD5 0eb844052debdeb559e9154fba618605
BLAKE2b-256 460934d500f24a4e1c765cf7481fe91f5997080f526f8e4997034a026bb357bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.52-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 3891f66ff75768c42891175300e908b33b422a9971aeb031952f80a079a64fe0
MD5 0378833a145a78249f113b369a7daa16
BLAKE2b-256 95f4a129631470f5f0aef1332055fc42c9ede7b9c95014439b7548d96c73ce0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.52-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 746.5 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.52-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 46e9893a170aff0dec40f6da19e7cdf1f3714a8bbfad2337823a3750d10fd876
MD5 7b8b0472cc7e2a177963c40fe1e49829
BLAKE2b-256 86b56d8e90277993a05a0e63b5fb5890e41708b825d6e04f1b58c8066226ed80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.52-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d6beb55e1f24e8b88a90870c217f2aa12cfba76a685ab71f316a33037c58562f
MD5 fd85af68a51bee4cae6a55a585a1ef28
BLAKE2b-256 8a825d3346e82ba45e7dce229f1c9c8f8320fb8b6788e434003c9de712591e71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.52-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 6a06416f9face7ae8a85b19acef6e378f6a92268e127b6457eda06b8c6db8e9f
MD5 c4b4c54e8a86d0d50033686bf03a0eba
BLAKE2b-256 a515243f90698f249a9e3ded94a43dc6dbcb22567b72d1415fcb9cc0566a48c1

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