Files
opc-backup/figures/03-compute.svg
T
Pine daf3532120 refactor: 工作区多仓库结构定版 + 总设计文档迁根目录
- 总设计文档迁至根目录(云超服一体化架构设计方案.md,figures/ 随迁)
- 设计文档补充 §十二 各代码项目工作原理
- code 六个子项目转独立仓库(组织 Pine),移出根跟踪、保留文件夹
- CLAUDE.md 补充主项目/子项目约束(分别提交、同步全子项目)
2026-08-23 22:47:22 +08:00

81 lines
6.0 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1040 620" width="1040" height="620" font-family="'PingFang SC','Microsoft YaHei','Noto Sans SC',system-ui,sans-serif">
<defs>
<marker id="ah" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M0,0 L10,5 L0,10 z" fill="#7c3aed"/>
</marker>
<marker id="ah-blue" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M0,0 L10,5 L0,10 z" fill="#2563eb"/>
</marker>
<marker id="ah-gray" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M0,0 L10,5 L0,10 z" fill="#94a3b8"/>
</marker>
<filter id="shadow" x="-8%" y="-8%" width="120%" height="130%">
<feDropShadow dx="0" dy="2" stdDeviation="3" flood-color="#0f172a" flood-opacity="0.10"/>
</filter>
</defs>
<rect x="0" y="0" width="1040" height="620" fill="#fbfcfe"/>
<text x="520" y="38" text-anchor="middle" font-size="22" font-weight="700" fill="#0f172a">算力额度管控(服务端统一增减)</text>
<text x="520" y="62" text-anchor="middle" font-size="13" fill="#64748b">用户端只读 · 运营端增减 · 无用户充值入口(预留)</text>
<!-- Row1 -->
<g filter="url(#shadow)">
<rect x="60" y="90" width="280" height="90" rx="12" fill="#ffffff" stroke="#d97706" stroke-width="2"/>
<text x="82" y="118" font-size="15" font-weight="700" fill="#b45309">运营端(operator</text>
<text x="82" y="142" font-size="11.5" fill="#334155">额度增减单 / 冻结 / 发放</text>
<text x="82" y="162" font-size="11" fill="#64748b">公益额度 · 套餐发放 · 违规扣减</text>
</g>
<g filter="url(#shadow)">
<rect x="400" y="90" width="260" height="90" rx="12" fill="#eff6ff" stroke="#2563eb" stroke-width="2"/>
<text x="422" y="118" font-size="15" font-weight="700" fill="#1d4ed8">后端 · 算力服务</text>
<text x="422" y="142" font-size="11.5" fill="#334155">/admin/compute/orders</text>
<text x="422" y="162" font-size="11" fill="#64748b">compute 模块 → 封装 new-api 引擎</text>
</g>
<g filter="url(#shadow)">
<rect x="720" y="90" width="260" height="90" rx="12" fill="#f5f3ff" stroke="#7c3aed" stroke-width="2"/>
<text x="742" y="118" font-size="15" font-weight="700" fill="#6d28d9">算力引擎 new-api(仅服务)</text>
<text x="742" y="142" font-size="11.5" fill="#334155">relay /v1 · 额度/令牌/流水</text>
<text x="742" y="162" font-size="11" fill="#64748b">管理·页面全部自研,不用其 UI</text>
</g>
<!-- Row2 -->
<g filter="url(#shadow)">
<rect x="60" y="260" width="280" height="110" rx="12" fill="#ffffff" stroke="#16a34a" stroke-width="2"/>
<text x="82" y="288" font-size="15" font-weight="700" fill="#15803d">用户端(OPC 用户)</text>
<text x="82" y="312" font-size="11.5" fill="#334155">我的额度 / 消耗明细 / 流水</text>
<text x="82" y="332" font-size="11" fill="#64748b">GET /opc/compute(只读)</text>
<text x="82" y="352" font-size="10.5" fill="#94a3b8">无充值按钮 · 不足时联系运营</text>
</g>
<g filter="url(#shadow)">
<rect x="400" y="260" width="580" height="110" rx="12" fill="#ffffff" stroke="#0d9488" stroke-width="2"/>
<text x="422" y="288" font-size="15" font-weight="700" fill="#0f766e">Agent 运行时(PineAgents 桌面端)</text>
<text x="422" y="312" font-size="11.5" fill="#334155">PROVIDER_PINEAGENTS → 算力引擎 /v1</text>
<text x="422" y="332" font-size="11" fill="#64748b">登录 / 换身份时由后端算力服务下发该用户 PAT</text>
<text x="422" y="352" font-size="11" fill="#64748b">每次模型调用实时计量,计入该用户额度</text>
</g>
<!-- 箭头 -->
<line x1="340" y1="135" x2="400" y2="135" stroke="#d97706" stroke-width="2" marker-end="url(#ah)"/>
<text x="370" y="125" text-anchor="middle" font-size="10.5" fill="#b45309" font-weight="600" paint-order="stroke" stroke="#fff" stroke-width="3">增减单</text>
<line x1="660" y1="120" x2="720" y2="120" stroke="#7c3aed" stroke-width="2" marker-end="url(#ah)"/>
<text x="690" y="110" text-anchor="middle" font-size="10.5" fill="#6d28d9" font-weight="600" paint-order="stroke" stroke="#fff" stroke-width="3">额度增减</text>
<line x1="720" y1="160" x2="660" y2="160" stroke="#7c3aed" stroke-width="2" stroke-dasharray="5,4" marker-end="url(#ah)"/>
<text x="690" y="175" text-anchor="middle" font-size="10.5" fill="#6d28d9" font-weight="600" paint-order="stroke" stroke="#fff" stroke-width="3">流水/日志</text>
<path d="M 470 180 L 470 225 L 300 225 L 300 260" fill="none" stroke="#2563eb" stroke-width="2" marker-end="url(#ah-blue)"/>
<text x="478" y="212" font-size="10.5" fill="#1d4ed8" font-weight="600" paint-order="stroke" stroke="#fff" stroke-width="3">GET /opc/compute(只读)</text>
<line x1="800" y1="260" x2="800" y2="180" stroke="#0d9488" stroke-width="2" marker-end="url(#ah)"/>
<text x="810" y="225" font-size="10.5" fill="#0f766e" font-weight="600" paint-order="stroke" stroke="#fff" stroke-width="3">模型调用 /v1</text>
<line x1="750" y1="180" x2="750" y2="260" stroke="#0d9488" stroke-width="2" stroke-dasharray="5,4" marker-end="url(#ah)"/>
<text x="758" y="220" font-size="10.5" fill="#0f766e" font-weight="600" paint-order="stroke" stroke="#fff" stroke-width="3">用量记录</text>
<!-- 预留充值说明 -->
<rect x="60" y="440" width="920" height="60" rx="10" fill="#fefce8" stroke="#eab308" stroke-width="1.5" stroke-dasharray="6,4"/>
<text x="82" y="468" font-size="12.5" font-weight="700" fill="#a16207">充值:架构预留,当前不启用</text>
<text x="82" y="488" font-size="11.5" fill="#854d0e">new-api 用户自助充值(POST /api/user/topup + 支付 webhook)能力已具备;待支付渠道 / 合规确认后开启。当前流程一律由服务端统一增减额度(运营端增减单 → compute_orders 流水 → 通知用户)。</text>
</svg>