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.42.tar.gz (922.8 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.42-cp312-cp312-win_amd64.whl (500.5 kB view details)

Uploaded CPython 3.12Windows x86-64

verlex-0.8.42-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verlex-0.8.42-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.42-cp311-cp311-win_amd64.whl (523.7 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.42-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verlex-0.8.42-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.42-cp310-cp310-win_amd64.whl (520.1 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.42-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

verlex-0.8.42-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.42.tar.gz.

File metadata

  • Download URL: verlex-0.8.42.tar.gz
  • Upload date:
  • Size: 922.8 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.42.tar.gz
Algorithm Hash digest
SHA256 3b8f0ba0a337950755da8f60696dce9963af9db89728902bd5cd6a1bc8db9a99
MD5 562c4fc1bac96d51c5882d623c1e64a4
BLAKE2b-256 7cb69f6b13be5f9952b707605579d5192c7f493490a4fd1f378dae4a86900b3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.42-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 500.5 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.42-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 49e955ccfdd96faa4d0158b8d87e41dc27304caeaecbebe60090e8c59e0246be
MD5 83b22fbd26e3a4e7ee81ebe38b8625f6
BLAKE2b-256 6bedd50a596dafa7a94e82afbc6d70ca9f58a19a8e125b749a45b62ff9291ac6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.42-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f9c24489c5b1b34dd7304dd98a39c42ce4d5980abe1d1d9223a964529ae66e7d
MD5 e66fe02c75cf31e266ff535a70f208a4
BLAKE2b-256 c0fc548f9e79ddab50fe7c633d1a2fe67f91e4208c38a1a5eda5f51e80f181eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.42-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 a78be7ddaad3d43abd53bbb9f1e08359372dd7d567182da60fd7a475ecc392b2
MD5 3e6e63090a7bc39fb141c63f1f0569af
BLAKE2b-256 de49e6de37003c31d56918a76c245bd54c1a3274d8537bc25456f5897ca6c9f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.42-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 523.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.42-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bcf0ca7ad30cec5e7e910ecf0dbda1511e77479a98ce76086c913a391efd7fb3
MD5 83f1c17619826da2b7d6361e68985aa2
BLAKE2b-256 3a91a2b542152b8b68a41680a61cf89dc3d24c12113e9b6447265efc9ffc0d02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.42-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 98259ab79aaf08809e3fc244f2ca965ea92b6a72a8ac0b44594c977a344cdaf3
MD5 b93d5d6d74a5d1c8dcdc7de4eef9d8ec
BLAKE2b-256 2f82f05696cb312b0fd006d07e61b499faf262fc49384591feade82215eee56b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.42-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a68d561d3d54fe66424fc7f913ccd8f2c1a21d79e58025205e8d35fb9de4dfa8
MD5 8397240ad57377129b8b20a56c1d9fbf
BLAKE2b-256 a0dd76d9ba66c94b1787fbbd24fa12bdc787d278bd1f28a49682ea1c37cd1e67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.42-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 520.1 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.42-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7be5ead893fab4c643ade8295ed61b07969bc72304217a6ea3311415f23fae19
MD5 1b2bf1f7b4943f52bea25c31a323e414
BLAKE2b-256 a0e60d85d8b85d969f757080224d68cc3e4f17f519a07ab32f6ab7c8e642dc86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.42-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6e58f206a30f5c2818fc49d4dd8b896ea6adeb42d13f28fd39910a302e9c242e
MD5 b6b2d0eb4d5a2a67bde497a86210ec53
BLAKE2b-256 293e8738fd3a244a14132be55035ac19c5f9d79d3319d311ddd4008cb3841f9d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.42-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0f99653ea67773c97c61972f2ba31d7adabc529ec30adfc0ea5b3b4727bec7d1
MD5 bd26e0e5f98903a6d682c44af0f7d1eb
BLAKE2b-256 a3ddf92945387a89af725c86369782132ebc14710794e00726e23052322a9c96

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