A collection of locally-running tools that extend MarkItDown with offline OCR (via a local VLM) and offline audio transcription (via whisperfile), keeping all data on your machine with no cloud API calls.
| Script | Launcher | Purpose |
|---|---|---|
markitdown-ocr.py |
markitdown-ocr.bat |
Convert PDFs to Markdown using a local Vision-Language Model |
markitdown-audio.py |
markitdown-audio.bat |
Transcribe audio files to Markdown using local Whisper |
llamafiles.bat |
— | Start the local llama.cpp VLM server (MiniCPM-V) |
- Python ≥ 3.10
- uv — used by the
.batlaunchers to run scripts with inline dependencies (no manualpip installneeded) - llamafile — for OCR / VLM inference (
llamafile.exeon PATH) - whisperfile — for audio transcription (
whisperfile.exenext to the script or on PATH)
Place model files in a models/ subfolder next to the scripts:
markitdown/
├── models/
│ ├── MiniCPM-V-4_5-Q4_K_M.gguf ← VLM weights (for OCR)
│ ├── mmproj-model-f16.gguf ← VLM multimodal projector
│ └── ggml-base.en.bin ← Whisper model (auto-downloaded if missing)
├── llamafiles.bat
├── markitdown-audio.bat
├── markitdown-audio.py
├── markitdown-ocr.bat
└── markitdown-ocr.py
The Whisper base model (
ggml-base.en.bin, ~142 MB) is downloaded automatically from Hugging Face the first time you runmarkitdown-audioif it is not already present.
Start the VLM server first:
llamafiles.batThis starts a local llamafile server on port 8080 using MiniCPM-V.
Then run OCR in a new terminal:
markitdown-ocr.bat input.pdf
markitdown-ocr.bat input.pdf -o result.md
markitdown-ocr.bat input.pdf -o result.md --port 8080| Argument | Default | Description |
|---|---|---|
input |
(required) | Path to the input PDF |
-o, --output |
output.md |
Output Markdown filename |
--port |
8080 |
Port the llama.cpp server is listening on |
markitdown-audio.bat recording.wav
markitdown-audio.bat podcast.mp3 -o transcript.md
markitdown-audio.bat interview.flac -o notes.md -t 8 -l autoSupported formats: .wav, .mp3, .ogg, .flac
| Argument | Default | Description |
|---|---|---|
input |
(required) | Path to the input audio file |
-o, --output |
output.md |
Output Markdown filename |
-m, --model |
models/ggml-base.en.bin |
Path to a custom Whisper model |
-t, --threads |
4 |
Number of CPU threads to use |
-ng, --no-gpu |
off | Disable GPU acceleration |
-l, --language |
en |
Language code, or auto for auto-detection |
PDF → MarkItDown (markitdown-ocr plugin) → local llamafile VLM → Markdown
markitdown-ocr.py initialises MarkItDown with enable_plugins=True and points its OpenAI-compatible client at http://localhost:{port}/v1. The markitdown-ocr plugin renders each PDF page as an image and sends it to the VLM for extraction.
Audio file → whisperfile.exe → transcript text → MarkItDown wrapper → Markdown
markitdown-audio.py registers a custom LocalAudioConverter with MarkItDown. When an audio file is passed, the converter writes it to a temporary file, calls whisperfile.exe via subprocess, and wraps the transcript in a simple Markdown document.
Dependencies are declared inline (PEP 723) and installed automatically by uv:
| Script | Dependencies |
|---|---|
markitdown-audio.py |
markitdown |
markitdown-ocr.py |
markitdown, markitdown-ocr, openai, Pillow |
- Run
llamafiles.batand keep that window open before using the OCR tool. - Use
-tto increase thread count on machines with many CPU cores for faster transcription. - Use
-l autofor non-English audio; use an explicit language code (e.g.,-l fr) for best accuracy on known languages. - Both tools output plain UTF-8 Markdown that can be opened in any editor or piped into further processing.