Persistent VMs are now available.Learn more

Deploy any Hugging Face model as an API

Go from a Hugging Face model ID to a live, autoscaling endpoint with one Python file. Beam builds the container, manages the GPUs, and caches your weights between requests.

From the Hub to production

Declare your dependencies in Python and Beam builds the container. You don't write a Dockerfile or stand up a serving framework.


Ship a model in three steps

  1. Pick a model

    Reference any Hub model ID from transformers, diffusers, or sentence-transformers, or bring your own weights.

  2. Wrap it in an endpoint

    Add the @endpoint decorator with your GPU and image. Load the model in on_start so it stays warm.

  3. Serve, then deploy

    Iterate with beam serve's live reload, then beam deploy gives you a production HTTPS endpoint.

terminal
# Develop against the cloud with live reload
$ beam serve app.py:predict
=> Watching for changes...

# Deploy to production
$ beam deploy app.py:predict
=> Deployed 🎉
=> https://hf-inference-abc123.app.beam.cloud

$ curl -X POST https://hf-inference-abc123.app.beam.cloud \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -d '{"prompt": "Explain serverless GPUs"}'

Frequently asked questions

Which libraries are supported?

Anything pip-installable: transformers, diffusers, sentence-transformers, ultralytics, or your own packages. You define the image in Python and Beam builds it.

Can I deploy gated or private models?

Yes. Save your Hugging Face token with beam secret create HF_TOKEN and the container authenticates to the Hub securely.

Do weights re-download on every cold start?

Not if you cache them. Download weights to a persistent volume once, and every container loads from disk instead of the Hub.

How do I pick the right GPU?

Start small (a T4 handles many models under a few billion parameters) and watch real-time GPU utilization in the Beam dashboard to right-size from there.

What about chat models with an OpenAI-style API?

Use Beam's vLLM integration: it serves any compatible Hub model behind an OpenAI-compatible API, so existing clients work unchanged.

Pay as you go
billed by the second

Give your agents their own machines

Sign up, install the CLI, and launch a sandbox, VM, or GPU from your terminal or your coding agent.