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.53.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.8.53-cp312-cp312-win_amd64.whl (726.4 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.53-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.8.53-cp312-cp312-macosx_10_13_universal2.whl (1.7 MB view details)

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

verlex-0.8.53-cp311-cp311-win_amd64.whl (752.0 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.53-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.8.53-cp311-cp311-macosx_10_9_universal2.whl (1.7 MB view details)

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

verlex-0.8.53-cp310-cp310-win_amd64.whl (747.1 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.53-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.8.53-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.8.53.tar.gz.

File metadata

  • Download URL: verlex-0.8.53.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.8.53.tar.gz
Algorithm Hash digest
SHA256 358b1f1d8d7dc2705f58c72628be6ea2f9d00baa992d758ef81805f475eb37c6
MD5 1def44969c8ba188326d5f66c9135039
BLAKE2b-256 e649ac76bb5e7950500f1f39db537b35b788e3e37bd9c7ad2e43a7c1e0394024

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.53-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 726.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.8.53-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4e13c224f0117af3363396de18e31aab84ed2b9858ac0c01e506ed00d0f7347e
MD5 f84520473e9b6dea800f53c19762cfb3
BLAKE2b-256 f1cd97d70795583d57fcd652c8966c5735cc6ad613084fe38c42560f168cf7ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.53-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e924a30dfe6458f3138ca1c05f4c368063f5640e73e95ae3f13f567857dcaeca
MD5 91fb0b94d62c6880c384e8fda141c228
BLAKE2b-256 726752ab0dafb9eb8cc03afac72b3b7ed6aea0aeeae5e835ce7a108aea97af19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.53-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 0f38622d4c5590cbd0c7d4cf7824a308df6171424140eef391e854232806718f
MD5 e4892869810b1cd472a696976da17cf5
BLAKE2b-256 3c953a1d74661f04c4f8817edcd6d4add5541e6bfcf84ccf46f186727e0b488b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.53-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 752.0 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.53-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5a39ca73fe11c52eabaf93b7100f093ad58a7ad7b663b1a20fc08a0d6d856077
MD5 c8f0e2b96618727d1ac613400c34cad3
BLAKE2b-256 f7d4f0528755dd76d189b4f3386c74ce6191651e0c8a19a20925d44e93688f5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.53-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ebc3d8ed9b51312f6fcb9433255e6b1254a2c34d4a4fd9bb34fe61ef771126de
MD5 4774df55ecc099947a91f9df1e097e76
BLAKE2b-256 87b81e1422bf7c2854501f318eb7651c961fa8ddd9332d8e494c653331c021d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.53-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ca7fdf451369221e659ec84b1a19df68e0c79ab8355b582b60deef13837ce9de
MD5 5c40dd4b2f3f9878ec02bfbccab1ad3b
BLAKE2b-256 d1cbe78acd692730a6e308a2ce43fa73893da12fded05c68f41010595df90665

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.53-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 747.1 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.53-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0e8e8f96c885737a291fc019d20f55b77fba6538b09e9b6453ffe8b8252b6263
MD5 e4eee3de26f3fe2218f85f9062ad442d
BLAKE2b-256 e433de4fbbcca397378a04c5e69d96a8d95df1486ac380d92db3ee7924e0025a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.53-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6998ba4d283f834bb866f92edbed85f6c167ba074bbd9e51f2862f5c3cb4aaf8
MD5 6f9d563f59275e982dad9e8e1ec8171f
BLAKE2b-256 af3e2fc7d1f2d3b4b6aa3858bf809446d8f2913ebd71f842caf933adfaf20f84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.53-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 4489204bfb0957da5998e3aceabddf46b297a61e97c30d981e6890596d71a7ce
MD5 de1614ba0376893ee3bb0bdfeae42c6e
BLAKE2b-256 c684a7d965a3ebf3e5aabd0079e57ff4fac0e0c7a18cd7684323f8d336df7098

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