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.37.tar.gz (889.3 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.37-cp312-cp312-win_amd64.whl (471.2 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.37-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.8.37-cp312-cp312-macosx_10_13_universal2.whl (1.1 MB view details)

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

verlex-0.8.37-cp311-cp311-win_amd64.whl (490.8 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.37-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.8.37-cp311-cp311-macosx_10_9_universal2.whl (1.1 MB view details)

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

verlex-0.8.37-cp310-cp310-win_amd64.whl (487.0 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.37-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.8.37-cp310-cp310-macosx_10_9_universal2.whl (1.1 MB view details)

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

File details

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

File metadata

  • Download URL: verlex-0.8.37.tar.gz
  • Upload date:
  • Size: 889.3 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.37.tar.gz
Algorithm Hash digest
SHA256 4245c2cb0168df8358a38358382fdf66c93d47c001696d7f67227e9d2cd9e37a
MD5 552254a65882d235037f12ab7c64888b
BLAKE2b-256 944e6d60186a07dc469d67c5d936d429526ef53f0ee1a2a4e275e6a1f71928a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.37-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 471.2 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.37-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3a6eb9fd4e8d6d12c59a054440da5f4cf750ecd255a1dfe2b6cad8a3ec922af8
MD5 c58d4a4db720a21ce8b9257976c6f39f
BLAKE2b-256 6b581507e7c0541878a7a19f6efa2579849a54863ad78ef8438decd3766f8768

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.37-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f1f372acb2d2b8d4af7350d3816dbb25dec38d223e3d23956ff784622b985ff3
MD5 1822bc9f6159a54da98c335d47366a75
BLAKE2b-256 3cedca693b607813fea0e4a1325b61ebbd6f8d56f40251973e7dfd51b975f79e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.37-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 96737db06115322fbcb45d6fe4be8c85b47c5eb4d57089c71abe8d03a4380eb8
MD5 6f0bc74dadd50ff214ddb8a3b5258117
BLAKE2b-256 9a5fb143d2d7324260507834c4c35bf59784a189c366843032a544b9cf1f4446

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.37-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 490.8 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.37-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 68ed958f1a6a406d281a2c91874e34a4dc2342e05826fa62e6c72c428324589d
MD5 de0e56c8d1a886aafa709fe4523521f3
BLAKE2b-256 b217c682f3e4d060ded3f4d247e9d22fd1adef2cb3b43a427d7cd4c5d2919be6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.37-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 97a057e1c42e3aa0bfd2605a8a3f840aa15aea30a771a24af3e80df9c8b35558
MD5 12add1861aef130fefb8d1f896c0fbf8
BLAKE2b-256 48d32b643075310f2fe1608a6728777de4a167ef03541613f061d8f99e39a67f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.37-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 20711ccab14f1456d03773063f6ddf36362445e3402c0e22f78d72ead0aa1f2e
MD5 82699a1e74ee5ad782d2a5adf62794bb
BLAKE2b-256 5c67b53738176ebecbd665e276ae9fee8bf089d8f6d632e29478774e0f111222

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.37-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 487.0 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.37-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e33d1fc6d43502b1d26c880e04cf9954594401f52076f38aa186a5e7d0a4d6fd
MD5 5989c677e41118d6d172add98effcba1
BLAKE2b-256 e57f5a503a41f108044b7f59a22036b1b2b666bddbc50fac75db5d89736d653a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.37-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ffa8e30395d34321fdec2c50f1a262184f1905d4fe1b660777bed0b4d9956d4e
MD5 293bfee39bfedd65ea600cd9417b05e4
BLAKE2b-256 169112ab5cfbfe89aab35e5eb6cdb77214bbfd5aa26a81f1771b94ad332f4abd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.37-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 09a4c412b669c654fbfac024d51efdddee96e9f3a7631a5082e059b43ad47f54
MD5 ed62e128a50e4d07b0a365898e5d91a4
BLAKE2b-256 fdb3f03119731d3c78f5300964338108ff3d196ecf178b2e393775de238173c2

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