MarkPDFdown/markpdfdown ? reverse-engineered prompt

Reverse engineered prompt

Build me a Python tool that can turn PDF files into clean Markdown using a multimodal AI model. I want it to keep the structure as much as possible, like headings, lists, tables, formulas, and diagrams, so the output is easy to edit and read.

It should work from the command line in two ways, either by giving it an input file and output file, or by piping a PDF in and getting Markdown back. Please also support converting images to Markdown, and let me choose a page range when I only want part of a PDF.

Use environment variables for setup, including the model name and API key, and make it work with OpenAI and OpenRouter through a shared LLM client approach. If it helps, look up the current docs online for the best way to connect everything. Keep the code clean and modular, and make sure it runs nicely from Python as a module too.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab