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

Uploaded CPython 3.12Windows x86-64

verlex-0.9.4-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.4-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.4-cp311-cp311-win_amd64.whl (793.6 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.9.4-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.4-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.4-cp310-cp310-win_amd64.whl (788.8 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.9.4-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.4-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.4.tar.gz.

File metadata

  • Download URL: verlex-0.9.4.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.4.tar.gz
Algorithm Hash digest
SHA256 9588c0eed1433d4b418132d33d2aa72e94eb5cee2cdfe6be4331ab9d184e0aee
MD5 ad9db727b732f586a8e44cb125c318f7
BLAKE2b-256 837ec3ac7f51f62126a0e27d14af998cad42527a44f5ca0b7585f9f678a095a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 765.3 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.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 84707536172bfff7883767b690ea96bcbad28f1b39d4e5c059ad437bd284f960
MD5 9f7552a63829b1be69d556ccf7f2a6a8
BLAKE2b-256 52ed3248ee058ccdf7bed0b0dbc0ac9644e8f82351faef53c3f58bb40f9c2247

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4d5ed66075034ddc066a954eba1a162848592c0284a71c9af242715838f5e8fa
MD5 c2f85fc7eb0271bf92688a9e45a03ad9
BLAKE2b-256 3565dad43253de71542e47e25a5b6469e289d96be97d51520e11611f2eeade0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.4-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 1cbaff0476d60f4a7ea05ea890a0ba2e67e2d1ebfe9e0aae8b4aaadeac1cbe1d
MD5 66dc8cd385393da440f048c17dad769f
BLAKE2b-256 8093bcbee8bbca553b70bc75e3b28ad04213eaa2858565839a98cc9bc7b0331e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 793.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.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d1a02bed2c97c1ff3f9f2878e3e4603a370971ee81d09417e083f44805150602
MD5 9268528b5196060a1acded4460da717d
BLAKE2b-256 c1cb7f7da72b8f5c528a540bec1bc4d09e2b1c4205db13e8ae8230de9273cd6a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a1fc9ccfeb7f37614af929e4c096ce2bf373fbcc71241ce155e380a310d2ee7f
MD5 4ccdbe2e88be996714b23e16ff181df5
BLAKE2b-256 bb0de43c10beffe4294e1de2a8cb415df1f394c074d1a5c6ff8cb06332a0eb8b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.4-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 dd55fe0796f0063f93670ca5c5426e183e014cf224c5a8fb6722ce08c1c95be7
MD5 814bf770af92c056ff1e22f16137e15f
BLAKE2b-256 e3de76310417f2db667584b2d95b8a121445890979effcb7aabfcaeb257f770a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 788.8 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.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bbde1b350f168d29339769417fa5d44df696566c03145a25a393c6e3f62a4507
MD5 132f67db588d82c8f97c5d6194c64a54
BLAKE2b-256 44bc7d6ae8db2c4fcfa154c2e517a13bf7614871ebf84c9d2e8880f32a460dbc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6ea07169b865c6c538b9b2289200e8834acfdc3528c43f94aa3e568da0edb498
MD5 4e677b96f333e23ec1a0d110c47e0a92
BLAKE2b-256 722033f0bdcfdbb4cefa5fd45157d5fcdbc5be42781a0d7aca2ef309c4df7382

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.4-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a27917a01ce58890b80a02ebe3916902ae1db0edc017ec6f716f7298725d424b
MD5 4344162a597385e3f3f494d6ecf14e21
BLAKE2b-256 8fe81a4a0ef5ef8d0896dc559dbfd237de3c3532c25801c3c9b5b306812f8400

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