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

Uploaded CPython 3.12Windows x86-64

verlex-0.9.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.9.7-cp312-cp312-macosx_10_13_universal2.whl (1.8 MB view details)

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

verlex-0.9.7-cp311-cp311-win_amd64.whl (768.6 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.9.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.9.7-cp311-cp311-macosx_10_9_universal2.whl (1.8 MB view details)

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

verlex-0.9.7-cp310-cp310-win_amd64.whl (761.7 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.9.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

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

File metadata

  • Download URL: verlex-0.9.7.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.7.tar.gz
Algorithm Hash digest
SHA256 6f26811ce4a7c086e2947234cd3b0234248e5e7f6ddf28d416df4a9ee0b83a23
MD5 30842e95513c7001dff708f053976605
BLAKE2b-256 455b525328545e1266ca687c7123e573c3efc0e80fe46bc28dfe7d4e58be7b99

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.7-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 755.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.9.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bf987b8c823bec12f0eb8e972149158fb90a30b00c5bda896ecc5fe3fa14c4d4
MD5 f7bd7ec9c5074bfbc9122e3ef6dafc7e
BLAKE2b-256 93cf3f449a5dcf2db4ee26c6aed01ecf4ffe91a883f34cf936939439000b0b7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 39098eacce54d741e8fa8034739bbbd8a170d15ca40e5df77a59efe223a880b2
MD5 4edfd4e7158f973382491264c1dab2ce
BLAKE2b-256 9d21ec99f9965d67abdd519435989087ba80ed05af94aa38c232b6478f5e7f09

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.7-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 e8bc8e525a99487fad924392dab75b9ee18d4635d3033f8d3eaf29be5f93552d
MD5 6565239159d531d17e37a3b25b20e1c6
BLAKE2b-256 1a084d0634349b5c041b1bf67179c35f025fcbf89cc22d576a2d585df3e1a322

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.7-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 768.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.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6b95381639edeb1766a433a668e23fafeb82906c29b85a80782d7f2f462cb77e
MD5 2bad85152081c679fc81f40f31b717c4
BLAKE2b-256 8792faca72dd8ac8bb96b7806257d44f14bbf8591df9b154bb11268cd46bb29c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e4eea695c38bd4295ef8ddbe9968c26027639fbccc269a8a0583fd62af83cc28
MD5 933185f44c6dc999b53ce45d2dad82ca
BLAKE2b-256 b56a38a64da893c1ee7b0c1f3b940b7c7b3568b02102ec62a519d6641973a57c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.7-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0e6f1210efbf87a7a805b4702439b7d62ae989665fa9aab14ce77cf227ee4fbc
MD5 b7088cb88423e3e5d25ea0be5f08f1f0
BLAKE2b-256 06eea15be09cd581c3a0431ec58b050d7d56dbf3674a7f29a34ee8a553c60e21

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.7-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 761.7 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.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c4627e435d246151e713d75d872240d9225c520ce9a108716d2141be3cafedf0
MD5 b5bdd3e6f5235a70dd2ea01c843f7ee7
BLAKE2b-256 0b16c10f73af3423d7221856dca40cd2b154308a95d887747e07a30172b53459

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e987d18f128124746eadf2254127643255f769ef221b0e58181d0143fd352b71
MD5 9849f4158f46d8228a70eb565df61b6a
BLAKE2b-256 eb4675191e65a3bfabf2e37da1d1cef7917ccae8db3d6756f3f441883c88496e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.7-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 477b943aff4f311fd8c24567fbb8b33f884c123f5cba5b721c6988ed950361e2
MD5 d2da3a5ccfbdb92133a59027b8a21df5
BLAKE2b-256 dfedd82e2d71e9e916fcc94d8c00371953d1d74ad9c6ce3cde0b7fedab213eb1

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