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.38.tar.gz (889.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.38-cp312-cp312-win_amd64.whl (471.1 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.38-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.8.38-cp312-cp312-macosx_10_13_universal2.whl (1.1 MB view details)

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

verlex-0.8.38-cp311-cp311-win_amd64.whl (490.8 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.38-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.8.38-cp311-cp311-macosx_10_9_universal2.whl (1.1 MB view details)

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

verlex-0.8.38-cp310-cp310-win_amd64.whl (486.9 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.38-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.8.38-cp310-cp310-macosx_10_9_universal2.whl (1.1 MB view details)

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

File details

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

File metadata

  • Download URL: verlex-0.8.38.tar.gz
  • Upload date:
  • Size: 889.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.38.tar.gz
Algorithm Hash digest
SHA256 ecdc5a0699f8e2c809aef86227a0bcda907fb9a93357fc6950f6887db9f16975
MD5 9e0e7a3b944191e5d49e58ac109073cc
BLAKE2b-256 274d61bc36b9e06174d894bd52944abccb3752f0300327a6a941b7b3081f0f53

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.38-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 471.1 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.38-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 80da7d1b48756293665cb133f8e1be5ec81feb961cd00a8b17b56ec9c88ffed7
MD5 6d71d0d0ce034255e46034e66b714eed
BLAKE2b-256 4e0b475047fb2a0e7cf363f007d11d837ba3abc2e908e7beade071376b89944a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.38-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6850715559126a27258edde6f2123a79cf967c3284fbea42ca1299beaa8bc2a4
MD5 3934ffae6c289faa4d09404f0bacdf56
BLAKE2b-256 ee810d08454c6d90d1f0f6e28ed906831113a907871d6c27f385f34fc47f46b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.38-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 2c91fd9730a506cd0c4608deaf5152a331a041acca0f8f1ff2c5e3b826573f97
MD5 32659bde31df3dbdfc391060bb356de0
BLAKE2b-256 55680bbad237d9a2f59772c9a102935e6bb47d8c3b85d7d8349b77952500510d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.38-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 490.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.8.38-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9956703b2a623bac65d37c3141f0c3bc0e632ae810b22404ec803b45c0fd380b
MD5 fdf3b332c69f8c05e852d4960842fb07
BLAKE2b-256 f2dc29d39eb3d5df8146250cb6a18409bc1c18c955ce3361f2cf4496b3800459

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.38-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6564f9ba440c3ee45dc25e76e7e2b6e60ab3435260f1baecca969e998a748154
MD5 7ac0cf160132f8d993545735347fe1a6
BLAKE2b-256 e29e6a99df93b56e1ca54d056d02467e0d27c119f02334a8c1562b9578715ea7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.38-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2b9c2024d0b1225256d1991fa96f3f00f2d16d8b4b07ddd2a205c2a71a99c095
MD5 3ae8f150e395d78467bed52745765e45
BLAKE2b-256 3fb583ebaa5c62a8fe19240ccbb345ba231f77072a285773831dabd5f292a669

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.38-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 486.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.38-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 969bb0ff4a57dc485f730401b08a9ffc2d1bae5507496b9bfbafeff481211361
MD5 95dd4ac6d55c5aceeb32797f5c513182
BLAKE2b-256 917a86ddb15244b589dad1fca01c420df7db3cecfeb64bca817ea99f88efe736

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.38-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0f25d558ce84415c393c4a60cb0dc706f0e2c65ae3e3d41f7036832e206da225
MD5 22c7adda2b8f864c1f4e15402ef0b277
BLAKE2b-256 f45d526d26fb600b328cbec90ba73c8df913af9398b0b5a8131e20e9b70fbada

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.38-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b64fc9a18360180c3ec493be6bd96b27ff75bd20411409c7bae66d5d72aae5da
MD5 a67e86e9eb0b723c57d2037dfecd0876
BLAKE2b-256 3ebacd0edc7a54b5438cf0cbca91e6b8ae79a3d0cebe5bcdfcfa2a16f90f6423

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