Home

Awesome

๐Ÿƒโ€โ™€๏ธRunhouse๐Ÿ 

Discord Twitter Website Docs Den

๐Ÿ‘ต Welcome Home!

Runhouse enables rapid, cost-effective Machine Learning development across research and production. It allows you to dispatch Python functions and classes to any of your own cloud compute infrastructure, and call them eagerly as if they were local. This means:

  1. You can natively run and debug your code on remote GPUs or other powerful infra, like Ray, Spark, or Kubernetes, from your laptop. Your application code then runs as-is in CI/CD or production, still dispatching work to remote infra.
  2. Your application, including the infrastructure steps, is captured in code in a way that eliminates manual gruntwork and is exactly reproducible across your team and across research and production.
  3. Your flexibility to scale and cost-optimize is unmatched, with teams often seeing cost savings of ~50%.

Orchestrating across clusters, regions, or clouds is trivial, as is complex logic like scaling, fault tolerance, or multi-step workflows.

What is Runhouse For?

Highlights:

The Runhouse API is simple. Send your modules (functions and classes) into environments (worker processes) on compute infra, like this:

import runhouse as rh
from diffusers import StableDiffusionPipeline

def sd_generate(prompt, **inference_kwargs):
    model = StableDiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-base").to("cuda")
    return model(prompt, **inference_kwargs).images

if __name__ == "__main__":
    img = rh.Image("sd_image").install_packages(["torch", "transformers", "diffusers"])
    gpu = rh.cluster(name="rh-a10x", instance_type="A10G:1", provider="aws", image=img).up_if_not()

    # Deploy the function and environment (syncing over local code changes and installing dependencies)
    remote_sd_generate = rh.function(sd_generate).to(gpu)

    # This call is actually an HTTP request to the app running on the remote server
    imgs = remote_sd_generate("A hot dog made out of matcha.")
    imgs[0].show()

    # You can also call it over HTTP directly, e.g. from other machines or languages
    print(remote_sd_generate.endpoint())

With the above simple structure you can build, call, and share:

๐Ÿ›‹๏ธ Infra Monitoring, Resource Sharing and Versioning with Runhouse Den

You can unlock unique observability and sharing features with Runhouse Den, a complementary product to this repo.

After you've sent a function or class to remote compute, Runhouse allows you to persist and share it as a service, turning otherwise redundant AI activities into common modular components across your team or company.

Log in from anywhere to save, share, and load resources and observe usage, logs, and compute utilization on a single pane of glass:

runhouse login

or from Python:

import runhouse as rh
rh.login()

Extending the example above to share and load our app via Den:

remote_sd_generate.share(["my_pal@email.com"])

# The service stub can now be reloaded from anywhere, always at yours and your collaborators' fingertips
# Notice this code doesn't need to change if you update, move, or scale the service
remote_sd_generate = rh.function("/your_username/sd_generate")
imgs = remote_sd_generate("More matcha hotdogs.")
imgs[0].show()

<h2 id="supported-infra"> ๐Ÿ—๏ธ Supported Compute Infra </h2>

Please reach out (first name at run.house) if you don't see your favorite compute here.

๐Ÿ‘จโ€๐Ÿซ Learn More

๐Ÿฃ Getting Started: Installation, setup, and a quick walkthrough.

๐Ÿ“– Docs: Detailed API references, basic API examples and walkthroughs, end-to-end tutorials, and high-level architecture overview.

๐Ÿ‘ฉโ€๐Ÿ’ป Blog: Deep dives into Runhouse features, use cases, and the future of AI infra.

๐Ÿ‘พ Discord: Join our community to ask questions, share ideas, and get help.

๐‘‹ Twitter: Follow us for updates and announcements.

๐Ÿ™‹โ€โ™‚๏ธ Getting Help

Message us on Discord, email us (first name at run.house), or create an issue.

๐Ÿ‘ทโ€โ™€๏ธ Contributing

We welcome contributions! Please check out contributing.