01
公网客户端
使用自己的 API key 请求 OpenAI-compatible 或 Anthropic-compatible 接口,例如:
/v1/chat/completions /v1/messages
本文说明公网请求如何经过 Caddy、Identity Gateway、NewAPI41、session-router、Bifrost、NewAPI02、Guard / CLIProxy,最终到达供应商,以及异常时如何回退到 bf-pool。
站点由 Caddy 原生 file_server 托管,不新增 Node / Python 常驻进程。
完整链路应包含 NewAPI02 后面的实际上游,而不是停在 NewAPI02。
公网客户端 -> Caddy -> Identity Gateway -> NewAPI41 鉴权/配额/模型映射 -> session-router(HMAC 校验、bucket 选择) -> Bifrost v1.5.16 -> cache-01 ... cache-10 provider/key -> NewAPI02 对应 cache group/channel -> Guard / CLIProxy -> 供应商或模型上游 -> 原路返回
bf-pool 是异常时的回退路径。10 个 bucket 是 Bifrost 内部的 10 个隔离 provider,不是 10 个 Bifrost 容器。NewAPI41 仍负责用户鉴权、配额和模型映射。
使用自己的 API key 请求 OpenAI-compatible 或 Anthropic-compatible 接口,例如:
/v1/chat/completions /v1/messages
负责公网入口:
负责把用户 API key 转换成可信身份:
account_id 和 conversation_id它不负责额度、权限或模型访问控制。
用户策略控制层:
例如用户请求 mimo-v2.6-flash,NewAPI41 可能映射为内部的 newapi02/mimo-v2.6-flash。
会话亲和路由层:
cache-01 到 cache-10 中选择 bucketcache-07/mimo-v2.6-flash如果身份无效、Redis 不可用或路由器关闭,则回退到 bf-pool。
provider / key 适配层:
cache-07/... 识别 bucket当前是一个 Bifrost 进程,内部配置了 10 个隔离 provider,不是 10 个 Bifrost 容器。
上游渠道控制层:
实际的上游执行层:
最终执行模型推理并返回结果。当前可以验证请求成功和路由稳定,但因为供应商没有提供可靠的 cache token 指标,暂时不能证明缓存节省比例。
公网客户端 → Caddy → Identity Gateway → NewAPI41 → session-router → Bifrost → cache bucket → NewAPI02 → Guard / CLIProxy → 供应商
响应按相反方向返回:
供应商 → CLIProxy / Guard → NewAPI02 → Bifrost → session-router → NewAPI41 → Identity Gateway → Caddy → 用户
bf-pool 不参与正常 bucket 分流,但始终保留:
Caddy 公网入口 Identity Gateway 可信身份 NewAPI41 用户权限与配额 session-router 会话亲和 Bifrost provider/key 适配 NewAPI02 渠道控制 Guard/CLIProxy 实际代理与故障保护 供应商 最终模型执行 bf-pool 紧急回滚
bf-pool。https://doc.apimimo.zaiyunding.com,Caddy file_server 直出 /var/www/apimimo-docs。