The Alternatives Issue For tool owners Sign in

Edge function

An edge function is a small serverless function that runs at the network edge — geographically close to the user — typically on Cloudflare Workers, Deno Deploy, Vercel Edge, or AWS Lambda@Edge.

In more detail

What it means

Edge functions run closer to users than traditional serverless functions, cutting latency by 50-150ms for global apps. They commonly handle authentication, AB testing, geolocation, rewrites, and lightweight LLM gateways. Limits: short execution time (often 30s max), limited memory, restricted Node.js compatibility (V8 isolates instead of Node), no direct file system. For AI apps in 2026 edge functions are commonly used for LLM gateway logic — auth, routing, rate limiting — while the actual LLM inference runs in a region closer to the model provider.

Part 1 of 2

When to use it, and when not

Use it for

  • Auth, AB testing, geolocation logic.
  • LLM gateway and routing.
  • Lightweight personalisation.

Part 2 of 2

Common mistakes

  • Trying to run heavy compute at the edge — short runtimes hurt.
  • Forgetting cold-start in long-running edge regions.

FAQ

Questions readers ask.

What is edge function?

An edge function is a small serverless function that runs at the network edge — geographically close to the user — typically on Cloudflare Workers, Deno Deploy, Vercel Edge, or AWS Lambda@Edge.

When should you use edge function?

Auth, AB testing, geolocation logic. LLM gateway and routing. Lightweight personalisation.

What are the common mistakes with edge function?

Trying to run heavy compute at the edge — short runtimes hurt. Forgetting cold-start in long-running edge regions.

Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/edge-function.md. Found a mistake? Tell us.