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.8.tar.gz (1.5 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.8-cp312-cp312-win_amd64.whl (786.7 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.9.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.9.8-cp312-cp312-macosx_10_13_universal2.whl (1.9 MB view details)

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

verlex-0.9.8-cp311-cp311-win_amd64.whl (799.6 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.9.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.9.8-cp311-cp311-macosx_10_9_universal2.whl (1.9 MB view details)

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

verlex-0.9.8-cp310-cp310-win_amd64.whl (793.5 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.9.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.9.8-cp310-cp310-macosx_10_9_universal2.whl (1.9 MB view details)

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

File details

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

File metadata

  • Download URL: verlex-0.9.8.tar.gz
  • Upload date:
  • Size: 1.5 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.8.tar.gz
Algorithm Hash digest
SHA256 4bfddfcbe9e08b6e182ba78d7f6e58715617f33912349a729c2d5a00178dd8ca
MD5 e7b2567a344e3a0c7a9348b4056833bf
BLAKE2b-256 df931e1559209b5627cb8c33ad84d661c62f2797e067a2de13d328df8cd5c583

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.8-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 786.7 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.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 34b6562f5acdefe792f0aa36416256cdf710f8a3fac4b637f3a7424f1496b990
MD5 ea8d148112ea0e94104c7895b64ea312
BLAKE2b-256 dcb4c890295844709f047c3940d5916538f8e7ae61027d92c7a9f4dae43cae50

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f905c4871c5186612b11c56690f749a74c62862542c37054608bc1f266b58178
MD5 32c2cff58fbb3912afe3eb52fd024c0c
BLAKE2b-256 0eeaf4bf826fbfe50af153cddc5ac200a0a087c68ee8c90835431a7af2051ba9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.8-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 f5fd5d31d52eb8b8c8e05353358e5b0885f5288eb21f07c207310d3b11705ca7
MD5 a24c22e3e7515c334bc9b161e2538345
BLAKE2b-256 135de659dcaa81d44128a28848b9e83f8b312dc11673a317e181559fd2c4059c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.8-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 799.6 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.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a2d814bf61db6eaae92ca5516fb08afda15610bcfada6d79a1d245a8d8fa9b1b
MD5 9c6f1d9ca85f32e1702f8b806eda158f
BLAKE2b-256 16d27d2b25fe7828bdd684325995b7057bb8ddf577a368edf0c0938e56ec9136

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bc8d89c2bd9241fdff0ae9af19943a8b718c18b86cbce08517fb265758a2b8b0
MD5 6002d68b39d48b193c8325dd9d6492af
BLAKE2b-256 cb009999152dc5292621fa05e60c92bbbbb5e8b42c6b52ef0316dbab0154177d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.8-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 3a3a6f46e61f84c07132f912040f47455633fa3f7ac8e138fc845cac2547ac5e
MD5 ba71e5520a8bc79e5bad4e3ed6c1149c
BLAKE2b-256 816fbb3eac374743dcc976ca14966fd9d10ee38644d4c4ce96b77ce99ea99e85

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.8-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 793.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.9.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8f16e183174e2f32bb0813a9f04bc999fb7ddbe1bd9b06c37f402fe18b2bc977
MD5 5aff7dcb0ae965c7f687d53cda1a78e2
BLAKE2b-256 b7f53c83228a1cadbfda0d931a47722bb4e875361436ced483909c74c5f76f35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ba923dcde6f9081980ef7adbb2d627e5416d576560f38e824b4ade6d4e105bc8
MD5 4c63ae36d4bc5fef976cb209f89ae3ca
BLAKE2b-256 f7e8b526c28f912041b9e6ebc72ca810958bd6556b1ec60298c45df65c5d2658

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.8-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 de94da1ec3462a7439743a77a0424a7317c296d5b7fd5236624074bd9cbc47e0
MD5 debfe90a35203be67730fcc3620712c5
BLAKE2b-256 378a8f2b85b198f22964666450e90613d024320d98ea775c98b552847b6df602

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