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.9.1.tar.gz (1.4 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.9.1-cp312-cp312-win_amd64.whl (744.7 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.9.1-cp312-cp312-macosx_10_13_universal2.whl (1.8 MB view details)

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

verlex-0.9.1-cp311-cp311-win_amd64.whl (771.8 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.9.1-cp311-cp311-macosx_10_9_universal2.whl (1.8 MB view details)

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

verlex-0.9.1-cp310-cp310-win_amd64.whl (766.3 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.9.1-cp310-cp310-macosx_10_9_universal2.whl (1.8 MB view details)

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

File details

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

File metadata

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

File hashes

Hashes for verlex-0.9.1.tar.gz
Algorithm Hash digest
SHA256 26f39f3c487c76a7ae39c21687a3bf20deac84023da6eab7f8f5b32f29de2916
MD5 d9e637c9efb023e3aef575e857abe6b8
BLAKE2b-256 7d391b7c841068a579a807b6dafdccf2c6f8b140b07dd1ce535cbb3997b8d1de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 744.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.9.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0b91391c3f22910170907f487a42cae1d479392a89dc43aaaa327c87a5f3840c
MD5 02c9d48c6c5c8d8de39c2f5baf4507be
BLAKE2b-256 b21f1b1ad0ed50bc9b70c834562af12db06ad7e2cbd5ad858f796033982afea9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f2228543a5b3be378deb72c03150d1ce61522106c8339a51194bd2080213e5e1
MD5 2cd8138515c02a5e2164cf1fd61e0d23
BLAKE2b-256 547600c1f28fc486aab102508cd69795fead94e7fab92e23bc76001822403771

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.1-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 25f0bb7cb664da287f01a239762a35a0adcecdd52956aa3a97274ae230d99a0c
MD5 6b2e16d9bf34968c1acd53f4539166a2
BLAKE2b-256 f3c771d26f033d3330386408782c46e6f8fc91c88c6d39c792226c3cd12a6698

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 771.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.9.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 da69a4546bafb173ca55b2af184f89c0c62ad151c2c8f3886e58676b7c1e6a1b
MD5 fdbde51db4c626f622608be9807d28c8
BLAKE2b-256 2cf1bad00a98b36399495a884f1a6de42f637e5f1696d3b6bf3c19ad9fec3ab0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0354749fbbd6e386e0017a8d946b50d1b477c786ed0fba238acaafd74624fe94
MD5 b22d4a54ed3b98b269b3b9a7292ed7ea
BLAKE2b-256 36cd0c783028d21c6ee0f9e0d431f8835cd1e8ae95037e7a4afe95adfe662e83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 de857b5806b179007e5a6eea612b580e7c6941631a46e90705f2c9f7a10d6939
MD5 de37fd2d323d4c04426fee3b45e495aa
BLAKE2b-256 d43506b116104fcd29f398c4c47cb857e6737c45b872caa050ee12b52afa4b59

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 766.3 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.9.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 309d462886c24c2ce50522b650162b90b1c9e1729d3da69efeea046cddc72f8e
MD5 1ab7e295bfe454de62fa310f01e97a2f
BLAKE2b-256 d8b220057137486553084419f3651b0122b5112b10f8c44dc007a358e463025f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 af8dadadcd67a790675979a33902f85d9780cfce31dd6ccd5ed018f66f3cdc9e
MD5 da2c8df578e3a7e9900cdb724b258b3f
BLAKE2b-256 31754acafd90e50d1b79c80ca3504da62d5ec669618b3690c79c7148c0d0bb7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 4cfda1f84b5816ae4a2313c9744efd0d9f78fe8f76ca38ad82cc1c50248c47d7
MD5 1a6a7cb589f63648721632deb8c8ff7d
BLAKE2b-256 3cd60d434f04b0ad07451137e916bef6c05ffedddf2b2e2f213bf2a9988cfff5

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