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.44.tar.gz (921.0 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.44-cp312-cp312-win_amd64.whl (497.6 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.44-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.8.44-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.44-cp311-cp311-win_amd64.whl (520.4 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.44-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.8.44-cp311-cp311-macosx_10_9_universal2.whl (1.2 MB view details)

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

verlex-0.8.44-cp310-cp310-win_amd64.whl (516.9 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.44-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.8.44-cp310-cp310-macosx_10_9_universal2.whl (1.2 MB view details)

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

File details

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

File metadata

  • Download URL: verlex-0.8.44.tar.gz
  • Upload date:
  • Size: 921.0 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.44.tar.gz
Algorithm Hash digest
SHA256 65eb24c91cc747737c09c3934e8527da6a009cb4b2adfdb12ba8d2141018fe3d
MD5 39d6125ebc53e76bb05b0cc3980665de
BLAKE2b-256 9bb1b4cdfa707f6e417fb1c93bfbc86e5561a67a1dfe45e9e8b33458ae0ddc69

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.44-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 497.6 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.44-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 aae34b864d97a391ff70f442006cd5e70a6de3d491af731f1494c268d9c0aa55
MD5 c321606a59d8ec897ca8b21596997cf5
BLAKE2b-256 edbf6262982a8f8ccdca67816b5314a94dc0e2a9500f18589afffe6112f8170d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.44-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e4b8cb868ca909f6af8417f27bf82cf5a5767058507e5c3d6bf8b7362621648d
MD5 6b1b3a20d30366393a528fcb636a9145
BLAKE2b-256 0f117a1f66d8668ef6262a0edde760740af186020ca70cd7bd6d106b02ee0335

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.44-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 5fb79f134b8b765797ea812928fbfccf2630f7a737e287bc62527ec48644f105
MD5 e5ac312eadab34c2e06a013355efc521
BLAKE2b-256 fe814ef1ab0a2460dc5a9c372d4cd28ffa2f09acf53bb13020a4131861c67576

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.44-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 520.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.8.44-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0c8d2fa60783c064ed20a41cba33071791cdc97bc6d41804dc26fb0f195a4537
MD5 ce0b289bb3868eed8c49a788b27c2dff
BLAKE2b-256 302b6ddb8a7aff7598f75bbd8214481e108fef58d61041527eb563105ceedb3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.44-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53816949810f35138a5614c6df930ada6b83a5959c1d6d4be701101c55d85f7d
MD5 7050571685d7ecd16479c13d0ae8f860
BLAKE2b-256 c63c2fab5f6d4e4827265f73bba8cba0cfb75a2564d005e7f79efe09def0cfa5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.44-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0d2fbe9aad866c212167edb4eaf09b6f077bdc1913d11f5278c3bc1337fe456f
MD5 2cd09292607c800f16af7de7a9ad84d1
BLAKE2b-256 df2e77b957b3e13db2e5202a32353858bd5f1e225a418561459b07470e6ff138

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.44-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 516.9 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.44-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d1c0890ecb8c3eed031a11b9ee922147c278729f6da4c6e00ed5b16021bb76b2
MD5 1f46812ec16497c4942961b6fb366add
BLAKE2b-256 b660a95d565389f8df56696b1b9b289677fb638df016cae81a4842956bda15df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.44-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 367ccf1f01f715cfe6820db7aed51eca075dc2cbe5fb7a2ae5f2ab303c812c3e
MD5 f894195ae910f4289d4944c364761090
BLAKE2b-256 4b1822f480386fc58f593b933d98a8e25d5e8c752b84786d25db966c3ed9f295

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.44-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 22282878bf5dc1959f2def3153d7fd20c9687b2b4783c3e07fa8975d5ed925ba
MD5 650e117c20c015b5b102d360a563ff8e
BLAKE2b-256 c9b18a385398cfa673467687d98aa661a8714a88db80beecdf850d03e588b5e2

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