0.2.37

  • Added directory support for Outputs
  • Added PIL Image helper classmethod for Outputs
  • Added homebrew tap for binary versions of the CLI
  • Improved cold start performance for external datacenter providers
  • Added new GPU types (H100, A6000, and RTX6000)
  • Added autoscaler functionality
  • Added mv command to the CLI
  • Added login command to the CLI

Upgrade to the latest CLI:

pip install --upgrade beam-client

QueueDepthAutoscaler Added to V2

You can control your autoscaling behavior with QueueDepthAutoscaler.

QueueDepthAutoscaler takes two parameters:

  • max_containers
  • tasks_per_container

In addition, for those using vertical scaling (multiple workers on the same container), concurrency has been renamed to workers (following the conventions of V1).

app.py
from beam import Image, QueueDepthAutoscaler, task_queue


@task_queue(
    workers=2,
    image=Image(python_version="python3.8", python_packages=["pandas", "csaps"]),
    autoscaler=QueueDepthAutoscaler(max_containers=5, tasks_per_container=1),
)
def handler():
    import pandas as pd

    print(pd)

    import time

    time.sleep(5)

    return {"result": True}

Move Volume Files With The CLI

You can now move files around Beam Volumes using the beam mv CLI command:

$ beam mv file.txt beam-volume

Moved file.txt to beam-volume

This supports directories too:

$ beam mv file.txt beam-volume/files/text-files

Moved file.txt to beam-volume/files/text-files

Login to CLI with beam login

Automatically add your API keys to your local machine with beam login.

$ beam login

Your browser will open, and fire a callback that saves your Beam credentials to your local machine.

This eliminates the need to manually copy and paste your API keys from the dashboard into your shell.

Install CLI with Homebrew

You can install the CLI separately from the SDK using Homebrew:

brew tap beam-cloud/beam

brew install beam

Upgrades to Outputs

PIL Images

We added a wrapper around PIL to make it easier to save PIL images as Outputs.

Output.from_pil_image(pil_image) takes a PIL image and returns a pre-signed URL that points to the saved image.

from beam import Output

image = pipe( ... )
output = Output.from_pil_image(image)
output.save()

url = output.public_url()

Bug Fixes

  • Container images were sometimes not being found when an app was starting
  • Stop endpoint containers from shutting down during long cold starts
  • Correctly render saving a container image during an image build
  • Handle cancelling image builds correctly
  • Correctly sync files and directories during a Serve
  • Fixed timeout issues when a Serve was running longer than 60 seconds
  • When subscribing to a new plan, also set the default payment method
  • Stop infiniately looping with on_start callback in task queues
  • GPU concurrency limits were not rendering correctly in the frontend