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.50.tar.gz (974.1 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.50-cp312-cp312-win_amd64.whl (527.9 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.50-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.8.50-cp312-cp312-macosx_10_13_universal2.whl (1.2 MB view details)

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

verlex-0.8.50-cp311-cp311-win_amd64.whl (550.9 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.50-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.8.50-cp311-cp311-macosx_10_9_universal2.whl (1.3 MB view details)

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

verlex-0.8.50-cp310-cp310-win_amd64.whl (547.5 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.50-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.8.50-cp310-cp310-macosx_10_9_universal2.whl (1.3 MB view details)

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

File details

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

File metadata

  • Download URL: verlex-0.8.50.tar.gz
  • Upload date:
  • Size: 974.1 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.50.tar.gz
Algorithm Hash digest
SHA256 83a0d64812a66ea6828830a36b13398d2e64c2059d53e565d93066a7523b92cf
MD5 99306abc3ad2053dfd500103bf7f764c
BLAKE2b-256 f1be06aa24b7c93728b062869cce1c7b1bd1d79384b5ed86deee9ad85ba2e181

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.50-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 527.9 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.50-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 734ba2caaaa6042b488690d14dd1fe23852727e494606e56f9423d3f94350ec0
MD5 9c3ca821b216302edb5e0e6e39e2f82b
BLAKE2b-256 90adb09c611bdb8433dbaf6730981d7863305cfad837b0117eed8f27f8ac196e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.50-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 55d6e9a526cc38e2dc19483262e3fdbc4dc6e059b5bf2ebdd626767e991788a3
MD5 552f61f29dd87113d8a6ece023752d10
BLAKE2b-256 5d01bde97abcc04d0f20dd1a92c5bd5e9f37500069318daa64e1a2f807a09f2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.50-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 0b7f3e6cc6d49882363e41f2b34fde4db3c5713f3dab859427cd22387404816f
MD5 008f4de40b068b9e0d69581be14cd349
BLAKE2b-256 2a2a456f5b8f183d27934fe67ade037c905803e4b6fba6b73a7fa3ce36c801e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.50-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 550.9 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.50-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d3077f8569ddc6b9c94033bc150b82867906bf151e37ef9f4ba9ffbd8abe8c84
MD5 091965c3f8d9199e2b17118a57623996
BLAKE2b-256 1b00fb355576f12d03be1b1f75b0a3c72adeb033cc240088ac382220b6430f44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.50-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a4861afe70c00f34e9b1e5b958ecfa09c85958754070570ade6e1be515358bd1
MD5 a1ee088d60af2d9df7a8cc538e2d153d
BLAKE2b-256 332c296698a458355007e53cd0333baf11b134839e16241b1a47658492295c61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.50-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 637b2c885bcf90c5f0fa1dfc390747191c71f2b7162e49aa6057fa301bc1c8d0
MD5 3d49f41c4408260a015859503d0d0151
BLAKE2b-256 d9716bcae7b9f6cafb834be3270af67b66de7f568118c4cc6ac529e72deabd80

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.50-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 547.5 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.50-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f2d3954fda4df9a0ceda32d29f2bd920e28f5305b379d38ec5b95880abe0d8be
MD5 490deade0deb7cd6cd601af8a37ba8a5
BLAKE2b-256 1904da4b364ec5560afe7614b2ac9c0f7e3396acf30ecf0b264d7b24c053ce3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.50-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b968062bcad73e0291ba87bc53cffc8ed5bea758fc6ac7527092e5a42007c307
MD5 432170b02c6a795fbf898e9067d8542b
BLAKE2b-256 d06b6988ab9854d5742e3a499d82fc123f15540ae178b2c2e88effacac711f44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.50-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ab9b51d4bea7fc49c7062533287aa20595f3aff6d16d3b0d4c0f6bb724e8c114
MD5 ddf36d152697a0918b16d73f983cb2a7
BLAKE2b-256 3555681046bc6e00c6b5f7b09dd7a7c8b066c61996684b1da7a793dfa8dfbd38

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