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.46.tar.gz (940.5 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.46-cp312-cp312-win_amd64.whl (514.3 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.46-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.46-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.46-cp311-cp311-win_amd64.whl (537.4 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.46-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.46-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.46-cp310-cp310-win_amd64.whl (533.9 kB view details)

Uploaded CPython 3.10Windows x86-64

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

File metadata

  • Download URL: verlex-0.8.46.tar.gz
  • Upload date:
  • Size: 940.5 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.46.tar.gz
Algorithm Hash digest
SHA256 d41c5c0bd4654a2e28390a6ccde3b0fcecccb73c051da736ca489e8cb22cbe33
MD5 bf57a82eda3d59a9a70558fc6b3a924e
BLAKE2b-256 0b25108bd04860d793d6ec1b1921368b3ff9974e00139349fec6bf7a371fcf02

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.46-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 514.3 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.46-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 47e6f9e2b626264c3c9a108b533de7655cd56dc65a487fdd1890ac575cbdfa0a
MD5 cf05782bb0be7a0bded7b3ccfedc9273
BLAKE2b-256 696975be2ba2ae659eb2f6fe5b9a040e856574ec5e0cf768b34b8d913371dcb9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.46-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5633005595e9600b5922080d5cea1ad628a3f0c5f75db7cda5a6a4e2f83accd0
MD5 60dff8e142a1c3c522422544a7326039
BLAKE2b-256 2d5f6178c2bbaab97d52fc855ecc7125e3081b1e936300b9c543af51908c624b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.46-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 c70f5b97aa70fe9de5459a596d9a4d483730b0cde85399e41270a5409a5d15aa
MD5 fe69565c06758b58c63d134a27fdf317
BLAKE2b-256 899f61a48148e243581fd5f8220d02dba8ac930555c848a5090fe1d9e3d74817

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.46-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 537.4 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.46-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 957003c962107c4380ee4b44b19b17274ca490436be89da1ce22b91902a1096d
MD5 2eb10db7d850c09d0faac56de7ef9ad7
BLAKE2b-256 eb9d17a33732fb7bb19876276d6aacd298a710a59978e01a121f87bdd3fbe8c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.46-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a3614896ad6f069fe0cf7b6aab22e596379555be82960670588c843a78488801
MD5 0e3bf6c571496efc11fc9f16ccc029db
BLAKE2b-256 0ec61b1722e766ed5609bc2f976532f802fba6807ba360c35d7429caecec7702

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.46-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a713c14250d783a36c23dd489b0b5cca08415a78f3c35d4a3fcb54bdf66807c4
MD5 850fb6e01df8f95fce2a3c64121222f0
BLAKE2b-256 24fee8d4aab633ea259a14c3082638f162d886d82139f1948b83b65f4ea1f2bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.46-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 533.9 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.46-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4c2bba4acc4f9edebb6b0d61d95d1ccee539e3635e63d1c64812136f4d21e17b
MD5 1bb376766830a3baa5923f6132b584da
BLAKE2b-256 b38a4cc9db470229133f5931542117bb7cc084e3f77f523802788d3479c89578

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.46-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c927a7ceb64b176d579b3994c1fd6961c05610943ef88172ea9e55d5379b5cfd
MD5 05ea0d0b9a1cf220e221d83258462af3
BLAKE2b-256 ef8bfda76bf5bb64484d03ab6c3e0c4b364b4f02273508579c25b60b21a19227

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.46-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 cf496515db75b82136a36ff624af13d66fb73875a87325588f0ae599c15dff8f
MD5 7440abded81a17d7c8878bfbf84c420b
BLAKE2b-256 bb731fc6299071454e60b220d23c29aa789c386966c18a0d3fea1f3c21c4ced6

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