Yurzi/dsh-pdf-mineru0

dsh-pdf-mineru

Provider-independent DSH PDF parsing tools powered by MinerU, with session jobs, immutable global results, and safe request coalescing.

包名
dsh-pdf-mineru
版本
0.0.1
许可证
MIT
最近更新
2026年8月24日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Yurzi/dsh-pdf-mineru

配置

配置通过 DSH Settings 的 dsh-pdf-mineru namespace 持久化。cordis.patch.yml 只提供首次启动默认值。API Token 只保存于 DSH credentials 或环境变量中,配置仅保存 credential reference。

自托管 v2

schemaVersion: 1
activeProvider: mp_self_hosted
providers:
  - id: mp_self_hosted
    type: self-hosted-v2
    baseURL: http://localhost:18000
    apiKeyEnv: MINERU_API_KEY
    allowInsecureHttp: true
    modelMap:
      pipeline: pipeline
      vlm: vlm-engine
defaults:
  model: pipeline
  ocr: false
  parseMethod: auto
  language: ch
  formula: true
  table: true
  artifacts: [markdown]

modelMap 是显式映射。hybrid-engine 等值可以配置为统一 vlm 的后端,但 Service 不会猜测或静默降级。HTTP 只允许在自托管配置显式启用 allowInsecureHttp 时使用。

官方 v4

schemaVersion: 1
activeProvider: mp_official
providers:
  - id: mp_official
    type: official-v4
    baseURL: https://mineru.net/api/v4
    apiKeyEnv: MINERU_API_KEY
    models: [pipeline, vlm]
    configuredVersion: v4
defaults:
  model: vlm
  ocr: false
  parseMethod: auto
  language: ch
  formula: true
  table: true
  artifacts: [markdown]

官方 v4 当前限制为单文件不超过 200 MB、200 页。官方 Provider 不支持自托管专用的 parseMethod: txt,配置或请求会明确失败。

存储与限制

默认 storageRoot 为 $DSH_HOME/dsh-pdf-mineru/v1,布局如下:

jobs//.json
results/sha256/
//manifest.json
staging//
quarantine//
.process.lock

首次版本明确限制一个 storageRoot 只能由一个 DSH 进程使用。修改 storageRoot 后需重启;Provider、默认参数、轮询和输出限制对新任务热生效。

可配置限制包括源文件大小、API 响应大小、ZIP 下载大小、entry 数、单 entry 解压字节、总解压字节和压缩比。