インストール#
brew install python@3.12 # または python.org のインストーラー
python3.12 -m venv ~/docling-env && source ~/docling-env/bin/activate
pip install -U pip
pip install "docling[ocrmac]" # Apple Vision OCR 付き
docling --versionmacOS では PyTorch を別に入れる必要はありません。PyPI の macOS 版は NVIDIA のライブラリを引き込まず、MPS にも対応しています。
どの PyTorch が入るか#
| Mac | Docling 2.148.0 で解決される PyTorch | 理由 |
|---|---|---|
| Apple Silicon、macOS 14 以降 | 2.15.0(最新) | 2.12.0 以降のビルドは macosx_14_0_arm64 タグ |
| Apple Silicon、macOS 11–13 | 2.11.0 | macosx_11_0_arm64 のビルドがある最後のバージョン |
| Intel(x86_64) | 2.2.2 | Intel macOS 版がある最後の PyTorch |
uv のリゾルバーで Python 3.12 向けに確認し、PyPI のビルドのタグと照合しました。Docling は torch>=2.2.2 を要求するので、Intel Mac でも動きます。
Apple Silicon での高速化#
- レイアウト・表・OCR のモデル:自動的に MPS で動きます。
--device mpsで強制も可能。 - Apple Vision OCR:
--ocr-engine ocrmac。言語はen-US・zh-Hans・ja-JPのような Apple のコードかiso:タグ。--ocr-option recognition=fastで精度と引き換えに高速化。 - VLM 用の MLX:
pip install "docling[vlm]"で Apple Silicon にmlx-vlmが入り、MLX 版のあるプリセット(Granite-Docling・SmolDocling・Qwen・Pixtral・Gemma など)が自動的に使います。 - 音声用の MLX:
docling[asr]でmlx-whisperが入ります。--asr-modelでwhisper_*_mlxモデルを選びます。
docling convert scan.pdf --ocr-engine ocrmac --ocr-lang ja-JP
docling convert report.pdf --pipeline vlm --vlm-model granite_docling
docling convert meeting.m4a --pipeline asr --asr-model whisper_turbo_mlxHomebrew で入れる追加ツール#
brew install tesseract tesseract-lang # Tesseract エンジン + 全言語
brew install --cask libreoffice # .doc・.ppt・.xls・.rtf
brew install ffmpeg # 音声と動画よくある質問
Docling は Apple Silicon の GPU を使う?
はい。PyTorch の MPS バックエンドは標準の macOS 版に含まれ、Docling の既定 --device auto は CUDA がないとき MPS を選びます。--device mps で強制もできます。
Mac で Docling に最適な OCR エンジンは?
Apple 内蔵の Vision フレームワークを使う ocrmac です。モデルのダウンロード不要で多言語に強く、日本語は ja-JP。docling[ocrmac] を入れて --ocr-engine ocrmac を指定します。macOS では自動エンジンも ocrmac が入っていれば最初に試します。
Intel Mac で Docling は動く?
はい。Docling 2.148.0 はインストールできますが、PyTorch は 2.2.2 以降 Intel macOS 版を出していないため、そのバージョンが入ります。処理はすべて CPU で行われます。
出典
- PyPI の torch:macOS 版のタグ(2.11.0:macosx_11_0、2.12.0 以降:macosx_14_0)
- PyPI の ocrmac
- ibm-granite/granite-docling-258M-mlx
内容は正確でしたか? Docling のリリースで挙動が変わったときはページを再検証しています。コマンドが動かない場合は、Docling のバージョンとエラーを hello@docling.org にお送りください。修正は通常 1 日以内に反映します。