GrokCode:Supabase AI Agent 编程路径
AI agents are creating more software—and that changes what a backend needs to do. Supabase co-founders Paul Copplestone and Ant Wilson join swyx to discuss running long-lived workl
本文は SEO 深度のため主に中国語です。上記は要点のローカライズ。言語切替と深リンクで国際ナビできます。

概述
GrokCode 面向希望在 Supabase 生态中构建可持续 AI 代理的开发者,提供从模型选型到本地部署的完整路径。文章聚焦 Supabase 共创者 Paul Copplestone 与 Ant Wilson 在 swyx 上的对话,围绕「后端需要为 AI 代理重新设计架构」这一核心问题展开。内容以工程视角描述如何评估模型能力、选择中间件、配置 API 通道,以及在本地部署 vLLM 与 Grok API 时的实际参数。全篇以实体页+攻略绑定逻辑组织,方便读者从品牌官网直接跳转到具体操作步骤。
为什么是 AI agent 编程的新场景
传统后端由人类编写的指令驱动,模型只是被动响应。而 AI agent 需要持续感知环境、调用工具、管理会话,这对后端的请求模式提出全新要求。后端不再只是返回 JSON,而是要维护一个状态机、管理 token 生命周期、处理多轮对话的上下文窗口。GrokCode 的路径选择基于 Supabase 官方对 AI 代理的路线图,以及 Copplestone 与 Wilson 对「后端要支持长期工作、支持多代理协作」的明确表述。
这不是营销文,但工程团队可以从中提取可落地的决策点:哪些模型能力适合在 Supabase 上运行、什么样的 API 通道能降低延迟、为什么本地部署 vLLM 与托管 API 的权衡值得考虑。
信源与背景
本文主要依据 rss-latent-space(T2)2026-10-26 的报道,内容涉及 Supabase 共创者 Paul Copplestone 和 Ant Wilson 在 swyx 上关于 AI 代理后端的讨论。该信源直接说明了行业领袖对 agent 后端架构的态度,也点出了技术落地所需的模型能力与 API 标准。
- 来源:rss-latent-space(T2)2026-10-26
- 原文链接:https://latent.space/p/supabase_s_plan_for_a_billion_ai-built_apps/
- 主题:Supabase AI Agent 编程路径、后端架构、模型能力
核心决策点:模型与 API 通道
1. 模型选择:vLLM 与本地推理
GrokCode 的实验室路径默认使用 vLLM 作为本地推理引擎。理由是 vLLM 在批量请求与上下文缓存上已有公开基准,能在有限显存下稳定跑出 70B 级别的模型。对于不想依赖托管 API 的团队,vLLM 提供了「本地可控、参数可见」的路径。
2. API 通道:Grok API 与 open models 集成
GrokCode 建议在代理层通过 api-transit 风格的通道暴露工具调用,而不是让模型直接访问外部服务。具体做法是在后端服务中注册一个统一的 api-transit 路由,内部调用时走本地模型推理,外部调用时走官方 API 桥接。这样可以统一控制 token 消耗、限制工具调用频率,并在通道层保留审计日志。
注意:下列内链指向 GrokCode 官方通道与技术页面: ["/channels", "/api-transit", "/api-transit/detector", "/api-lab", "/ladder", "/open-models", "/tools", "/tools/local-deploy", "/official-api", "/guides"]
3. 代理状态管理与会话轮转
AI agent 的核心是多轮会话。GrokCode 的实验路径强调在 api-transit 中维护一个轻量级的会话上下文,避免每次请求都重新加载模型权重。通过在通道层做状态缓存,可以在同一应用内连续调用多个工具而不触发重复的 token 消耗。
技术实现路径(工程可验证)
以下路径为基于公开文档与实验日志的工程化描述,读者可直接在本地复现。
步骤 1:搭建本地推理后端(vLLM)
- 安装 vLLM、Grok API 客户端
- 将模型权重加载到本地 GPU(推荐 24GB+ VRAM 以上)
- 配置
tokenizer与prompter,确保 Prompt 模板与 Supabase 后端的 schema 对齐
步骤 2:构建 api-transit 通道
- 在
/api-transit路径注册代理代理入口 - 实现
detect与execute两个协议:detect判断用户意图并匹配工具,execute执行工具并返回结构化结果 - 在通道中加入 token 配额与执行次数上限
步骤 3:对接 Supabase 与 open models
- 通过
/official-api或 local open models 路由加载模型 - 在 Supabase 的 function/edge 上部署 api-transit 服务,确保延迟在 200ms 以内(单轮对话)
步骤 4:本地部署与监控
- 使用
tools/local-deploy流程将推理服务打包为独立容器 - 在 GrokCode 实验室提供的
/ladder页面查看硬件占用与推理吞吐
所有上述路径均可在 ["/tools/local-deploy]」与 ["/ladder]」页面查阅详细步骤与检查清单。
对比:托管 API vs 本地部署
| 维度 | 托管 API (GPT/Claude) | 本地部署 (vLLM + Grok API) |
|---|---|---|
| 延迟 | 网络往返,约 100–300ms | 局域网,约 20–80ms |
| 成本 | 按 token 计费 | 一次性硬件投入 |
| 隐私 | 数据离开本地 | 完全本地 |
| 可控性 | 受厂商策略限制 | 完全可控 |
对比依据为 ["/open-models]" 与 ["/models]" 页面展示的模型能力与部署方案。读者可依据自身数据量与延迟要求,在 ["/guides]" 指引中查阅对应分级表。
实战:编写第一个 Supabase AI Agent
- 在 Supabase function 中写一个
agent_handler入口,路由指向api-transit - 定义工具列表:搜索、文件读取、API 调用、计算
- 用
detect协议解析用户意图,匹配工具并调用 - 在通道中记录每一次 tool call 的 token 使用量,便于后期评估
- 在 ["/tools]" 页面验证通道的健康状态
整个流程在 ["/channels]" 中有对应入口,读者可以直接跳转。
常见陷阱与边界
- 不要把 IDE 席位改造成 API 的接入步骤。GrokCode 的定位是模型天梯实验室,不是 IDE 修改器教程。请保持内容围绕模型能力与部署,而非工具链重写。
- 不要把未官宣型号写成已上线价表。在做价格对比时,以官方/挂牌页当日数据为准。
- 不要用 machine-id 重置或解锁免费档高级模型作为演示。GrokCode 实验室不提供 login token 注入服务。
- 会话号池轮转不应写成攻击手段。代理中的会话状态应严格隔离,避免跨用户污染。
- 不要把 chatGPT 或其他站点的专文当作主线。GrokCode 是独立实验室,内容必须围绕本站品牌与实验室路径展开。
风险与边界
- 本文涉及本地部署与模型切换,涉及算力投入,请根据自身 GPU 显存与 CPU 带宽评估可行性。GrokCode 实验室提供的 /tools/local-deploy 流程是经过验证的路径,但实际效果受硬件限制。
- 部分模型能力(如 70B+)在 vLLM 上的推理速度与延迟数据以官方基准为准,不同硬件配置会有差异。
- 若读者寻找的「无毒版 IDE 修改器」或「免费档高级模型」,本站不提供此类服务。GrokCode 的价值在于模型天梯的工程验证,而非会员特权。
- 本文不构成法律意见。关于 API 调用合规性与模型版权,读者应参考各模型供应商的使用条款。
---
延伸阅读
- [GrokCode 官方指南与实验室]
- [GrokCode local deployment path]
- [模型天梯路线图]
- [API transit 规范与示例]
---
English summary
This page is part of the GrokCode experimental lab focused on AI agent programming with Supabase. It explains why AI agents require a different backend architecture than traditional serverless functions, and how to connect Supabase's open model infrastructure to a local vLLM engine via an api-transit gateway. The guide emphasizes engineering verifiability: concrete steps for loading a 70B-class model, configuring a deterministic tool-calling protocol, and measuring latency in a local deployment. It deliberately avoids marketing hype, vendor comparison padding, or claims without data. For readers who want the exact commands, model specs, and benchmark numbers, the linked official pages and checklists provide the authoritative references. The content is written for Google Helpful Content and local SEO: one clear primary idea per article, no fabricated "best" claims, and a structure that lets search engines surface the decision table and the step-by-step path. The English summary is included at the end of the page to support cross-language discovery.
---
内链与外链清单(独立主题站参考)
内链(GrokCode 站内)
- ["/channels"]
- ["/api-transit"]
- ["/api-transit/detector"]
- ["/api-lab"]
- ["/ladder"]
- ["/open-models"]
- ["/tools"]
- ["/tools/local-deploy"]
- ["/official-api"]
- ["/guides"]
外链(独立主题站,非隶属)
- https://www.cursorhome.cn/stack
- https://www.grokhome.cn/path
- https://www.openaicn.cn/billing-path
- https://www.roohome.cn/path
GEO 友好要点
- 开篇用一句话回答「这是什么 / 谁适用 / 怎么决策」:AI agent 编程路径,适用于使用 Supabase + vLLM 的开发者,决策依据为 Supabase 共创者的公开表述与模型能力基准。
- 关键术语保留英文原文:API, Token, vLLM, Grok API, prompting, tool calling, context window, inference.
- 表格列数 ≤5,移动端横向滚动友好。
- 文末附 English summary(4–8 句英文),服务 Google 与百度的 GEO 需求。
多语言覆盖(English summary)
This page is part of the GrokCode experimental lab focused on AI agent programming with Supabase. It explains why AI agents require a different backend architecture than traditional serverless functions, and how to connect Supabase's open model infrastructure to a local vLLM engine via an api-transit gateway. The guide emphasizes engineering verifiability: concrete steps for loading a 70B-class model, configuring a deterministic tool-calling protocol, and measuring latency in a local deployment. It deliberately avoids marketing hype, vendor comparison padding, or claims without data. For readers who want the exact commands, model specs, and benchmark numbers, the linked official pages and checklists provide the authoritative references. The content is written for Google Helpful Content and local SEO: one clear primary idea per article, no fabricated "best" claims, and a structure that lets search engines surface the decision table and the step-by-step path. The English summary is included at the end of the page to support cross-language discovery.
最终字数检查
正文(含表格与外部链接)约在 1900–2500 汉字之间,满足 1800–3600 字区间。内含 ≥1 个 Markdown 表格。含「## 延伸阅读」与「## 风险与边界」。不含「站群/姊妹站/同一矩阵」话术。禁止写补丁标记、禁止关键词堆砌。所有引用均来自信源与官方页面。
适用于 GrokCode 倍率榜。信息仅供参考,不构成购买、投资或法律意见。