登录 注册
开发者工具AI 模型与开发框架效率与办公工具 ai-gatewaygatewaygenerative-aihacktoberfestlangchainllm
13,365
Stars
1,377
Forks
62
Watchers
344
Open Issues
MIT
许可证
TypeScript
语言
2023-08-23
创建时间
2026-05-25
最近更新

项目能做什么

极速 AI 网关,内置安全防护,通过统一 API 路由至 1600+ LLMs。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
<p align="right">
   <strong>English</strong> | <a href="./.github/README.cn.md">中文</a> | <a href="./.github/README.jp.md">日本語</a>
</p>

> [!IMPORTANT]
> :rocket: Gateway 2.0 (Pre-Release) Portkey's core enterprise gateway is merging into open-source with our 2.0 release. You can try the pre-release branch [here](https://github.com/portkey-ai/gateway/tree/2.0.0).
> Read more about what's next for Portkey in our [**Series A announcement**](https://portkey.wiki/rohit-a).


<div align="center">

🆕 **[Portkey Models](https://github.com/Portkey-AI/models)** - Open-source LLM pricing for 2,300+ models across 40+ providers. [Explore →](https://portkey.ai/models)


# AI Gateway
#### Route to 250+ LLMs with 1 fast & friendly API

<img src="https://cfassets.portkey.ai/sdk.gif" width="550px" alt="Portkey AI Gateway Demo showing LLM routing capabilities" style="margin-left:-35px">

[Docs](https://portkey.wiki/gh-1) | [Enterprise](https://portkey.wiki/gh-2) | [Hosted Gateway](https://portkey.wiki/gh-3) | [Changelog](https://portkey.wiki/gh-4) | [API Reference](https://portkey.wiki/gh-5)


[![License](https://img.shields.io/github/license/Ileriayo/markdown-badges)](./LICENSE)
[![Discord](https://img.shields.io/discord/1143393887742861333)](https://portkey.wiki/gh-6)
[![Twitter](https://img.shields.io/twitter/url/https/twitter/follow/portkeyai?style=social&label=Follow%20%40PortkeyAI)](https://portkey.wiki/gh-7)
[![npm version](https://badge.fury.io/js/%40portkey-ai%2Fgateway.svg)](https://portkey.wiki/gh-8)
[![Better Stack Badge](https://uptime.betterstack.com/status-badges/v1/monitor/q94g.svg)](https://portkey.wiki/gh-9)

<a href="https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/quickcreate?stackName=portkey-gateway&templateURL=https://portkey-gateway-ec2-quicklaunch.s3.us-east-1.amazonaws.com/portkey-gateway-ec2-quicklaunch.template.yaml"><img src="https://img.shields.io/badge/Deploy_to_EC2-232F3E?style=for-the-badge&logo=amazonwebservices&logoColor=white" alt="Deploy to AWS EC2" width="105"/></a> [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Portkey-AI/gateway)
</div>

<br/>

The [**AI Gateway**](https://portkey.wiki/gh-10) is designed for fast, reliable & secure routing to 1600+ language, vision, audio, and image models. It is a lightweight, open-source, and enterprise-ready solution that allows you to integrate with any language model in under 2 minutes.

- [x] **Blazing fast** (<1ms latency) with a tiny footprint (122kb)
- [x] **Battle tested**, with over 10B tokens processed everyday
- [x] **Enterprise-ready** with enhanced security, scale, and custom deployments

<br>

#### What can you do with the AI Gateway?
- Integrate with any LLM in under 2 minutes - [Quickstart](#quickstart-2-mins)
- Prevent downtimes through **[automatic retries](https://portkey.wiki/gh-11)** and **[fallbacks](https://portkey.wiki/gh-12)**
- Scale AI apps with **[load balancing](https://portkey.wiki/gh-13)** and **[c
阅读完整原文

商业机会分析 AI 生成

团队级 MCP (Model Context Protocol) 聚合网关与权限中继平台

产品构想基于 Gateway 对 MCP 的原生支持,封装一套开箱即用的 MCP 代理服务,为团队提供集中式的 MCP 服务管理、API Key 统一托管和细粒度访问控制。
核心功能MCP Server 一键接入与健康检查、团队成员访问权限分发、调用日志与耗时追踪、跨网络隧道内网 MCP 映射。
目标用户在团队内部推广 Cursor/Claude Desktop/AI Agent 协作的研发主管、独立 Agent 开发者。
难度/周期中等 · 3 - 5 周 · 成本:极低(主要是轻量应用服务器与网络带宽成本)
收费模式Freemium 模式,按连接的 MCP Server 数量与席位数阶梯收取月费。
竞争风险Anthropic 或各 IDE 官方可能后续推出内建的企业级 MCP 授权机制,造成竞品挤压(推测)。
依据 已验证事实(仓库主题明确包含 mcp, mcp-gateway, mcp-servers 且该协议正迅速流行)

出海开发者的 AI 成本优化与智能路由微服务 (FinOps Gateway)

产品构想基于该项目构建开箱即用的轻量 SaaS,通过缓存相似提示词、根据响应延迟与成本动态降级模型(如 GPT-4o 降级到 Claude 3.5 Haiku/DeepSeek)实现支出降低。
核心功能语义级响应缓存、多供应商自动故障转移 (Fallback)、实时预算报警与硬切断限制、多模型成本对比面板。
目标用户高频调用 LLM API 但受限于预算的出海初创团队、独立全栈开发者、内容生成类应用运营者。
难度/周期中等 · 2 - 4 周 · 成本:低(轻量 Cloudflare Workers / Node.js 边缘计算节点)
收费模式基础功能免费,高级功能按月度订阅收费(如 $19 - $79/月),或按帮助节省的 API 成本抽佣。
竞争风险各大模型价格持续下调可能降低开发者对专门成本优化工具的敏感度(数据支持的判断)。
依据 已验证事实(项目自带 1600+ 模型路由及快速代理能力,部署特征极轻)

行业合规 AI Guardrails 过滤器与脱敏中间件

产品构想将项目的 50+ Guardrails 机制产品化,包装成金融、法律、医疗等垂直领域的数据预处理/后处理防火墙,解决企业接入公有云大模型的合规隐患。
核心功能敏感个人信息 (PII) 本地正则表达式与小模型脱敏、Prompt 注入与越狱拦截、模型输出幻觉检测、合规审计日志导出。
目标用户受监管行业(金融科技、外包客服系统、SaaS ISV)的技术负责人与安全审计员。
难度/周期较高 · 6 - 8 周 · 成本:中等(需要部署小型轻量本地分类/NER模型进行脱敏验证)
收费模式企业级年度私有化部署授权费、SaaS 模式按处理的数据量/Token 数收费。
竞争风险合规规则的本地化认证门槛高,不同国家/行业标准差异大(尚需验证的假设)。
依据 已验证事实(项目核心卖点包含 50+ AI Guardrails)
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
cheaper-inference/OmniRoute 中文介绍暂未生成
Never stop coding. Free MIT AI gateway: one endpoint, 375 pr
86,240 TypeScript
BerriAI/litellm 中文介绍暂未生成
The fastest, litest AI Gateway. Rust core with Python SDK. C
63,054 Python
QuantumNous/new-api 中文介绍暂未生成
Open-source AI gateway. Self-hosted LLM gateway with OpenAI-
51,703 Go
Kong/kong 中文介绍暂未生成
🦍 The API and AI Gateway
44,377 Lua
langfuse/langfuse 中文介绍暂未生成
🪢 Open source agent evals & observability: Trace, evaluate,
37,265 TypeScript
decolua/9router 中文介绍暂未生成
Unlimited FREE AI coding. Connect Claude Code, Codex, Cursor
32,217 JavaScript
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 2023-08-23,最近推送 2026-05-25,发布过 81 个 Release
社区活跃Star 13,365 / Fork 1,377 / Issue 344(数据支持,可自行核实)
许可证MIT
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/Portkey-AI/gateway.git
cd gateway
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。