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.9.tar.gz (1.7 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.9-cp312-cp312-win_amd64.whl (912.4 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.9.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.9.9-cp312-cp312-macosx_10_13_universal2.whl (2.2 MB view details)

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

verlex-0.9.9-cp311-cp311-win_amd64.whl (926.4 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.9.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.9.9-cp311-cp311-macosx_10_9_universal2.whl (2.2 MB view details)

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

verlex-0.9.9-cp310-cp310-win_amd64.whl (918.8 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.9.9-cp310-cp310-macosx_10_9_universal2.whl (2.2 MB view details)

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

File details

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

File metadata

  • Download URL: verlex-0.9.9.tar.gz
  • Upload date:
  • Size: 1.7 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.9.tar.gz
Algorithm Hash digest
SHA256 54d42516b40a40643f1abe9ab96e76627d062f23516056829775a3ba22781262
MD5 fcfc8b07d5a2dee10e825eb17ed40222
BLAKE2b-256 35162296172468366e2375393cd026cf01dad4d79b7cae0133533c18596bb179

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.9-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 912.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.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9e3a655514c7587ba5cfb8c759509910ea5819043830acd3af0fdc9ccb9094d6
MD5 44f0e856268cfff8d061edeb0fbb406f
BLAKE2b-256 8c5cc81ffe8fe7663c1a9c62ce4ea3197b5eecaa70605f5ec03981ab33f72d62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 25073a5bf533686b3aeada121016548735e60b0ca12d6577b6778b32ac840e4d
MD5 3721280a96090e94f21065ecaff58b0d
BLAKE2b-256 4df26137b4597b602ebc2176023699a9bb807d7f18dd3e7de8c0da07c7c72281

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.9-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 d1fbe5a184649a5fe49a4fbd0cc7a128886ee41863a804b0b712f86489e5ecf8
MD5 89054a61403670603284674f2897f7a7
BLAKE2b-256 2949c53fc17ec230ae97718ce1b6aece6793c3738b93cd349a5fbbbb0a7e72ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.9-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 926.4 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.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2b78e698e167e891598fc87aff99ad557ea369dc737918e3706bf40209bc9217
MD5 1cefd5cf15cf34ce984f8e99c76d5105
BLAKE2b-256 4e206eb6396f37b2268ed2b8a6401cc0baf9e606dcf55d27b73be0a5a7366765

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d7a5dedb2f70f4981b5fdeb6378a03c8358e1f280079bfac22cdd9fbdca09487
MD5 6f759e65e4b75894b35a4f69ef6765e0
BLAKE2b-256 5c684ff6323f523f85351978e0ac51e63ced8dd12ac92a463ef55a9d95219b79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.9-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7425b495c08d71b8d5fac1bec200ad48f7458ea23bcbfc7ce6dbf9aebf192fcb
MD5 2492fcdf7d3b1979e6a6333f8a0bb72c
BLAKE2b-256 fd6ad07cfdccb52ebe5003cf8da83d8a625c8841871e780c74665352e5f9367e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.9-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 918.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.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e07f69762a9155062c73a92a9edfe529585a96fac0830554d58368da4da4f85d
MD5 6deab18173825ef131b356802b4b8338
BLAKE2b-256 7f0469174e991e57ca478000a8245aab93c001f1b56c210f5cd063d368739218

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3dd6797a1e0d77458b247580e3409b991eaf503e3c603cb0c2ddb3a571acf176
MD5 ca8c3835018e9704be1a25147df60e47
BLAKE2b-256 c30e805594d708248110ca22047a0f201948136227eddffa5012135d7c389484

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.9-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 de639df12f9d682d243743a274fe3d94ec2274c0b9eab401ab038f9977fe2cae
MD5 f509225879c76cabfd241bc0ab5e61be
BLAKE2b-256 40c479707c77c0a38a0e31eb3aa8dfd72096f72c1cddc75638bc94cd801be3a9

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