Skip to main content

No project description provided

Project description

vlmparse

A unified wrapper for Vision Language Models (VLM) and OCR solutions to parse PDF documents into Markdown.

Features:

  • ⚡ Async/concurrent processing for high throughput
  • 🐳 Automatic Docker server management for local models
  • 🔄 Unified interface across all VLM/OCR providers
  • 📊 Built-in result visualization with Streamlit

Supported Converters:

  • Open Source Small VLMs: lightonocr, mineru2.5, hunyuanocr, paddleocrvl, granite-docling, olmocr2-fp8, dotsocr, chandra, deepseekocr, nanonets/Nanonets-OCR2-3B
  • Open Source Generalist VLMs: such as the Qwen family.
  • Pipelines: docling
  • Proprietary LLMs: gemini, gpt

Installation

uv sync

With optional dependencies:

uv sync --all-extras

Activate the virtual environment:

source .venv/bin/activate

Other solution: append uv run to all the commands below.

CLI Usage

Convert PDFs

With a general VLM (requires setting your api key as an environment variable):

vlmparse convert --input "*.pdf" --out_folder ./output --model gemini-2.5-flash-lite

Convert with auto deployment of a small vlm (or any huggingface VLM model, requires a gpu + docker installation):

vlmparse convert --input "*.pdf" --out_folder ./output --model nanonets/Nanonets-OCR2-3B

Deploy a local model server

Deployment (requires a gpu + docker installation):

  • You need a gpu dedicated for this.
  • Check that the port is not used by another service.
vlmparse serve --model lightonocr --port 8000 --gpus 1

then convert:

vlmparse convert --input "*.pdf" --out_folder ./output --model lightonocr --uri http://localhost:8000/v1

You can also list all running servers:

vlmparse list

Show logs of a server (if only one server is running, the container name is not needed):

vlmparse log <container_name>

Stop a server (if only one server is running, the container name is not needed):

vlmparse stop <container_name>

View conversion results with Streamlit

vlmparse view ./output

Configuration

Set API keys as environment variables:

export GOOGLE_API_KEY="your-key"
export OPENAI_API_KEY="your-key"

Python API

Client interface:

from vlmparse.registries import converter_config_registry

# Get a converter configuration
config = converter_config_registry.get("gemini-2.5-flash-lite")
client = config.get_client()

# Convert a single PDF
document = client("path/to/document.pdf")
print(document.to_markdown())

# Batch convert multiple PDFs
documents = client.batch(["file1.pdf", "file2.pdf"])

Docker server interface:

from vlmparse.registries import docker_config_registry

config = docker_config_registry.get("lightonocr")
server = config.get_server()
server.start()

# Client calls...

server.stop()

Converter with automatic server deployment:

from vlmparse.converter_with_server import ConverterWithServer

converter_with_server = ConverterWithServer(model="mineru2.5")
documents = converter_with_server.parse(inputs=["file1.pdf", "file2.pdf"], out_folder="./output")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vlmparse-0.1.2.tar.gz (101.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vlmparse-0.1.2-py3-none-any.whl (97.4 kB view details)

Uploaded Python 3

File details

Details for the file vlmparse-0.1.2.tar.gz.

File metadata

  • Download URL: vlmparse-0.1.2.tar.gz
  • Upload date:
  • Size: 101.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for vlmparse-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2665d14afd97a4d799b26e2fc0ac89b872b7276ed258b7fc2bc4a8d3ec583b36
MD5 e151a0a3bb840b43d4f96472608ba8cf
BLAKE2b-256 d7901ff02dde54768654105437d2cf4cfdbf3c86ebe039ba25fed94d30080ca8

See more details on using hashes here.

File details

Details for the file vlmparse-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: vlmparse-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 97.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for vlmparse-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dc110bd7eb637426d1982cbad47591aa3c9ace7318fdf250a89a6e3e66d4681d
MD5 0d3c921eea8ad33d6d97cce6f1ddab26
BLAKE2b-256 7abbc7b82289435df3c0e7e742f6dfc6bb54729111aa7b9b1ab5e9b085cd0be8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page