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.43.tar.gz (920.7 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.43-cp312-cp312-win_amd64.whl (497.6 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.43-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.8.43-cp312-cp312-macosx_10_13_universal2.whl (1.2 MB view details)

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

verlex-0.8.43-cp311-cp311-win_amd64.whl (520.4 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.43-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.8.43-cp311-cp311-macosx_10_9_universal2.whl (1.2 MB view details)

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

verlex-0.8.43-cp310-cp310-win_amd64.whl (516.9 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.43-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.8.43-cp310-cp310-macosx_10_9_universal2.whl (1.2 MB view details)

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

File details

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

File metadata

  • Download URL: verlex-0.8.43.tar.gz
  • Upload date:
  • Size: 920.7 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.43.tar.gz
Algorithm Hash digest
SHA256 0b91ee64be84fd1c2c5d3cb8dd08274a50e8e378cf4188cfe2da0906d9c3bd82
MD5 ffcbf8a4d7c4bc8a01ad91233cbfe36c
BLAKE2b-256 d6cb02a7298c1bd3e30a5d484c3932bde0784881aa458cf3b11623b27263a4d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.43-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 497.6 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.43-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6900b45088dc965096d8c7c465f5cf7a998f05e8671add11b7186562e709a822
MD5 d0ddaaadf756504fc8a3480b233c5d19
BLAKE2b-256 e90581c2ab9da51c2e4b351d6d2432266f7ad60a32eacb3d3124e6702a925e0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.43-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ae3889239a22467225e80270c90c2fdf267cbd39202807dafa61872a6f8b0bd7
MD5 18540a5b3ec51e64124af9dd88376389
BLAKE2b-256 74a0e0de5826dbdf4c1d64915741d44a328c28f24977a26d24d7d2ffae388c37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.43-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 89748247da6112c4d1d4a17ea22a5a4d7db0c190b1c4dbb37963da23a5f44c05
MD5 717c4eeda6368e718bc41376c651e80d
BLAKE2b-256 a3c4e708243c05591f259029cb2a42e261d2936e4cf2fb733c968b83864141f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.43-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 520.4 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.43-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f0a3f8f825961c2fc359fb5b4896bec1e1349e92ca054ca2d86cc68fa6d85cc3
MD5 bc2890cc7fa21c9a7ff0a47efe2ebcaa
BLAKE2b-256 f6835de03287fe995d441eede61940cc2beda8a0797fa271aa8669cb934fef10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.43-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c024b90b9c04b5860ce4f6ecf25064e9e3a6c565c8de0cb918f7a4be736c3770
MD5 160abb9c732193b267c67cc2eb9d9942
BLAKE2b-256 1e9db16343f0790752dbf51a4b03e2d94b7f6be0360b1e3bb590fca9d0dc71e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.43-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d530102d17b219740e44da3e7cdb8f4de9648888a5744b2ccc3cf6e666028269
MD5 dd58e76a01edacd2b6b1593c068b007c
BLAKE2b-256 948a61c7c553163b070716cd8133528af09cec00cdf794d927c6af0acd5ba6b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.43-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 516.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.43-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7f4e1250c771f333fb7e74b25960bac1f36c2b84c47b8c22ce64dc3ef39fca4c
MD5 981ebc2e68d248583bfe73cae3a94fa6
BLAKE2b-256 8f8f87bd66818f0d380061039ae20698cd86fb3edcd65499a26b35160c9c9606

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.43-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dd32de640484a6d722f1bbbb01624b1b554c730eeacff9b72ecd2a5da6315955
MD5 b4b16e133db9e3e8cac8414c61c431dd
BLAKE2b-256 31edd7cfb0d17c06315a9f535d87db93b752c6c8260e0aa470262c336881a36e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.43-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7cfe6dff067b73c0f324dbac39fbc01862663824fff0f26d1440780c965e876f
MD5 1c752af4893e95292b6c88fa68642469
BLAKE2b-256 ff8573b32774326ba294982aca6bbcead9cbef6ce07724a962826d50aec9e91c

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