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

Uploaded CPython 3.12Windows x86-64

verlex-0.8.55-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

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

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

verlex-0.8.55-cp311-cp311-win_amd64.whl (767.6 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.55-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

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

verlex-0.8.55-cp310-cp310-win_amd64.whl (762.4 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.55-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

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

File metadata

  • Download URL: verlex-0.8.55.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.55.tar.gz
Algorithm Hash digest
SHA256 034cc30cd8d7c5e6bce742a137d86a0665dd24111de121f8fec339c0509c801b
MD5 a373945ef8ac7b087856377166ef5625
BLAKE2b-256 5a068e1dbaebdab1b72bd08407a92c8f1a76ecc86dce37fd345a9fe2b4780fe6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.55-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 739.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.55-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4e8da7125009f8bd2db42f4c1b3595a662fa2fb9c6dc1a9459609dd04644e2f5
MD5 75310d5e7dcda1e3c0bf935a77341e06
BLAKE2b-256 de68e72d7e11f815b5ae4cf55aebaaf375087dcf9cef21742b91eaec6b0203ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.55-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bb17fa346362f2670071ae82665c7055e100e18646467a00a80d349f802f3bfd
MD5 85b3db2bb6b6b473a288687c0e8d2409
BLAKE2b-256 40ac710d69d4c01812cdd1edb0992c3e6a9d738397b788d3330ead1c4bc9c65f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.55-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 c916398506246ebab77ec45141535bf46b39267e42a3b225f1c73e2e202c0bb7
MD5 bc483899497eba5fc96ee15bd9c1f0a0
BLAKE2b-256 58858e5c0b7088abb0bd1b5db1fd352cc4f7be2875c7535f56629043c224ceea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.55-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 767.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.8.55-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9fb116b0b6aacb107aa6fc8f6c0e3a90cc58c4ee2de1bf53f903a54ea5b153c6
MD5 2af1c9cccdd20739ecf412c675679a14
BLAKE2b-256 30138c0df37655eaf654f50ebd0c5a4917ffe42a31e4575028f6be0ffe43e07f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.55-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 379a4297eb14d766f4ece4efb6ce5c7ff98663cba8a26f7c0f3ad80c9219af40
MD5 1631c9c99b778496143a3683e5e56fac
BLAKE2b-256 c4d748dd8772d97a31734c41fbcd1669d0822ca7bf76b4dcc880cd96ff20d985

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.55-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 27f63a31970d0a0770e74e2087e28eac4a137719a6a25082d0c94d02da2809ab
MD5 86225979b0ce34f713f264b4f25e4dbf
BLAKE2b-256 2bb57273a71ad0f84d008b9a21d81753b88830ec18cb0a8874149775379bc430

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.55-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 762.4 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.55-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 eba005fc3286c9b93769517b678fe9952f85e002891cf235873aa636351b929e
MD5 d66b67774dcd4fa644d2d3518fc43907
BLAKE2b-256 e664029eb538083a93d0665d0577e74bae8294f18008a62842b4af18bafc16c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.55-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1008387531c871d81b755e59c91095135d5a0acec7252989755f673d09b476d3
MD5 461dcc01f8763323d41f05f49b7d56cc
BLAKE2b-256 2b6e74ce04cbc0dcbed0c65477e3a7027def9ff987e2b493098e4392e28bf677

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.55-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a23c61f964e9fc5da9e1e494cc30e3954469feed344618dbedcfa84905c46e28
MD5 1e9962876a057a836668e89e64865cf1
BLAKE2b-256 e8b37e3ae3a0ce414cc1cdaa43adb120f599293c7bb514abe7372bca7bfb3a34

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