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.49.tar.gz (957.2 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.49-cp312-cp312-win_amd64.whl (520.6 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.49-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.8.49-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.49-cp311-cp311-win_amd64.whl (544.0 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.49-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.8.49-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.49-cp310-cp310-win_amd64.whl (540.6 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.49-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.8.49-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.49.tar.gz.

File metadata

  • Download URL: verlex-0.8.49.tar.gz
  • Upload date:
  • Size: 957.2 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.49.tar.gz
Algorithm Hash digest
SHA256 e5689a49345eddcca1e9e2ef0fa6ee1aec207c8bbbb714d4ef330b5b5602b6e6
MD5 e6310e332bf8df28ea1c7b8de78d2e6f
BLAKE2b-256 721a85a2ffe5c54c1751db61e4c970d7e85de62ac953e26d4a9008a4d05d69e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.49-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 520.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.49-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1eff94cf2915b7c2c375ab00b97ba90a2da52d6ac39bc8a2fd168a8d4700b11c
MD5 b7649f87ebfe379892b85e4440ce6bb0
BLAKE2b-256 7c6b6c05c2f6f9a54a3c89137300beb7aa9f047ccb0c38fe4fff9650898af4c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.49-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 04d2fb6aad232d14a33a9323136f6d1ba7764ce86858074de3f41771fc2e9522
MD5 635edbb7f92bf41c62c4d54fd1d30218
BLAKE2b-256 fb38b87d24fe33ca8f8e2ffdc66bcb6fcdfff4e358398018f36969ee6ce4aa09

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.49-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 c4ef177e04ca0893f2f0b2d03f0a404c67ff8459a56618a1bbd5d5d2321bf51d
MD5 fb3a5491c9645e16b24dc9cbc879ed4a
BLAKE2b-256 5f2a10526865608c14b0dde5081d2f34dcfd79e6d9dbcc75a5491075c928c365

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.49-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 544.0 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.49-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 16efcd4cc94160b27821455e996ff8f5661f4dd63315826b25e2cbb822e973fe
MD5 3a0c97683e3581807f9373af1faac517
BLAKE2b-256 4a46624166b74be934134aa6c1de1f0d5a8d5d3f120c6275f634fd33a25fde32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.49-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 58a62d21108188aee85bf5951034eb76722384bf0d07621347b28d166cdc63af
MD5 9e6087096c00c089f4084482ecd992be
BLAKE2b-256 ba4400bb8ea6866c45977be52d2883035af4651eca998151cb28e2eca26a8024

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.49-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5ca99964bba2318dc6a2347b89dfa3c2e202d2f5678d54e3bfc0ae5f12d38b6a
MD5 c12df1d2ded870f4692949a3bc4b0e1b
BLAKE2b-256 2e08a4195ba583c061f8b84e4c4c5c35320cd6c3ba569137569ca01f4047b7ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.49-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 540.6 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.49-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 565a257497d83ba40753aca72bff14f61f8206d873e45f841045f2d83ab22a64
MD5 dd8f7efed3fb69bdfe80e0c34d41c4ac
BLAKE2b-256 c40e3add862b5da6e74733112b5b899e8ee2db77e454a345d51f77a85d62cead

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.49-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 485e1b488b3e459ff65d6f29eaf2575a4a029a95d72d947c736f9b0a6424889b
MD5 a78c37f70b0845b7ceb74c6bf5ac88c9
BLAKE2b-256 63b6c02ebf25301379f92d68677ae4b161d345824c576ee48fa77537534c0ef9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.49-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 39a269f7edcc440b62a90cef7a4b6db3d5a115ffec4e0b6fdc698088fcc6807c
MD5 cf6e733eba52cddfa8f020d5574fb170
BLAKE2b-256 f2e72bc7740d66210586018357943949a61f054fe6ab0bef32a7570d1203e996

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