docpipe is a small local CLI for two file-based workflows:
- Convert a PDF file to Markdown.
- Summarize a Markdown file into another Markdown file.
The workflows are intentionally separate:
PDF -> Markdown
Markdown -> Summary Markdown
Create and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activateInstall the project in editable mode:
python -m pip install -e .Check the CLI:
docpipe --helpConvert a PDF to Markdown:
docpipe convert input.pdf -o output.mdBy default, existing output files are not overwritten. To overwrite:
docpipe convert input.pdf -o output.md --overwriteSummarize a Markdown file:
export DOCPIPE_API_KEY="your_api_key_here"
docpipe summarize input.md -o summary.mdOptions:
docpipe summarize input.md -o summary.md --chunks 10 --max-chunk-words 300--chunkssets the target number of Markdown chunks.--max-chunk-wordsasks the model to keep each chunk summary under that word count.--overwriteallows replacing an existing output file.
The summarization backend uses the OpenAI Python SDK. By default, it uses the standard OpenAI API unless DOCPIPE_BASE_URL is set.
Use OpenAI:
export DOCPIPE_API_KEY="your_openai_key"
export DOCPIPE_MODEL="gpt-5.4-mini"
unset DOCPIPE_BASE_URLUse Groq's OpenAI-compatible API for a free alternative:
export DOCPIPE_API_KEY="your_groq_key"
export DOCPIPE_BASE_URL="https://api.groq.com/openai/v1"
export DOCPIPE_MODEL="openai/gpt-oss-20b"The default model is:
openai/gpt-oss-20b
You can override it with:
export DOCPIPE_MODEL="another-model-id"- PDF conversion uses Docling.
- Markdown chunking is simple paragraph grouping based on the requested chunk count.
- Each chunk is summarized with AI.
- Final output is built by deterministically merging chunk summaries.
- The final merge does not call AI.
convert:
- input:
.pdf - output:
.mdor.markdown
summarize:
- input:
.mdor.markdown - output:
.mdor.markdown
PDF conversion is powered by Docling.
Do not commit API keys, .env files, virtual environments, generated outputs, or local test documents.
Improve chunking modes (use the number of paragraph in the .md file as chunks when they do not exceed max chunck size as default)