<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Moonbridge on OHTLY Blog</title>
    <link>https://blog.ohtly.com/tags/moonbridge/</link>
    <description>Recent content in Moonbridge on OHTLY Blog</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Thu, 09 Jul 2026 15:51:22 +0800</lastBuildDate>
    <atom:link href="https://blog.ohtly.com/tags/moonbridge/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>四种 PageIndex 检索方案的 Token 消耗对比</title>
      <link>https://blog.ohtly.com/posts/2026-07-09-pageindex-token-comparison/</link>
      <pubDate>Thu, 09 Jul 2026 15:21:34 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-07-09-pageindex-token-comparison/</guid>
      <description>&lt;h2 id=&#34;背景&#34;&gt;&#xA;  背景&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e8%83%8c%e6%99%af&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;PageIndex 是一个无向量（vectorless）、基于推理（reasoning-based）的 RAG 框架。核心思路是将文档解析为树状索引，让 LLM 通过推理来导航定位内容，而不是靠向量相似度搜索。&lt;/p&gt;&#xA;&lt;p&gt;这次实验的数据源是一本人教版《物理必修第二册》扫描版 PDF。因为纯扫描件没有文字层，先用 MinerU（vlm-engine）OCR 提取了结构化文本，再插入 &lt;code&gt;&amp;lt;!-- page N --&amp;gt;&lt;/code&gt; 标记以使页码可追溯。最后用 PageIndex 对这份带页码的 markdown 建立树索引。&lt;/p&gt;&#xA;&lt;p&gt;基于同一份数据，实现了四种检索方案，对比它们的实现差异和 Token 消耗。&lt;/p&gt;&#xA;&lt;h2 id=&#34;四种方案的设计差异&#34;&gt;&#xA;  四种方案的设计差异&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e5%9b%9b%e7%a7%8d%e6%96%b9%e6%a1%88%e7%9a%84%e8%ae%be%e8%ae%a1%e5%b7%ae%e5%bc%82&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;方案-a简单查询&#34;&gt;&#xA;  方案 A：简单查询&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%96%b9%e6%a1%88-a%e7%ae%80%e5%8d%95%e6%9f%a5%e8%af%a2&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;两步走，两次独立 LLM 调用：&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LLM #1 看树结构 → 返回行号范围&#xA;LLM #2 取内容 → 回答&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;没有验证步骤，LLM 一次定生死。&lt;/p&gt;&#xA;&lt;h3 id=&#34;方案-b手写-agent-循环&#34;&gt;&#xA;  方案 B：手写 Agent 循环&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%96%b9%e6%a1%88-b%e6%89%8b%e5%86%99-agent-%e5%be%aa%e7%8e%af&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;三步走，三次独立 LLM 调用：&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LLM #1 identify_ranges → 返回候选行号列表&#xA;LLM #2 evaluate → 判断内容是否包含答案&#xA;LLM #3 final_answer → 基于内容给出最终回答&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;写了 for 循环遍历候选清单，显式 evaluate 确认命中后才回答。&lt;/p&gt;</description>
    </item>
    <item>
      <title>DeepSeek V4 DSML 标记导致 Codex 任务中止</title>
      <link>https://blog.ohtly.com/posts/2026-06-26-deepseek-v4-dsml-codex-abort/</link>
      <pubDate>Fri, 26 Jun 2026 11:24:38 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-06-26-deepseek-v4-dsml-codex-abort/</guid>
      <description>&lt;h2 id=&#34;问题现象&#34;&gt;&#xA;  问题现象&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e9%97%ae%e9%a2%98%e7%8e%b0%e8%b1%a1&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Codex 通过 Moon Bridge 使用 DeepSeek V4 Flash 时，任务执行中途突然终止。终端输出类似：&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;｜｜DSML｜｜tool_calls&amp;gt; &amp;lt;｜｜DSML｜｜invoke name=&amp;#34;exec_command&amp;#34;&amp;gt; &amp;lt;｜｜DSML｜｜parameter name=&amp;#34;cmd&amp;#34; string=&amp;#34;true&amp;#34;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;然后任务就卡住不动了。&lt;/p&gt;&#xA;&lt;h2 id=&#34;问题分析&#34;&gt;&#xA;  问题分析&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e9%97%ae%e9%a2%98%e5%88%86%e6%9e%90&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;moon-bridge-架构&#34;&gt;&#xA;  Moon Bridge 架构&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#moon-bridge-%e6%9e%b6%e6%9e%84&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;Moon Bridge 是一个 Go 编写的协议转换与模型路由代理，对外暴露 OpenAI Responses API（&lt;code&gt;/v1/responses&lt;/code&gt;），对内支持 Anthropic Messages、Google Gemini、OpenAI Chat Completions 等多种上游协议。&lt;/p&gt;&#xA;&lt;p&gt;当 Codex 发起请求时，Moon Bridge 负责把 OpenAI Responses 格式的请求转换为上游 Provider 需要的格式。&lt;/p&gt;&#xA;&lt;h3 id=&#34;根因deepseek-v4-dsml&#34;&gt;&#xA;  根因：DeepSeek V4 DSML&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%a0%b9%e5%9b%a0deepseek-v4-dsml&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;DeepSeek V4 在工具调用场景下，会将 DSML（DeepSeek Markup Language）标记直接输出到 &lt;code&gt;content&lt;/code&gt; 字段，而不是作为结构化的 &lt;code&gt;tool_calls&lt;/code&gt; 返回。这违反了 OpenAI API 契约——工具调用应该只在 &lt;code&gt;tool_calls&lt;/code&gt; 字段中传递。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Codex CLI 用 DeepSeek 的协议转换方案</title>
      <link>https://blog.ohtly.com/posts/2026-06-24-codex-cli-deepseek/</link>
      <pubDate>Wed, 24 Jun 2026 14:35:40 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-06-24-codex-cli-deepseek/</guid>
      <description>&lt;p&gt;Codex CLI 是 OpenAI 出品的终端编码 agent。2026 年 2 月起，Codex 只支持 OpenAI Responses API（&lt;code&gt;/v1/responses&lt;/code&gt;），不再兼容 Chat Completions（&lt;code&gt;/v1/chat/completions&lt;/code&gt;）。DeepSeek 官方 API 只提供 Chat Completions 接口，两者协议不互通。&lt;/p&gt;&#xA;&lt;p&gt;需要一个协议转换层。&lt;/p&gt;&#xA;&lt;h2 id=&#34;方案对比&#34;&gt;&#xA;  方案对比&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%96%b9%e6%a1%88%e5%af%b9%e6%af%94&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;方案&lt;/th&gt;&#xA;          &lt;th&gt;原理&lt;/th&gt;&#xA;          &lt;th&gt;评价&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Chutes&lt;/td&gt;&#xA;          &lt;td&gt;云端 Responses→Chat 翻译&lt;/td&gt;&#xA;          &lt;td&gt;依赖第三方云服务&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;LiteLLM&lt;/td&gt;&#xA;          &lt;td&gt;全能 AI 网关&lt;/td&gt;&#xA;          &lt;td&gt;功能太多，对 Codex 场景大材小用&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;open-codex fork&lt;/td&gt;&#xA;          &lt;td&gt;用 Chat API 重写&lt;/td&gt;&#xA;          &lt;td&gt;已停更&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;strong&gt;Moon Bridge&lt;/strong&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;strong&gt;本地 Go 代理，协议转换 + 路由&lt;/strong&gt;&lt;/td&gt;&#xA;          &lt;td&gt;&lt;strong&gt;DeepSeek 官方推荐，轻量专注&lt;/strong&gt;&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;Moon Bridge 是 Go 写的协议转换代理，对外暴露 &lt;code&gt;POST /v1/responses&lt;/code&gt;，对内将请求转为 Anthropic Messages API 格式发给 DeepSeek（DeepSeek 兼容 Anthropic 协议）。支持多 Provider 路由、请求跟踪、Web Console 管理。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
