Translation(model translation, not the source's own text)
文章标题:AI Gateway 现已支持 Private Inference
正文: Private Inference 可将你自己的模型端点接入 AI Gateway。
此前,运行微调模型、自托管模型或预发布模型的企业需要为这些模型单独管理密钥、客户端代码和日志。现在,这些模型可以与目录模型使用相同的身份验证、SDK 和 API,以及可观测性,因此团队使用的每个模型都能在一个地方统一管理。




使用 Private Inference 可以:
- 在私有模型和目录模型之间切换:通过 Chat Completions、Responses 或 Messages 调用私有模型。AI Gateway 会将每个请求转换为你的端点格式,因此切换时只需更改模型 ID。
- 将模型限定在你的团队范围内:只有你的 Vercel 团队可以查看或调用私有模型,并且它们不会列在公开目录中。凭据以加密方式存储,你可以按提供商启用 Zero Data Retention。
- 连接编码代理:在 Claude Code、Codex、Cursor 以及其他连接到 AI Gateway 的编码代理中使用私有模型。
- 统一监控流量:在日志、trace drains 和自定义报告中,将私有模型请求与目录流量一并查看。可观测性图表按私有模型细分请求数、token 数和首 token 时间。
- 配置回退:如果你的私有端点发生故障,可以选择回退到某个目录模型。
要开始使用,请打开 Private Inference 页面,将你的端点添加为私有提供商。输入其 base URL,选择其 API 格式,并添加其凭据。然后添加它提供的模型。




你也可以使用 Vercel CLI(版本 65.16.0 或更高)注册提供商和模型:
# Connect your endpoint as a private providervercel ai-gateway private-inference providers create acme-vllm \ --base-url https://vllm.example.com/v1
# Expose the endpoint's model as private/support-fine-tunevercel ai-gateway private-inference models create support-fine-tune \ --provider acme-vllm \ --api-model acme/support-llama-ft
使用模型的 private/<slug> ID 调用它:
import { streamText } from 'ai';
const result = streamText({ model: 'private/support-fine-tune', prompt: 'Draft a reply to a customer who was charged twice.', providerOptions: { gateway: { // Optional fallback to a catalog model models: ['anthropic/claude-sonnet-5.5'], }, },});
for await (const text of result.textStream) { process.stdout.write(text);}
对私有模型的请求会与对目录模型的请求一同显示在 AI Gateway 日志中。




请阅读 Private Inference 文档,了解支持的模型类型、要求和计费详情。