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

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.6.tar.gz (1.5 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.6-cp312-cp312-win_amd64.whl (755.9 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.9.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.9.6-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.6-cp311-cp311-win_amd64.whl (768.6 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.9.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.9.6-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.6-cp310-cp310-win_amd64.whl (761.7 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.9.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.9.6-cp310-cp310-macosx_10_9_universal2.whl (1.9 MB view details)

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

File details

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

File metadata

  • Download URL: verlex-0.9.6.tar.gz
  • Upload date:
  • Size: 1.5 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.6.tar.gz
Algorithm Hash digest
SHA256 a139a1242a11a576ec5cfe1ac13f31035404726294d496cc1abd73def50673e5
MD5 623b74ed397c81c5e01963ff90f1d40e
BLAKE2b-256 cb04058cde1491c8857e87b49b113f9cc7a7d5ca60f74a100e89d6a41be52b1d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 755.9 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.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 12d87270143b08175ece8dc779f10937f30a7c044025d400838cce560151de3c
MD5 c44518ee9728501e2fe2ff4a55f6f2a4
BLAKE2b-256 e7352fcdbf99a26f2b24e9e924be5f897461335fc92290e3c0922511c0a47388

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4421ad1bcf96673719270642d98f11c213f3a04ac596280ba8bf51235ec74edf
MD5 e1bd88a5320685ef98e39e98732d26c5
BLAKE2b-256 5db648a0d9150e275ac254c1f3a7dda4f4f74ede0cfa64ffc29d83a5ae9fc5e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.6-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 c1fd2bd7ebcd53ad58a52f739b27ddb902e5ba904e5478fc9ff4f371459f3f05
MD5 939e2f1c030b1efbd8ea13637c878486
BLAKE2b-256 e2fa502536b2c2789d789a98fa2afbaf47c1f0de2a6a19cd63fa3738f4340f1b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 768.6 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.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 77e82d34ac0db47dd88bdb5a2aef6376303b2b1107a611913bbd5a1ea6039108
MD5 3744beaae2526d1d84524717035c3652
BLAKE2b-256 9ec91a9dd605dba4f87a2f09937ddb8725003e3525c3789e9a9722c8a4e2fee9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e43420ded727ba8c0e0565eb318a69e65b57bdaffd6a96c8750c214b23f9729f
MD5 3ab0ed7219fb1a9685f02f4fe83710e7
BLAKE2b-256 567cede3332ac946e96f77a0d5498cd3043860556144d744c1d3813da06161ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.6-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5763a157f60bda4b2cdcdc0d25a61c59841ba48cb51752df4111daa2a59fd2c0
MD5 2f2f719ab3e74321f170fe05a6009143
BLAKE2b-256 8b75ab519b9fa70359d2a4b93def7de3941ed699acbc8ac5113b448e2591248f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 761.7 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.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a2b936dbd0f150140c72d60ee99a8c89b14e77f27a3be1b823a94014f1b2b9d7
MD5 de53626b896df67f08c1d818fe4b5670
BLAKE2b-256 20650efce028cf8c036019cac3330459cbede91bf17b177588f32c3b58801124

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d8f00c7d28843beee60c1c477f1c0fc1bb9b19cc4b8e26d04dc88e285514e022
MD5 dd71fd8679dced608779385fd0e6dd1d
BLAKE2b-256 e8ab9370461a2fb3b84dd2b940a49107d5db5be8a36e8c02b32e683ba588a152

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.6-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2a166488bac7e5092d55d494651d266ed0af43ea8342eb46bcc4ff44250079bd
MD5 069dbdff390b46870bc1783517e65aee
BLAKE2b-256 87b6247e9dc3becaedcebc02585b01f7ea3d3a8af797f9023c11f7b766ee4155

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