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.48.tar.gz (949.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.48-cp312-cp312-win_amd64.whl (514.6 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.48-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.8.48-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.48-cp311-cp311-win_amd64.whl (537.7 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.48-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.8.48-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.48-cp310-cp310-win_amd64.whl (534.2 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.48-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

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

File metadata

  • Download URL: verlex-0.8.48.tar.gz
  • Upload date:
  • Size: 949.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.48.tar.gz
Algorithm Hash digest
SHA256 38e880833244db3081e49f16e0942edee460ba4701ec00871dea48c1a844a002
MD5 992924e575e672d7a8c9df74b3a1ab5a
BLAKE2b-256 35159b790f6943469b9ca503a2135cb36d0f602fc164f8eaa0db598669601014

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.48-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 514.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.48-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6374a86eeb5316fe6408fce3199fbaf8c4a67332eaa558750fe85f711d7781d5
MD5 fefd8590f54443e6f974ead30fd48fd9
BLAKE2b-256 3c90501872e078b040640590785d09bee036c10304784f52ad43f65ae497b15b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.48-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca3944f2408eb774d8b29e740ea7245dbd08d1a4f786dfa47436c758effad68c
MD5 050c63e45ed7b96fc12cc7e306859b5f
BLAKE2b-256 56af199aa929afe88e9c99e734df6e5dcbe0d3a4b1c41a1e237a8c1a79c5b5d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.48-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 6dd11dae6c53e27b4874bc6ef9c8ad3f45c9dc01b6130d62b0cc164c804b8ba6
MD5 6848d401cee8ed58362fa250149949c2
BLAKE2b-256 7782ef60a8d4c736c2dad444a8996be22787f0430cd1bdda225f3a3386cf7251

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.48-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 537.7 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.48-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d8fc5d6289581709ac40d37b30641f7c9d95c5329164b7dbe6b59098dd7d2a73
MD5 c96bfa0ed8ba03e00aa83f8e9ba60ae7
BLAKE2b-256 d72beae5e377eec3da36a1de3adeab3635c30d8221346edcf0f5ed923e053ec4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.48-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a3731ab7045f32b74cec64e2617abddb7660cac9e281f45c3b1d72b4fa5e0bd2
MD5 d24cc14d31c828120fef3e302bac9a56
BLAKE2b-256 dc601596d903f1a60655f3b785d266d7ca615fa59c0c49058c79adcd64bfb747

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.48-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 f337662936df7457e4e948b3b021ff32f944e1d33f7f84f810cb5a1cd5f409b3
MD5 c9943c55f8d27c93224f84e4f1676cd9
BLAKE2b-256 3c0ef6aa925c0bfaf891989b0db161cefab6760dc66f843e8f81e7bb3c242f7b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.48-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 534.2 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.48-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3a6b50a93415e813862486153dea7cd2b9f2b79d1400f3a3a75923420da3393d
MD5 2fa26058830a971c9da6940afd7094af
BLAKE2b-256 d441b2a0517560442ddd2882dd5d6e724232ceaf912ce01b6900ea9166c5ef77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.48-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2b77d3c15d502f202be32014f3b13fc4b783f7e0ceeedabf7754589af4ddc5a0
MD5 8783f0eeb8e6cfc2ca06c82423cac57f
BLAKE2b-256 0d333d66f37b1a7df5175e7130950431da502556f5fa2c9835f1f9b6ff93af1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.48-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 8ac1fc962af4063cc2b62eaf3eb1502f08f86ba18147268cb70fc0ddf35e8417
MD5 c98fd3da6a420b609b219c7542caa231
BLAKE2b-256 2e9635a60cf53bb799e7e7d00528c4fb191522795199bbfccf4f9856f75be9e3

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