<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Gbrain - Tag - 傲来说的博客</title><link>https://aolaishuo.cc/tags/gbrain/</link><description>Gbrain - Tag - 傲来说的博客</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><lastBuildDate>Mon, 18 May 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://aolaishuo.cc/tags/gbrain/" rel="self" type="application/rss+xml"/><item><title>gbrain 本地化迁移及系统资源估算报告</title><link>https://aolaishuo.cc/posts/2026-05-18-gbrain-%E8%B5%84%E6%BA%90%E4%BC%B0%E7%AE%97%E6%8A%A5%E5%91%8A/</link><pubDate>Mon, 18 May 2026 00:00:00 +0800</pubDate><author>傲来说</author><guid>https://aolaishuo.cc/posts/2026-05-18-gbrain-%E8%B5%84%E6%BA%90%E4%BC%B0%E7%AE%97%E6%8A%A5%E5%91%8A/</guid><description><![CDATA[<h1 id="gbrain-本地化迁移及系统资源估算报告">gbrain 本地化迁移及系统资源估算报告</h1>
<blockquote>
<p>基于迁移至 DeepSeek V4 + 智谱 GLM 后的配置，估算日期：2026-05-18</p></blockquote>
<hr>
<h2 id="一本地运行pglite-模式个人使用">一、本地运行（PGLite 模式，个人使用）</h2>
<table>
  <thead>
      <tr>
          <th>资源</th>
          <th>最低配置</th>
          <th>推荐配置</th>
          <th>说明</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>内存</strong></td>
          <td>2 GB</td>
          <td>4 GB</td>
          <td>PGLite WASM 冷启动约 300-500 MB；autopilot worker watchdog 阈值 2048 MB</td>
      </tr>
      <tr>
          <td><strong>CPU</strong></td>
          <td>1 核</td>
          <td>2 核</td>
          <td>本地几乎无 CPU 密集操作（embedding/chat 都是 API 调用）</td>
      </tr>
      <tr>
          <td><strong>磁盘</strong></td>
          <td>500 MB</td>
          <td>2 GB</td>
          <td>PGLite 数据库随页面增长，1 万页约 200-500 MB</td>
      </tr>
      <tr>
          <td><strong>网络</strong></td>
          <td>稳定出站</td>
          <td>稳定出站</td>
          <td>所有 AI 调用走外部 API</td>
      </tr>
  </tbody>
</table>
<hr>
<h2 id="二关键资源消耗点">二、关键资源消耗点</h2>
<h3 id="内存--最大消费者是-pglite-wasm">内存 — 最大消费者是 PGLite WASM</h3>
<ul>
<li>单个 PGLite 实例：~300-500 MB</li>
<li>测试中多个并发实例（开发场景）：可达 24 GB（这是测试特有的，生产不会出现）</li>
<li>autopilot supervisor 进程：~100 MB</li>
<li><code>gbrain serve --http</code>（HTTP MCP 服务器）：~200-400 MB</li>
</ul>
<h3 id="cpu--几乎没有本地-cpu-消耗">CPU — 几乎没有本地 CPU 消耗</h3>
<ul>
<li>chunking（分块）：轻量文本处理，毫秒级</li>
<li>HNSW 向量搜索：PGLite 内 pgvector 执行，小规模脑（&lt;1万页）&lt; 100ms</li>
<li>大规模脑（&gt;10万页）向量搜索：可能需要 500ms-2s</li>
</ul>
<h3 id="磁盘-io--写入模式">磁盘 I/O — 写入模式</h3>
<ul>
<li>sync：按文件数线性增长，每 100 文件一批</li>
<li>embed：每批 100 条（<code>BATCH_SIZE = 100</code>），API 调用后写入向量</li>
</ul>
<h3 id="网络带宽--取决于使用频率">网络带宽 — 取决于使用频率</h3>
<table>
  <thead>
      <tr>
          <th>操作</th>
          <th>每次 API 调用</th>
          <th>典型频率</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Embedding（智谱 embedding-3）</td>
          <td>~8K tokens/批，$0.55/1M tokens</td>
          <td>sync 后批量</td>
      </tr>
      <tr>
          <td>Chat（DeepSeek v4-flash）</td>
          <td>上下文最大 1M tokens，$0.10 输入 / $0.40 输出</td>
          <td>每次 query/dream</td>
      </tr>
      <tr>
          <td>Expansion（DeepSeek v4-flash）</td>
          <td>~500 tokens/query</td>
          <td>搜索时可选</td>
      </tr>
  </tbody>
</table>
<hr>
<h2 id="三api-成本估算月度个人使用">三、API 成本估算（月度，个人使用）</h2>
<p>假设 1000 页的脑，日均 50 次 query，30 天：</p>]]></description></item></channel></rss>