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.36.tar.gz (866.4 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.36-cp312-cp312-win_amd64.whl (456.5 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.36-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.8.36-cp312-cp312-macosx_10_13_universal2.whl (1.0 MB view details)

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

verlex-0.8.36-cp311-cp311-win_amd64.whl (475.2 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.36-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.8.36-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.36-cp310-cp310-win_amd64.whl (471.6 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.36-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.8.36-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.36.tar.gz.

File metadata

  • Download URL: verlex-0.8.36.tar.gz
  • Upload date:
  • Size: 866.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for verlex-0.8.36.tar.gz
Algorithm Hash digest
SHA256 952c066e539cdc033b82f4f00154db785ae20b924a01a63834d4adf896023619
MD5 25c38e2e024917f2687f19c0141e7c54
BLAKE2b-256 5ab210bb394cde29a7ba9a57f4775d8b675aa54940f0d144c6fd619fa87de77f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.36-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 456.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for verlex-0.8.36-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9e8855e7b16e82bdfb250569addcbc377744a490d45b8f8f1086fee8db0c999b
MD5 289dd8365e6b4d8ccbbb85ce6a685f3a
BLAKE2b-256 7c026b38f8a34dcd8aecb3878d44cda5dc21cb6a83d58799063b0c8594445d09

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.36-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 82b875441c4c2904c4c61bb23c8cf38ccf8328fec19e0dc2131d8438779869de
MD5 f73ab6c0ab163d60886b080686d8cfbe
BLAKE2b-256 bea129b849438e302f403ed308fd68e6a3fda1c03043891e72eab5cc9b159045

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.36-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 96e396d0a28c7e5aa5a37dc06837ede5c8c14369bdef8419af3a3a9918f87a44
MD5 8e03ea302b64cd0e7b57ceaeb7b6f9c8
BLAKE2b-256 4a43833d0b9a26492fbcff3a4ce8ad2f4757248998f7c8d95b006aa3f991a671

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.36-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 475.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for verlex-0.8.36-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 845bcd6498b3143bf3b5147c30ac8855e7a546dcfd137ef0a24d2541ff24caab
MD5 260460ec97be8e972d9adda4c2bc498b
BLAKE2b-256 04073af94adaa8aa41f6caa9cf772d7ef88900d6b5df173f3e321ddf2ac3d12b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.36-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fe81af3ae8c33053ab0405055d066c2ae621d9d0afb2d57c94c7f610227c10d5
MD5 fe1bbf12402f5a79f894c9d563ab58c7
BLAKE2b-256 a3e1986911480b8d09d4bcb3ae0d5a9862b9019d82b29b270adae0a0da12f9ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.36-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a91fa9fe0d26214ff4374e04abf18d0e50211243c0b34d68b5b96eeccca19076
MD5 9c49da24fac4528020336f74e5a730c4
BLAKE2b-256 550de18b6c21cf9e28a0f55996ccba946a24d7caef2c39a45d70bf251920ecda

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.36-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 471.6 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for verlex-0.8.36-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 58017e914c5910b5b813f60595155e19ec273570de3b022a965a357280b89c63
MD5 eeec40916f95c50a2bf33cd53e608b68
BLAKE2b-256 8d2f379a4ef97783ae1cca1dd37f8fab004451c4ed2b33a33ce94e43dd2b2b33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.36-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 173878e1f3589fb5963444860cb045ef98bd5a1a39dedcc7e9052bbad62accca
MD5 9e379b02ed7ed9c31dc31d1dca6640fa
BLAKE2b-256 fd7e9b6c695babe89902b756a154e76e19ec519e83a8e0d3a73e3100ee0ef215

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.36-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ffdbf462cd00e8e153273e0be01b76413140c39bd9348953572a72b1b5b3c888
MD5 bf9acb7cd70ea05cea662e0958972611
BLAKE2b-256 017c69c72ad1485b0c3e3796ca4f3b65a5039a0b5356f49e7b0a78c50750da48

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