vercel/vercel-plugin/vercel-functions

Claude Code and agent skill by vercel/vercel-plugin

Trust tier 4
  • vendor
Source check pending

Checking that the SKILL.md file is still in the repository.

Vercel Functions expert guidance — Node.js/Bun/Python runtimes, Fluid Compute, long-duration (30 min) functions, large functions (5 GB bundles), Docker/OCI container images, plan limits, streaming, WebSockets, and legacy Cron Jobs (new scheduled work belongs to vercel-schedules). Use when configuring, debugging, or optimizing server-side code running on Vercel.

Install

npx vskill@latest install vercel/vercel-plugin/vercel-functions

SKILL.md

The same SKILL.md was published earlier as vercel/vercel-plugin/vercel-functions.

Vercel Functions

You are an expert in Vercel Functions — the compute layer of the Vercel platform.

Prefer Node.js over the Edge runtime

Strongly prefer Node.js. Don't reach for `runtime = 'edge'` in new code, and recommend migrating off it when you find it in existing code.

This follows Vercel's own documented guidance — "we recommend migrating from edge to Node.js for improved performance and reliability" — and one hard constraint: as of Next.js 16.3, `runtime = 'edge'` is no longer supported. Routes and pages there run on Node.js regardless of what you write, so on 16.3+ this stops being a recommendation and becomes a migration you have to do.

Everywhere else it is a strong default, not a prohibition. Both runtimes run on the same Fluid Compute infrastructure, in the same regions, under the same Active CPU pricing — so in nearly every case Edge gains you nothing while costing you most of the Node.js API surface. If you have a specific, tested reason to stay on Edge, that's a legitimate call; just make it deliberately rather than by habit.

The default to reach for
ts
// app/api/hello/route.ts — no runtime export needed.
export async function GET() {
return Response.json({ message: 'Hello from Node.js on Fluid Compute' })
}

Node.js is the default. Omit export const runtime entirely rather than writing export const runtime = 'nodejs'.

Reasons people reach for Edge — and what to do instead
"I need Edge because…"RealityDo this instead
"…I need to stream / SSE / AI tokens"Streaming is zero-config on Node.js. This is the single most common false belief.Return a ReadableStream from a normal Node.js function
"…I need low latency"Both run on Fluid Compute. Fluid pre-warms instances and caches bytecode; the difference is noise next to your DB/API round tripsStay on Node.js; pin regions near your data
"…auth checks / redirects / A-B tests at the edge"That's Routing Middleware's job, and Routing Middleware supports full Node.js — it is not edge-onlyUse Routing Middleware (routing-middleware skill)
"…it's cheaper"Identical Active CPU pricingStay on Node.js
"…it has faster cold starts"Fluid Compute reuses warm instances across concurrent invocations and bytecode-caches Node 20+ in productionStay on Node.js
"…my function must run globally"Edge's global execution usually hurts — every DB query crosses an oceanSingle region (iad1 default) next to your database
What Edge actually costs you
  • No fs, no native modules, no require() — ESM only, and most npm packages with Node.js dependencies simply will not load
  • No eval / new Function / dynamic WebAssembly.instantiate
  • Code size limit after gzip: 1 MB (Hobby), 2 MB (Pro), 4 MB (Enterprise) — versus 250 MB uncompressed (up to 5 GB) on Node.js
  • Must begin sending a response within 25 seconds (it may then stream for up to 300s). The 300s/800s/1800s duration limits below apply to the Node.js, Bun, and Python runtimes — not to Edge
  • No long-duration or large-function support of any kind
Migrating an existing Edge function

Worth doing when you're already touching the file, and required on Next.js 16.3+. An Edge function that works today isn't an emergency.

  1. Remove export const runtime = 'edge' (or runtime: 'edge' in vercel.json / the config object).
  2. Replace next/server Edge-only imports where applicable; the Web Request/Response handler signature is unchanged, so most route handlers need no other edit.
  3. If you pinned execution with the Edge-only preferredRegion, use regions in vercel.json instead.
  4. Confirm Fluid Compute is on (default since April 23, 2025) and redeploy.

