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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.10Windows x86-64

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

File metadata

  • Download URL: verlex-0.8.47.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.47.tar.gz
Algorithm Hash digest
SHA256 3df32e0f0f15ab64ce5c9af1ae2f60ca477b8db8de57b3b09db0b190c3cc3563
MD5 f2966fcf82ac3eb151c109d27c3236fe
BLAKE2b-256 adb77aece1c48b54f449d45b3ee763ae0e6c90b1cd0a7fd3f0cf1aab98558cca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.47-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.47-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 af58c477031c3acf873de4b844e1b7e84956e1e5ed3fd86bcd44cb7dc0a18771
MD5 596dac583173d92f1a44bfb47dd673bf
BLAKE2b-256 5f3dfd9a9eb18ca098f4bdcc5c85e862c9d0fdf31293ee76313f396bb6a76928

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.47-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cffa1a6c8f700db8966144f7341f65b11ce0195a88e38d18bff427e9c8b06aed
MD5 cb37ea0af5f7a13f40217cf1d1607278
BLAKE2b-256 b758a68ce0476fbd228d278b4b6f505e2f6cc4f1fd9f73e07227ad5f2f87df70

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.47-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 202e51eda2c4be4aed3888442c7db921aa381f82bd539d8c6849b0c410c11e27
MD5 e436771518c89e0b4aed6e860ba26e9b
BLAKE2b-256 7bb03e36c3ac88c780965e99f8a6758543108eb7c6961b134eb8b29421e73741

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.47-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.47-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 81200b3fe7d5482a5eaf831c1a1564f397e516fde48543a7b4ae8ffb881cfac7
MD5 a7d0c92f0839ff8e2ab11626d655f5a8
BLAKE2b-256 dae85f1d4fa395d75eea80894d109db3e2abbc1b2c777d16fac40a0325319399

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.47-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 93abfa19e4291c4a8191aad935989f1932393bfa440603e4b51e56487f9916ae
MD5 dedb70cf55cf6245ec6a814be563e513
BLAKE2b-256 e0b970c4336626142b8af798ac5e9febe39a2e732249448d5e39d70becfb0623

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.47-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b5161a57b5fac5bd66221ffdf2fc115339ccd3b334d371aa63bb2ec09ed2aff1
MD5 d76f495fc9c71d7b09e7cfc4f0414aae
BLAKE2b-256 daa10ae3ba20485696f4bf9b7952871eac18af41e3890f21cfc57c6305d43aa3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.47-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.47-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 dcbce19425fecb3236be97e8995fea17e3c78ad30c60f5e807e3cd990ca525f8
MD5 80548b2ca1de991d8106a75e62399984
BLAKE2b-256 0341bfb02f5941fe3e820f6740d5820ef5912cb9c0771b5b0cb47a5c02832f6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.47-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b3216015b603e59c7375bae3a1fd8d105bb6e88db67d08152a9fc8f07e2f3cbc
MD5 f2394948eac9e3e495c511b9cbf2a048
BLAKE2b-256 73a1892d041f361339d05b6911b82d2ab2e1145bc49ed1e2ad08d372fd37912b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.47-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 04fe08736c1dad551a50f9bf26cf08e4dc707759c56d5b9a05fc52db278ae10b
MD5 65963bc461126f5393744e74fd3f4489
BLAKE2b-256 b6b399f1ff0d5e3d91d20667e1a7a9e84c17617746ee8a3689220b849b43f8d7

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