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

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.9.5.tar.gz (1.5 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.9.5-cp312-cp312-win_amd64.whl (755.9 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.9.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

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

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

verlex-0.9.5-cp311-cp311-win_amd64.whl (768.5 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.9.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

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

verlex-0.9.5-cp310-cp310-win_amd64.whl (761.7 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.9.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.9.5-cp310-cp310-macosx_10_9_universal2.whl (1.9 MB view details)

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

File details

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

File metadata

  • Download URL: verlex-0.9.5.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for verlex-0.9.5.tar.gz
Algorithm Hash digest
SHA256 2044b3112730dd15076f2a8e8305f531ef99292ee8dc60d54fb062a9d6314be7
MD5 ce45d2dfd866c9381e873e98178cd4fb
BLAKE2b-256 63acc7b1b3cf40aaf24e9b409df27bba22df7a7485a4d213bae48326367820ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 755.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.9.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0f7c4d514d9f089e2bed865c26ea25c1ddc6588d9dbee9f29222426ac2700423
MD5 00d0eb893e655bee83cb900c444705c5
BLAKE2b-256 d8f021d2149db132e84f45a2c486dcde429919386142abc932efc1681ecc8ef0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9c89ec319615bb6b6ebbe9463a5f66384f0d99e9c7ebd1ff7a0db0312798c152
MD5 20c20df434e8d1882b39075e956aca67
BLAKE2b-256 28a7c5c93cf147ea3fb698a817a9faa23c97133a271dcb2dbd3a700f77003cd9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.5-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 39b18e9e6f83915f060b7ad5bfae310dcda274edd98d60549fd07fd5ee2f1421
MD5 77ce203f96dc2f2d8802f86b1cd9bf51
BLAKE2b-256 0e77d2e0dc164728fac3b7b6d8acafa0a757619cb68e3251685e8cb7085e2970

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 768.5 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.9.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 36346e6cadccf0aa4e1da2a10d009e275396cd95cc4bcd8f5b261d1f703d18aa
MD5 ed6f75983bc3ccf47ec3480a92e86556
BLAKE2b-256 cc81e36db5605b9cbe603ca61ff76f465474016864b5e12203d2423b638d6613

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bdb73a2884b98be82388f1ef4f18084b158334de239b2822da0b72eefe1d253f
MD5 b2b68a232a09a0dad1670a967d756e0d
BLAKE2b-256 caa4047d07eeed47cf7cdca01329b35a330570fa1c80978365c09d4f5d516765

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.5-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 cfa42f79911a70104a64d4668904357e383817dbea23d6f4985af83ab422eaef
MD5 f3c7205e43b726fab5c3da0b9d2785ed
BLAKE2b-256 2c696e7a9e826c162da29b1288bdc8c228e9b2d1205b579c16e65e38900e1831

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.9.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 761.7 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.9.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 aab75d23c183ae39dc0b6dd32526f6e06ee02d5e90b153e683b2bd5e86c30977
MD5 b6e53dd91398001fe0908a5e2bf16ca3
BLAKE2b-256 5de511bc1b5e83e968db3b67dd3d766378849ae8805d1d28aa8f877bc0b9c2e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 04759caf0cb7b7e80cb1adb844247f286b1354b16b98965190aa328fc281f89c
MD5 c53625e494f08e977fb13a8316635661
BLAKE2b-256 f7109e6825f08b6c902eca9608eaa6b8276b3833908f014cb19b233c4da8d6e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.9.5-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 6972ef907c03f1cea886222d168b390567dac0d44443eec4da937fffe6287d06
MD5 7c97d239f9e0243c2f92c8b9ec958472
BLAKE2b-256 3c172d0cf31d30a95044a9fbc1d87ad49d7fbacc916f31169c153ba529bee7a5

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