There is no rollback story to plan for: Node.js is a superset of what the function could do on Edge.

Function Types

Node.js (the default)
  • Full Node.js runtime, all npm packages available
  • Default for Next.js route handlers, Server Actions, Server Components, and any file in /api
  • Node.js 26 LTS is GA and the default for new projects for builds and functions (V8 14.6, Temporal API, HTTP/2 by default for built-in fetch; set VERCEL_FETCH_DISABLE_H2=1 to keep HTTP/1.1). Existing projects move to 26 on their next deployment only if engines.node allows it (e.g. >=20). Available versions: 26.x, 24.x, 22.x. Node.js 20 was deprecated on October 1, 2026: new deployments that target nodejs20.x fail (already-deployed functions keep running), so move off it. Prebuilt deploys of Node.js 26 functions need Vercel CLI 65.8.0+
  • Duration: 300s default on every plan; 800s max on Pro/Enterprise; 1800s with the extended-duration beta
Bun

Add "bunVersion": "1.x" to vercel.json to run functions on Bun instead of Node.js. ~28% lower latency for CPU-bound workloads. Supports Next.js, Express, Hono, Nitro, and Bun.serve as an entrypoint. Bun supports both large functions and extended max duration.

Python

Python 3.12 / 3.13 / 3.14 on Fluid Compute. FastAPI, Flask, and Django build into a single function from the resolved entrypoint — key vercel.json config on that entrypoint file (app/main.py, myproject/wsgi.py), not on /api routes. Python gets a 500 MB standard bundle limit (vs. 250 MB) and supports large functions and extended duration.

Rust

Rust functions run on Fluid Compute with HTTP streaming and Active CPU pricing. Official runtime (Beta) built on the vercel_runtime crate. Supports environment variables up to 64 KB.

Container images (Docker)

Any OCI image via Dockerfile.vercel. See Docker and Container Images below.

Edge (legacy — not recommended)

V8 isolates with a subset of Web APIs. Fine to leave in place on existing deployments, but not the runtime to pick for new work. See Prefer Node.js over the Edge runtime.

Choosing a Runtime
NeedRuntimeWhy
Anything not listed belownodejsThe default, and correct nearly always
Full Node.js APIs, npm packagesnodejsFull compatibility
AI streaming, SSE, WebSocketsnodejsZero-config streaming, long durations
Lower latency, CPU-bound worknodejs + Bun~28% latency reduction
Database connections, heavy depsnodejsPin regions next to the database
Data/ML libraries, big model filesnodejs or python + large functionsUp to 5 GB bundles
Systems-level performancerustNative speed on Fluid Compute
Custom system libraries (FFmpeg, Chromium), Go/Ruby/PHP, unsupported frameworkscontainer imageBring your own Dockerfile
Auth, redirects, A/B tests before the cacheRouting MiddlewareRuns on Node.js, framework-agnostic
Hours-to-months of executionVercel WorkflowDurable steps, no duration limit

edge is deliberately absent: there's no row here where it's the better answer for new code.

Fluid Compute

Fluid Compute is the execution model for Vercel Functions — enabled by default for new projects since April 23, 2025, and available for the Node.js, Python, Bun, Rust, and Edge runtimes. Enable it explicitly per-deployment with {"fluid": true} in vercel.json, or project-wide in Settings → Functions.

Long-duration, large-function, and container-image support all depend on it.

