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

Uploaded CPython 3.12Windows x86-64

verlex-0.9.3-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.3-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.3-cp311-cp311-win_amd64.whl (788.8 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.9.3-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.3-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.3-cp310-cp310-win_amd64.whl (784.0 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.9.3-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.3-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.3.tar.gz.

File metadata

  • Download URL: verlex-0.9.3.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.3.tar.gz
Algorithm Hash digest
SHA256 dd8cc1e0c7eb4b4b2de00472659e456546e64d22c368e1932d386455173b3057
MD5 97eb7376047d90ee1d2899fbecbb392a
BLAKE2b-256 27149494602c6d1c365496c810cf3c98870c8412da8a89b37e027b0a0d25348b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 761.4 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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 de93c12d73675a86288a3536d3fdd4b03ec720ce76df4470a8385995b39306e1
MD5 872329f8c983f655e9e4d0b522ec6f1d
BLAKE2b-256 4f9627c3a511e076a425166dd8aa7cd33498a3adc1c3868d028f6b8d7b235a03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 506e67e698f1e9355330ba50edf15b3e34c1a8f89e809b2bf2811082ad9c7f7d
MD5 3de606994fbf02c39f3638ac972e9f6c
BLAKE2b-256 a1bd8af45b49d88a97c8812d19c209e3f450f6bbe2d5bdfbcc271ee8b1e7c34f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.3-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 72c91e5726fab1c12d6227070378c17675c24f708b5b4b098d1d3d785a609d30
MD5 e3a5c071f488faef0a2d47a8ba4158f7
BLAKE2b-256 e49ca119e0799ad668c1807ad7d75fc29c52970a3568034d455963b4fb619268

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 788.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.9.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ea87c4d1ab6d068e6c5a80691c93bf5ba0ea61ebd8670ed66013738fe7ca41a9
MD5 049dd9b8bea091cabb4ce24953aad5d6
BLAKE2b-256 b4182de6b0227d51014f94668f7bd8dd5aa0e4fe5bcecf78273f6e9a5bebc502

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0cfb56578773bb3b9f0107d2ea6db564ca2524bfec02ad622db021029b97f426
MD5 54ecd280f64e8a406924f6d11377e851
BLAKE2b-256 a142874e7c9f16bd89ac860361db6cfd1ce0202ec25d868f999f4638f43fcb9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.3-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 3a9b159005a6a87b9e81b8753c97498ff7809bdb4d9c653283a31a99f3c3d7ae
MD5 3fc00c31ac36da6a76044694305a8c3e
BLAKE2b-256 54fe8ed6b2c70ff8a19e5a09e63825bf735a97ff80db79ee813d299765ec59f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 784.0 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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c50edef980bc1825bb4c5b5f1a8f17fc974eaa9a3b9801afbbeae12a4556a570
MD5 245f504a326f72b2dd70f1f79503d93d
BLAKE2b-256 3e479787648c466421d374d6c031f31e4269d4b456d82be1653c6780a6b67105

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cb18fb00a66c70c4e2ee582dcf28917e5d278f9cefa636d4a53ac80aa047fc36
MD5 405f6ea86436c50ad2394075310f9c3e
BLAKE2b-256 174a63ba3f8c897515e19d5cf26908393e49c8e58e0480f08e3f5b2833745de1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.3-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 678f187653240eb1d88269f0778b6d9c3700ab0da59012615ca6028bfefef2ce
MD5 e85b3a1f68bb1632c6e54f6523a1aed6
BLAKE2b-256 3d328e1a151dfa80fdb7bcde73b3b16aca5994aeff40b18d0f52a94ec6989c43

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