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

Uploaded CPython 3.12Windows x86-64

verlex-0.8.45-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.45-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.45-cp311-cp311-win_amd64.whl (522.6 kB view details)

Uploaded CPython 3.11Windows x86-64

verlex-0.8.45-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.45-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.45-cp310-cp310-win_amd64.whl (519.0 kB view details)

Uploaded CPython 3.10Windows x86-64

verlex-0.8.45-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.45-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.45.tar.gz.

File metadata

  • Download URL: verlex-0.8.45.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.45.tar.gz
Algorithm Hash digest
SHA256 a48b0125500c2179a33b1f4ad3d1784587e88e33f0b0b040d263182f86b34b9e
MD5 8187d6088c9b07a69db8f880216fbb18
BLAKE2b-256 f636dce431151545e89ae45da68c54d0bfe20369aac04517669c971e10a2c44b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.45-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 499.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.45-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 38bb9c8c4c5f65aa3fb4f8fda0c376ea64b746ca2dc5a1bd00f04216e3da3492
MD5 8b0f0dceaffef879b940a393b04b9f4c
BLAKE2b-256 33e0335cddbc021123568c76cb4c05baa4c610298f623f522ef059104d5be9b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.45-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c5f4b4f1451f78aac1dd3b13dae4c19082235433b097d6f01a334994eddab406
MD5 9fe8e59cda30a7c9aff9b5fdd61b4f8a
BLAKE2b-256 acf56b20a0e91102a6d2c7637a42cceeee55c37b434aef9d0ec418e80d6dffdd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.45-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 634897ef7d8857f992dd9b354d046932570bf23c416a8ca7b1b1e60083714540
MD5 f9a17b273d42991133cd0229783b388b
BLAKE2b-256 676e04f7561abfe80eb0cafe9996d727d8db76b87dcd013b59eefb3685086fb1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.45-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 522.6 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.45-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5edeae5aabb8caf4489b7056a89f5a72a1c3e9d4a31486d245b044722d932fc0
MD5 a0576261f91f221c6d8f2837c2e69653
BLAKE2b-256 7037ebcc651f0a5163deb3ec238ffaa4e3886c8c936f78e77278fb3101462226

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.45-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e3779420111bb78c5dbfed93294efe752a8177c7297983ef5773c723ef4f9914
MD5 2385e5b915a6155172d335e2ce9f9f26
BLAKE2b-256 513df6a0823880f5b3cfb243a5ca49042568dec9c0eadeca2a7810f56f08724b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.45-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c2c082b2820d327746708a2c6664042d03ef7e9687e877009b54a9638ea53311
MD5 da8ed6a2f1bc65877a70dd28129381fc
BLAKE2b-256 847abff94a7a977fb93d5a117ca3e79e194951ec2c8ca380d58c7684d336a436

See more details on using hashes here.

File details

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

File metadata

  • Download URL: verlex-0.8.45-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 519.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.45-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e579cc6ed9bab8cb8322050ff108d8172325960bf4e838f5bdeed26b5bd724fa
MD5 92bd48a6c9f197433d808452f86cd95b
BLAKE2b-256 b3bef2ca8b4e5a80a71df4d31d533b7fcd84da552c49c1290d11c64a1f496364

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.45-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0f37213217aff5c11277b7eed56b21b5019f16658d4752cc72b66a868786c64f
MD5 8f0e540b34fcffa092d7ac0ff594aaa6
BLAKE2b-256 e68cd2b9d8b4abb411b833fe01a5638dcc64a1dee02e7c765298fe508724a058

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verlex-0.8.45-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 05da4ed737973ef6f8d41cf4c021f9323d49a2027d2c1d50d87578aad62fc917
MD5 ae6ea04e32c761aa837f968fe3a5605c
BLAKE2b-256 2423ce993486acc7f6a1d67db6860daca61dcf8a9c54a6a17aa038cf8e7e58da

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