git404hub

what is gateway fr?

portkey-ai/gateway — explained in plain English

Analysis updated 2026-06-24

11,710TypeScriptAudience · developerComplexity · 3/5Setup · easy

tl;dr

An open source AI gateway that routes requests to 250+ models from a single interface, adding automatic retries, fallbacks, load balancing, and content guardrails with under one millisecond of overhead.

vibe map

mindmap
  root((gateway))
    What it does
      AI request routing
      Single interface
      Sub-ms overhead
    Reliability
      Auto retry
      Provider fallback
      Load balancing
    Safety
      Content guardrails
      Response filtering
    Deployment
      Local Node.js
      Docker
      Cloudflare Workers
      AWS GCP Azure

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Route your app's AI requests through one endpoint to switch between OpenAI, Anthropic, and Google without changing your code.

VIBE 2

Configure automatic fallback to a backup model if your primary AI provider goes down.

VIBE 3

Add guardrails that block unwanted content in AI responses before they reach your users.

VIBE 4

Deploy the gateway on Cloudflare Workers or AWS for low-latency AI routing in production.

what's the stack?

TypeScriptNode.jsDockerCloudflare Workers

how it stacks up fr

portkey-ai/gatewaymarp-team/marpquipnetwork/ethereum-sdk
Stars11,71011,71111,694
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasyeasyhard
Complexity3/52/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 5min

in plain english

Portkey AI Gateway is an open source router that sits between your application and AI model providers. Instead of writing separate code to talk to OpenAI, Anthropic, Google, or any other AI service, your application talks to the gateway using a single consistent interface, and the gateway handles the conversation with whichever provider you choose. The gateway supports over 250 AI models from dozens of providers, and connecting to a new one is a matter of changing a few configuration values rather than rewriting integration code. The library claims a latency overhead of under one millisecond, which makes it practical to run in production without noticeably slowing down responses. Beyond routing, the gateway adds reliability and safety features. You can configure it to retry failed requests automatically, fall back to a different model if the primary one is unavailable, and spread load across multiple providers or model instances. Guardrails let you define rules about what the AI is allowed to return, for example blocking responses that contain certain words or topics, and rejecting them before they reach your users. Running the gateway locally takes a single command using Node.js. A built-in console at localhost shows a log of all requests passing through. The gateway can also be deployed on Docker, Cloudflare Workers, or cloud infrastructure on AWS, Azure, and GCP. Enterprise deployments with private hosting and additional access controls are available through Portkey's commercial offering. The project works with popular AI development libraries including Langchain, LlamaIndex, and CrewAI, and is compatible with the standard OpenAI client format so teams already using that interface can switch over without changing their existing code structure.

prompts (copy fr)

prompt 1
I use OpenAI in my app. Show me how to swap to the Portkey AI Gateway so I can switch between providers without changing my existing code.
prompt 2
How do I configure Portkey Gateway to automatically retry failed AI requests and fall back to Anthropic if OpenAI is unavailable?
prompt 3
I want to block certain words from AI responses before they reach users. How do I set up guardrails in Portkey Gateway?
prompt 4
How do I deploy Portkey AI Gateway on Cloudflare Workers and point my existing OpenAI client at it?
prompt 5
Show me how to set up load balancing across multiple AI providers in a Portkey Gateway config file.

Frequently asked questions

what is gateway fr?

An open source AI gateway that routes requests to 250+ models from a single interface, adding automatic retries, fallbacks, load balancing, and content guardrails with under one millisecond of overhead.

What language is gateway written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, Docker.

How hard is gateway to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is gateway for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.