vercel-functions

Configure and optimize Vercel Functions across Node.js, Bun, Python, and container runtimes.

Updated Aug 21, 2025
One-click install
npx skills add https://github.com/Adithiya-S/AI-Study-Companion --skill vercel-functions-adithiya-s
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-functions
Source: https://github.com/Adithiya-S/AI-Study-Companion/tree/main/.agents/skills/vercel-functions
Command: npx skills add https://github.com/Adithiya-S/AI-Study-Companion --skill vercel-functions-adithiya-s

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Serverless functions on Vercel fail in predictable ways — 504 timeouts, 250 MB bundle errors, 4.5 MB payload caps, and misconfigured Edge runtimes — and this Skill provides the expert guidance to configure, debug, and optimize them correctly. ## Core Features & Use Cases - Runtime Selection & Migration: Guides the choice between Node.js (default), Bun, Python, Rust, and container images, and migrates legacy Edge runtime code to Node.js on Fluid Compute. - Duration & Bundle Optimization: Configures maxDuration up to 1800s (30 min beta), enables 5 GB large functions via VERCEL_SUPPORT_LARGE_FUNCTIONS, and trims bundles with excludeFiles. - Docker & Streaming Support: Deploys OCI container images via Dockerfile.vercel and implements streaming, WebSockets, waitUntil background work, and graceful shutdown. - Use Case: Your API route times out at 300s while calling an LLM. Use this Skill to set per-function maxDuration to 1800s, stream heartbeats over HTTP/2, and stay within Active CPU pricing. ## Quick Start Ask the assistant to configure a Vercel Function that runs for 30 minutes and streams progress to the client.

Frequently Asked Questions about vercel-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I increase the Vercel Function timeout beyond 300 seconds?

Set maxDuration in code (export const maxDuration = 800) or vercel.json per function. Pro and Enterprise support 800s generally available and 1800s via the extended-duration beta; Hobby is capped at 300s with no headroom.

Should I use the Edge runtime or Node.js for Vercel Functions?

Use Node.js, which is the default. Vercel recommends migrating off Edge, Next.js 16.3+ no longer supports it, and both runtimes share Fluid Compute regions and Active CPU pricing while Node.js offers full APIs and larger bundles.

How do I fix the 250 MB unzipped maximum size error on Vercel?

Enable large functions (5 GB bundles) by setting VERCEL_SUPPORT_LARGE_FUNCTIONS=1 and redeploying, which requires Fluid Compute. First trim the bundle with excludeFiles in vercel.json or outputFileTracingExcludes in Next.js.

Can I deploy a Docker container as a Vercel Function?

Yes. Add a Dockerfile.vercel or Containerfile.vercel at the project root and Vercel builds it into an autoscaling, scale-to-zero Function with Active CPU pricing. It is stateless serverless, not a long-lived server or VM.

Why does my Vercel Function return 413 FUNCTION_PAYLOAD_TOO_LARGE?

Request and response bodies are capped at 4.5 MB. For uploads, use Vercel Blob client uploads that bypass the function; for large responses, stream them since streamed responses are not subject to the limit.

Does Vercel support WebSockets in serverless functions?

Yes, Vercel Functions support WebSockets on the Node.js runtime with Fluid Compute. For long-lived bidirectional connections, stream heartbeats and consider duration limits, or use Vercel Workflow for durable execution.