Key behaviors:

  • Optimized concurrency: multiple invocations share one instance instead of one microVM per request. Vercel prioritizes idle existing resources before allocating new ones. Available on the Node.js and Python runtimes.
  • Active CPU pricing: you are billed for CPU time your code actually consumes, plus provisioned memory while requests are in flight, plus invocations. Waiting on I/O (AI models, DB queries) does not accrue Active CPU — which is what makes 30-minute functions affordable.
  • Automatic cold start optimization: function pre-warming plus bytecode caching on Node.js 20+. Bytecode caching applies to production only — not dev or preview, so don't benchmark cold starts in a preview deployment.
  • Error isolation: an uncaught exception or unhandled rejection is logged and in-flight requests are allowed to finish; one broken request will not crash its neighbors on the same instance.
  • Cross-AZ and cross-region failover: fails over to another availability zone in-region first, then to the next closest region.
  • Graceful shutdown: SIGTERM before termination (see below).
Instance Sizes (memory / CPU)
TypeMemory / CPUUse
Standard (default)2 GB / 1 vCPUPredictable performance for production workloads
Performance4 GB / 2 vCPULatency-sensitive applications and SSR workloads
  • With Fluid Compute enabled, memory cannot be set in `vercel.json` — setting it there produces a build-time warning. Set it in the dashboard instead: Settings → Functions → Advanced Settings → Function CPU, then redeploy. (The memory key still exists for legacy non-Fluid deployments, which is why you will find older examples using it.)
  • Pro/Enterprise only. Hobby always runs Standard (2 GB / 1 vCPU) and cannot configure it. The Basic instance has been removed.
  • More memory also means more CPU, which can reduce Active CPU billing for CPU-bound work by finishing sooner — but it raises Provisioned Memory cost while requests are in flight.
  • Projects created before 2019-11-08 may still sit on legacy sizes (1024 MB / 0.6 vCPU on Hobby, 3008 MB / 1.67 vCPU on Pro) until you pick a size in the dashboard.
Settings precedence

Function code (export const maxDuration) → vercel.json → dashboard → Fluid defaults. Later entries lose.

Background Processing with waitUntil

waitUntil takes a Promise, not a callback. Passing a function does nothing — a common and silent bug.

ts
import { waitUntil } from '@vercel/functions'
export async function POST(req: Request) {
const data = await req.json()
// Correct: invoke the async work and hand over the promise.
waitUntil(processAnalytics(data))
// For several tasks, combine them:
waitUntil(Promise.all([sendNotification(data), updateCache(data)]))
return Response.json({ received: true })
}
Next.js after (equivalent)
ts
import { after } from 'next/server'
export async function POST(req: Request) {
const data = await req.json()
after(async () => {
await logToAnalytics(data)
})
return Response.json({ ok: true })
}
Graceful shutdown and request cancellation
ts
// Runs on scale-down. 500 ms to clean up (30 s for container images).
process.on('SIGTERM', () => {
// flush buffers, close pools
})

Request cancellation is opt-in, per path. With it enabled, a client disconnect aborts request.signal and terminates the function — anything not wrapped in waitUntil/after is lost, which is exactly why it is not on by default.

json filename="vercel.json"
{
"functions": {
"api/*": { "supportsCancellation": true }
}
}
ts
export async function GET(request: Request) {
// Pass the signal through so upstream work stops too.
const res = await fetch('https://upstream.example.com', { signal: request.signal })
return new Response(res.body, { status: res.status })
}

Duration and Long-Duration Functions

Duration limits

With Fluid Compute (default), per Vercel's limits:

PlanDefaultMaximumExtended maximum
Hobby300s (5 min)300s (5 min)—
Pro300s (5 min)800s1800s (30 min) — Beta
Enterprise300s (5 min)800s1800s (30 min) — Beta

The 800s maximum is generally available on Pro and Enterprise. The 1800s extended maximum is in beta. Exceeding the limit returns 504 FUNCTION_INVOCATION_TIMEOUT.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 25 Nov 2026.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
283
Repository forks
55
7-day trend score
28

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 Mar 2026, 8 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill CERTIFIED badge
[![vskill CERTIFIED](https://verified-skill.com/api/v1/skills/vercel/vercel-plugin/vercel-functions/badge)](https://verified-skill.com/skills/vercel/vercel-plugin/vercel-functions)

Something wrong with this skill or its page? Tell us.