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.0.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.0-cp312-cp312-win_amd64.whl (744.8 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.9.0-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.0-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.0-cp311-cp311-win_amd64.whl (772.2 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.9.0-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.0-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.0-cp310-cp310-win_amd64.whl (766.5 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.9.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: verlex-0.9.0.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.0.tar.gz
Algorithm Hash digest
SHA256 68cbdd130977e426956512c4c02e2bfacd668337d5e5c9b7c6b22d2165b241f2
MD5 3b210149dd13677772f92cab6382b9d1
BLAKE2b-256 f42f2a414f1da52cf550713f0b4068b5dc89a42e5a57bd74ea0fdb4008d77745

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 744.8 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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8b6d29da3ee83484fe9edf3e32c4834a5ea358110b494d1f4eaa686fe9d81cd2
MD5 4b68a0027e72e6aac7fc15196864f72b
BLAKE2b-256 2e236d4cb518eb87e31dcafbfcf42f30a703deaa9ecccdb24a2f9d0037535531

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 02da3df21d3f4ab613f35cef83b6710c20c66bc3e49ec3de9256323c1e580c7f
MD5 dcc333c7bebe5d1b7eb319ece356fa35
BLAKE2b-256 b81b3a26efb43dd3cdb25298efb7b2bd1de593c37510e37581bb9c91b1bc2357

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 60f9b9b44afd30a20e364d9155dfdc4bacf8bc7d8d1a6dc8f3899149664a4cd4
MD5 086b96e43b4a6d82e410ac5241bd544e
BLAKE2b-256 e9343233155bc668e87b17dec7492cd9f2fa5cea8cffd9d7f7d8dd3e4e55a0e5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 772.2 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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 471cd40de25d6505ead11cde78be3449d7c1bd7ee64a212e91811bf98305a98b
MD5 31e3e0fcab309c71aaab805dea791727
BLAKE2b-256 e804410868878e90f65c4544fc5d5d9fa190ce5ef1bda95ea0bdb484c0d91385

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 93840b68b6d1d3b31b2a8f2b2e7cc45cc5bbcb17f2ca75f625b8317e94328811
MD5 2206785ac5f30ddb50eb214b7c61eb32
BLAKE2b-256 bd663f3fe95ba7481fe0ac3fff5ce80fd350eb12d6999ecebf12caac97671523

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ed7e527f5bf60d6646b4f63f1a3ecd02a4230e3a57166544c0ad0e47349b9ba6
MD5 67fd3887291b85c478e85ba9cf6ad6dc
BLAKE2b-256 fdefe40fcd666d478af3526e7a557caa7996df7df02a87d78f09ca2b9a5bc64b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 766.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.9.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2cf66b0b12aa5a23164652748919dfbb9332c38ee2eb86ac05cbbc888229fff8
MD5 6e0fbf94ca65405f12654c3c5bb63394
BLAKE2b-256 9d616f5f631e4b473b54344982cbe513d644a285a96ef17f8adb09be2a24e0d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b4b2b38acb991c95e69a95e72a29c6f9ed3b3d685f6d07a8db9db6d2e72d2292
MD5 0e834f726fb2b267aab95a3cfa1297f5
BLAKE2b-256 f7c6bc65184537c17deb645bc30e8dc10eb07646ef0433e0debf14558d33d40c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9049fa3cbed96705a72984e79fc5b3d98d57887b547a453ac65e403881854f35
MD5 94dc7d04bae38c302dff666085beea73
BLAKE2b-256 9957d700cafc3d7a07c0d0f0bc43afedb1e01b60d3763de066d2e677faf38d0a

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