PromptCache 组件架构

OpenAI 兼容语义缓存网关:单进程,嵌入式存储

PromptCache 组件架构 OpenAI 兼容语义缓存网关:单进程,嵌入式存储 PromptCache 单进程 应用 · OpenAI SDK / base_url 指过来 · Architecture component 应用 OpenAI SDK / base_url 指过来 Gin 入口 · /v1/chat/completions · PromptCache 单进程 · 中间件链 Gin 入口 /v1/chat/completions 中间件链 SemanticEngine · 双阈值判定 + 转发 · PromptCache 单进程 SemanticEngine 双阈值判定 + 转发 LLM 提供商 · OpenAI / Mistral / Claude · Architecture component LLM 提供商 OpenAI / Mistral / Claude 响应缓存 · TTL + 容量淘汰 · PromptCache 单进程 响应缓存 TTL + 容量淘汰 向量索引 · 内存余弦 top-1 · PromptCache 单进程 向量索引 内存余弦 top-1 BadgerDB · 响应 / prompt: / emb: · PromptCache 单进程 BadgerDB 响应 / prompt: / emb: 管理面 · Bearer:阈值 / 预热 / 清空 · PromptCache 单进程 管理面 Bearer:阈值 / 预热 / 清空 OpenAI 兼容请求 查相似 / 转发 embedding · 仲裁 · 生成 top-1 检索 命中读 · 回写 JSON + TTL 启动重建索引 预热 / 清空 Legend 进程内组件 嵌入式存储 上游提供商 鉴权管理面 调用方