Unlock High Performance: Vercel Launches First-Class Rust Runtime Beta Support

serverless functions

Vercel now offers first-class beta support for the Rust runtime, bringing Fluid compute, HTTP streaming, and expanded 64KB environment variables. Deploy high-performance Rust applications with integrated observability and monitoring. Get started with official templates.

Vercel is excited to announce the launch of first-class beta support for the Rust runtime. This significant enhancement, evolving from the community Rust runtime, now integrates Rust with the full power of Vercel Functions.

Key benefits include:

  • Fluid Compute: Featuring HTTP response streaming and Active CPU pricing for optimized performance.
  • Expanded Environment Variables: An increased limit from 6KB to 64KB, providing greater flexibility for complex applications.

Rust deployments on Vercel seamlessly integrate with our existing logging, observability, and monitoring systems, offering a unified development and operational experience.

Getting Started

To begin developing with Rust on Vercel, simply create a Cargo.toml file and define a handler function. Below are examples for setting up your project:

Cargo.toml Example

[package]
name = "rust-hello-world"
version = "0.1.0"
edition = "2024"

[dependencies]
tokio = { version = "1", features = ["full"] }
vercel_runtime = { version = "2" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

[[bin]]
name = "hello"
path = "api/hello.rs"

api/handler.rs Example

use serde_json::{Value, json};
use vercel_runtime::{Error, Request, run, service_fn};

#[tokio::main]
async fn main() -> Result<(), Error> {
    let service = service_fn(handler);
    run(service).await
}

async fn handler(_req: Request) -> Result<Value, Error> {
    Ok(json!({
        "message": "Hello, world!",
    }))
}

Next Steps

Start building your Rust applications on Vercel today by exploring our official starter templates, including Rust Hello World and Rust Axum. For more detailed information, refer to the Vercel Function documentation.