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.39.tar.gz (889.5 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.39-cp312-cp312-win_amd64.whl (471.5 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.39-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.39-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.39-cp311-cp311-win_amd64.whl (491.1 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.39-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.39-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.39-cp310-cp310-win_amd64.whl (487.2 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.39-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.39-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.39.tar.gz.

File metadata

  • Download URL: verlex-0.8.39.tar.gz
  • Upload date:
  • Size: 889.5 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.39.tar.gz
Algorithm Hash digest
SHA256 6d047dd185983e56de2a589bae724ac00264bb786315a20bf238375630d08dd5
MD5 ea567889f64f3e548345386ea444ddb6
BLAKE2b-256 1328df9def04a707dde7f68cde6473834a9882cfb22c0e24669fa2c0cd594cb3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.39-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 471.5 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.39-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ed6cc46941333e4a31ffad49ee85aa1fbfac77a06d563dcb0bc8f45fb768f446
MD5 611a30ed1e6e4214767c871c8c24e1b1
BLAKE2b-256 deab024064bee57eb27760aea9ce5ef5716caefde3d9e35562241514a068f1da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.39-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8fd761427095e06b054c42488cec8d52226654cdc82782cd752706a62e31f716
MD5 9f372f6d987c9f625de18e244eb7e50b
BLAKE2b-256 f1d231bf7b15c5751b3ac4059800688addc375e4cf1209ce7758697bec0b555a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.39-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 6a26c4c4f88c0cfc76294f02063d75b5f664351a867fa99411214e1825224077
MD5 655caba29b30fa83c43fc8648ac09cc0
BLAKE2b-256 00698d08248a87033d836cb45d9e5c564e8b7887bb32e8892f3ac26337af0cd0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.39-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 491.1 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.39-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 efb5f6bc51e302ae79cdebcec97f094723a2d5e438d31bc6dcea4ed0bf724b6b
MD5 b70e41ed1fd212962e97247212daf11c
BLAKE2b-256 de27ee129c916889e0037da9b5d9b2707ee696fb41acdbff7ad4898884982077

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.39-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2671645873d3ffdd3b0555402c5889d49234a148b615387239bc4061dc762f46
MD5 85912dedfddbc241e561c6ce5e1bc932
BLAKE2b-256 3ada479064734883e3f6c1cce2c8aff6e2b875c33612415a5698e9342b151c38

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.39-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7c426536cdda0847d810baa534eef56ce13eca7878784391cf5593728b00ff72
MD5 229164db0aa64e1d5d32a8e136113edf
BLAKE2b-256 768b9bfcd8f75cc0005ab649ec8575f218705e4312d471e81cf52c43b1a35989

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.39-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 487.2 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.39-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e9dcbab6ed266c46002ba03bf74334d5f7f626e7d73cf0af7464013d0a120241
MD5 5b99f3d88787e637ce0ff9cfbbd0846a
BLAKE2b-256 dede424e12d3614a73418f176ed87246c276e9ba397ad67836273123c38b0c78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.39-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 68555adc278717ed0b765c8680fc96c05c8db9601a8f0dbf0397b9473b25886e
MD5 b043322a07d2cdb45f29f24221350e26
BLAKE2b-256 b70b8337e03a59fc375d98b34fcd91bab75ec977b07648527116df4f5873b999

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.39-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 bbac3325badf83b7be5273c2137a0f730cfa2c34c4063585ff07c3727985250c
MD5 1ae1f974981d06319c9a99f67fac7493
BLAKE2b-256 a4551b06f354b77b1107ae0fdda28996c07fda5751a3ff68bb6f83313c8a803c

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