vlmparse 0.1.4__tar.gz → 0.1.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. {vlmparse-0.1.4/vlmparse.egg-info → vlmparse-0.1.5}/PKG-INFO +17 -3
  2. {vlmparse-0.1.4 → vlmparse-0.1.5}/README.md +15 -1
  3. {vlmparse-0.1.4 → vlmparse-0.1.5}/pyproject.toml +2 -6
  4. {vlmparse-0.1.4 → vlmparse-0.1.5}/tests/test_end2end.py +45 -0
  5. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/docling.py +2 -2
  6. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/dotsocr.py +11 -2
  7. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/mineru.py +8 -7
  8. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/openai_converter.py +1 -0
  9. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/converter_with_server.py +5 -4
  10. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/registries.py +2 -4
  11. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/servers/docker_server.py +1 -1
  12. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/servers/utils.py +3 -2
  13. {vlmparse-0.1.4 → vlmparse-0.1.5/vlmparse.egg-info}/PKG-INFO +17 -3
  14. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse.egg-info/SOURCES.txt +0 -18
  15. vlmparse-0.1.4/tests/test_benchmark_tests.py +0 -731
  16. vlmparse-0.1.4/tests/test_process_and_run_benchmark.py +0 -144
  17. vlmparse-0.1.4/tests/test_table_tests.py +0 -1516
  18. vlmparse-0.1.4/vlmparse/benchpdf2md/bench_tests/benchmark_tsts.py +0 -1763
  19. vlmparse-0.1.4/vlmparse/benchpdf2md/bench_tests/utils.py +0 -0
  20. vlmparse-0.1.4/vlmparse/benchpdf2md/create_dataset.py +0 -60
  21. vlmparse-0.1.4/vlmparse/benchpdf2md/olmocrbench/katex/__init__.py +0 -1
  22. vlmparse-0.1.4/vlmparse/benchpdf2md/olmocrbench/katex/render.py +0 -592
  23. vlmparse-0.1.4/vlmparse/benchpdf2md/olmocrbench/repeatdetect.py +0 -175
  24. vlmparse-0.1.4/vlmparse/benchpdf2md/olmocrbench/run_olmocr_bench.py +0 -256
  25. vlmparse-0.1.4/vlmparse/benchpdf2md/olmocrbench/tests.py +0 -1334
  26. vlmparse-0.1.4/vlmparse/benchpdf2md/run_benchmark.py +0 -296
  27. vlmparse-0.1.4/vlmparse/benchpdf2md/st_visu_benchmark/app.py +0 -271
  28. vlmparse-0.1.4/vlmparse/benchpdf2md/st_visu_benchmark/highligh_text.py +0 -117
  29. vlmparse-0.1.4/vlmparse/benchpdf2md/st_visu_benchmark/test_form.py +0 -95
  30. vlmparse-0.1.4/vlmparse/benchpdf2md/st_visu_benchmark/ui_elements.py +0 -20
  31. vlmparse-0.1.4/vlmparse/benchpdf2md/st_visu_benchmark/utils.py +0 -50
  32. vlmparse-0.1.4/vlmparse/benchpdf2md/utils.py +0 -56
  33. {vlmparse-0.1.4 → vlmparse-0.1.5}/LICENSE +0 -0
  34. {vlmparse-0.1.4 → vlmparse-0.1.5}/setup.cfg +0 -0
  35. {vlmparse-0.1.4 → vlmparse-0.1.5}/tests/test_all_converters_mocked.py +0 -0
  36. {vlmparse-0.1.4 → vlmparse-0.1.5}/tests/test_batch_parser.py +0 -0
  37. {vlmparse-0.1.4 → vlmparse-0.1.5}/tests/test_cli.py +0 -0
  38. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/base_model.py +0 -0
  39. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/build_doc.py +0 -0
  40. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/cli.py +0 -0
  41. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/chandra.py +0 -0
  42. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/deepseekocr.py +0 -0
  43. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/granite_docling.py +0 -0
  44. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/hunyuanocr.py +0 -0
  45. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/lightonocr.py +0 -0
  46. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/nanonetocr.py +0 -0
  47. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/olmocr.py +0 -0
  48. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/paddleocrvl.py +0 -0
  49. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/pipe_utils/cleaner.py +0 -0
  50. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/pipe_utils/html_to_md_conversion.py +0 -0
  51. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/pipe_utils/utils.py +0 -0
  52. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/clients/prompts.py +0 -0
  53. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/constants.py +0 -0
  54. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/converter.py +0 -0
  55. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/data_model/box.py +0 -0
  56. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/data_model/document.py +0 -0
  57. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/st_viewer/fs_nav.py +0 -0
  58. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/st_viewer/st_viewer.py +0 -0
  59. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse/utils.py +0 -0
  60. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse.egg-info/dependency_links.txt +0 -0
  61. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse.egg-info/entry_points.txt +0 -0
  62. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse.egg-info/requires.txt +0 -0
  63. {vlmparse-0.1.4 → vlmparse-0.1.5}/vlmparse.egg-info/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vlmparse
3
- Version: 0.1.4
4
- Requires-Python: >=3.12.0
3
+ Version: 0.1.5
4
+ Requires-Python: >=3.11.0
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
7
7
  Requires-Dist: devtools>=0.12.2
@@ -72,6 +72,19 @@ Supported Converters:
72
72
 
73
73
  ## Installation
74
74
 
75
+ Simplest solution with only the cli:
76
+
77
+ ```bash
78
+ uv tool install vlmparse
79
+ ```
80
+
81
+ If you want to run the granite-docling model or use the streamlit viewing app:
82
+
83
+ ```bash
84
+ uv tool install vlmparse[docling_core,st_app]
85
+ ```
86
+
87
+ If you prefer cloning the repository and using the local version:
75
88
  ```bash
76
89
  uv sync
77
90
  ```
@@ -86,10 +99,11 @@ Activate the virtual environment:
86
99
  ```bash
87
100
  source .venv/bin/activate
88
101
  ```
89
- Other solution: append uv run to all the commands below.
90
102
 
91
103
  ## CLI Usage
92
104
 
105
+ Note that you can bypass the previous installation step and just add uvx before each of the commands below.
106
+
93
107
  ### Convert PDFs
94
108
 
95
109
  With a general VLM (requires setting your api key as an environment variable):
@@ -18,6 +18,19 @@ Supported Converters:
18
18
 
19
19
  ## Installation
20
20
 
21
+ Simplest solution with only the cli:
22
+
23
+ ```bash
24
+ uv tool install vlmparse
25
+ ```
26
+
27
+ If you want to run the granite-docling model or use the streamlit viewing app:
28
+
29
+ ```bash
30
+ uv tool install vlmparse[docling_core,st_app]
31
+ ```
32
+
33
+ If you prefer cloning the repository and using the local version:
21
34
  ```bash
22
35
  uv sync
23
36
  ```
@@ -32,10 +45,11 @@ Activate the virtual environment:
32
45
  ```bash
33
46
  source .venv/bin/activate
34
47
  ```
35
- Other solution: append uv run to all the commands below.
36
48
 
37
49
  ## CLI Usage
38
50
 
51
+ Note that you can bypass the previous installation step and just add uvx before each of the commands below.
52
+
39
53
  ### Convert PDFs
40
54
 
41
55
  With a general VLM (requires setting your api key as an environment variable):
@@ -2,17 +2,13 @@
2
2
  requires = ["setuptools", "wheel"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
- [metadata]
6
- name = "vlmparse"
7
- version = "0.1.0"
8
-
9
5
  [project]
10
6
  name = "vlmparse"
11
- version = "0.1.4"
7
+ version = "0.1.5"
12
8
  authors = []
13
9
  description = ""
14
10
  readme = "README.md"
15
- requires-python = ">=3.12.0"
11
+ requires-python = ">=3.11.0"
16
12
  dependencies = [
17
13
  "devtools>=0.12.2",
18
14
  "docker>=7.1.0",
@@ -64,3 +64,48 @@ def test_convert_with_docker(file_path, model):
64
64
  assert doc.pages[1].text is not None
65
65
 
66
66
  # Server will be automatically stopped due to auto_stop=True
67
+ server.stop()
68
+
69
+
70
+ # @pytest.mark.skipif(
71
+ # "RUN_DEPLOYMENT_VLLM" not in os.environ
72
+ # or os.environ["RUN_DEPLOYMENT_VLLM"] == "false"
73
+ # or "GPU_TEST_VLMPARSE" not in os.environ,
74
+ # reason="Skipping because RUN_DEPLOYMENT_VLLM is not set or is false or GPU_TEST is not set",
75
+ # )
76
+ # @pytest.mark.parametrize(
77
+ # "model",
78
+ # [
79
+ # "docling",
80
+ # "lightonocr",
81
+ # "dotsocr",
82
+ # "nanonets/Nanonets-OCR2-3B",
83
+ # "hunyuanocr",
84
+ # "olmocr-2-fp8",
85
+ # "paddleocrvl",
86
+ # "mineru25",
87
+ # "chandra",
88
+ # "deepseekocr",
89
+ # "granite-docling",
90
+ # ],
91
+ # )
92
+ # def test_converter_with_server_with_docker(file_path, model):
93
+ # """Test conversion with automatic Docker deployment (requires GPU due to vllm limitations)."""
94
+
95
+ # from vlmparse.converter_with_server import ConverterWithServer
96
+ # converter_with_server = ConverterWithServer(
97
+ # model=model,
98
+ # uri=None,
99
+ # gpus=os.environ["GPU_TEST_VLMPARSE"],
100
+ # with_vllm_server=True,
101
+ # concurrency=10,
102
+ # )
103
+
104
+ # docs = converter_with_server.parse([file_path])
105
+
106
+ # # Assertions
107
+ # assert len(docs) == 1
108
+ # doc = docs[0]
109
+ # assert len(doc.pages) == 2
110
+ # assert doc.pages[0].text is not None
111
+ # assert doc.pages[1].text is not None
@@ -34,7 +34,7 @@ class DoclingDockerServerConfig(DockerServerConfig):
34
34
  "LOG_LEVEL": "DEBUG", # Enable verbose logging
35
35
  # Performance Tuning
36
36
  # "UVICORN_WORKERS": "4", # Increase web server workers (Default: 1)
37
- # "DOCLING_SERVE_ENG_LOC_NUM_WORKERS": "4", # Increase processing workers (Default: 2)
37
+ "DOCLING_SERVE_ENG_LOC_NUM_WORKERS": "16", # Increase processing workers (Default: 2)
38
38
  "DOCLING_NUM_THREADS": "32", # Increase torch threads (Default: 4)
39
39
  }
40
40
  )
@@ -62,8 +62,8 @@ class DoclingDockerServerConfig(DockerServerConfig):
62
62
  class DoclingConverterConfig(ConverterConfig):
63
63
  """Configuration for Docling converter client."""
64
64
 
65
+ base_url: str
65
66
  model_name: str = "docling"
66
- base_url: str = "http://localhost:5001"
67
67
  timeout: int = 300
68
68
  api_kwargs: dict = {"output_format": "markdown", "image_export_mode": "referenced"}
69
69
 
@@ -8,6 +8,7 @@ from PIL import Image
8
8
  from pydantic import Field
9
9
 
10
10
  from vlmparse.clients.openai_converter import (
11
+ LLMParams,
11
12
  OpenAIConverterClient,
12
13
  OpenAIConverterConfig,
13
14
  )
@@ -28,6 +29,7 @@ class DotsOCRDockerServerConfig(DockerServerConfig):
28
29
  dockerfile_dir: str = str(DOCKERFILE_DIR / "dotsocr")
29
30
  command_args: list[str] = Field(
30
31
  default_factory=lambda: [
32
+ "/workspace/weights/DotsOCR",
31
33
  "--tensor-parallel-size",
32
34
  "1",
33
35
  "--gpu-memory-utilization",
@@ -44,12 +46,19 @@ class DotsOCRDockerServerConfig(DockerServerConfig):
44
46
  # "16384",
45
47
  ]
46
48
  )
47
- add_model_key_to_server: bool = False
49
+ add_model_key_to_server: bool = True
48
50
  aliases: list[str] = Field(default_factory=lambda: ["dotsocr"])
49
51
 
50
52
  @property
51
53
  def client_config(self):
52
- return DotsOCRConverterConfig(llm_params=self.llm_params)
54
+ return DotsOCRConverterConfig(
55
+ llm_params=LLMParams(
56
+ base_url=f"http://localhost:{self.docker_port}{self.get_base_url_suffix()}",
57
+ )
58
+ )
59
+
60
+ def get_base_url_suffix(self) -> str:
61
+ return "/v1"
53
62
 
54
63
 
55
64
  class DotsOCRConverterConfig(OpenAIConverterConfig):
@@ -1,6 +1,5 @@
1
1
  import asyncio
2
2
  import io
3
- import os
4
3
 
5
4
  import orjson
6
5
  from loguru import logger
@@ -20,18 +19,21 @@ class MinerUDockerServerConfig(DockerServerConfig):
20
19
  docker_image: str = "pulsia/mineru25apipulsia:latest"
21
20
  docker_port: int = 4299
22
21
  container_port: int = 8000
22
+ server_ready_indicators: list[str] = Field(
23
+ default_factory=lambda: ["Uvicorn running"]
24
+ )
23
25
 
24
26
  @property
25
27
  def client_config(self):
26
- return MinerUConverterConfig(api_url=f"http://localhost:{self.docker_port}")
28
+ return MinerUConverterConfig(base_url=f"http://localhost:{self.docker_port}")
27
29
 
28
30
 
29
31
  class MinerUConverterConfig(ConverterConfig):
30
32
  """Configuration for MinerU API converter."""
31
33
 
32
- base_url: str = Field(
33
- default_factory=lambda: os.getenv("MINERU_API_URL", "http://localhost:4299")
34
- )
34
+ base_url: str
35
+ model_name: str = "opendatalab/MinerU2.5-2509-1.2B"
36
+ aliases: list[str] = Field(default_factory=lambda: ["mineru25"])
35
37
  timeout: int = 600
36
38
 
37
39
  def get_client(self, **kwargs) -> "MinerUConverter":
@@ -54,13 +56,12 @@ class MinerUConverter(BaseConverter):
54
56
  super().__init__(config=config, **kwargs)
55
57
  from httpx import AsyncClient
56
58
 
57
- self.client = AsyncClient(base_url=config.api_url, timeout=config.timeout)
59
+ self.client = AsyncClient(base_url=config.base_url, timeout=config.timeout)
58
60
 
59
61
  async def _async_inference_with_api(self, image) -> list:
60
62
  """Run async inference with MinerU API."""
61
63
 
62
64
  img_byte_arr = await asyncio.to_thread(to_bytes_io, image)
63
-
64
65
  response = await self.client.post(
65
66
  "process-image",
66
67
  files={"image": ("image.png", img_byte_arr, "image/png")},
@@ -92,6 +92,7 @@ class OpenAIConverterClient(BaseConverter):
92
92
  base_url=self.config.llm_params.base_url,
93
93
  api_key=self.config.llm_params.api_key,
94
94
  timeout=self.config.llm_params.timeout,
95
+ max_retries=self.config.llm_params.max_retries,
95
96
  )
96
97
 
97
98
  async def _get_chat_completion(
@@ -42,13 +42,13 @@ class ConverterWithServer:
42
42
  docker_config = docker_config_registry.get(
43
43
  self.model, default=self.with_vllm_server
44
44
  )
45
- if self.port is not None:
46
- docker_config.docker_port = self.port
47
45
 
48
46
  if docker_config is not None:
47
+ if self.port is not None:
48
+ docker_config.docker_port = self.port
49
49
  docker_config.gpu_device_ids = gpu_device_ids
50
- server = docker_config.get_server(auto_stop=True)
51
- server.start()
50
+ self.server = docker_config.get_server(auto_stop=True)
51
+ self.server.start()
52
52
 
53
53
  self.client = docker_config.get_client()
54
54
  else:
@@ -56,6 +56,7 @@ class ConverterWithServer:
56
56
 
57
57
  else:
58
58
  client_config = converter_config_registry.get(self.model, uri=self.uri)
59
+
59
60
  self.client = client_config.get_client()
60
61
 
61
62
  def parse(
@@ -108,6 +108,7 @@ for gemini_model in [
108
108
  "gemini-2.5-flash",
109
109
  "gemini-2.5-flash-lite",
110
110
  "gemini-3-pro-preview",
111
+ "gemini-3-flash-preview",
111
112
  ]:
112
113
  converter_config_registry.register(
113
114
  gemini_model,
@@ -120,12 +121,9 @@ for gemini_model in [
120
121
  ),
121
122
  )
122
123
  for openai_model in [
123
- "gpt-5.1",
124
- "gpt-5.1-mini",
125
- "gpt-5.1-nano",
124
+ "gpt-5.2",
126
125
  "gpt-5",
127
126
  "gpt-5-mini",
128
- "gpt-5-nano",
129
127
  ]:
130
128
  converter_config_registry.register(
131
129
  openai_model,
@@ -78,7 +78,7 @@ class VLLMDockerServerConfig(DockerServerConfig):
78
78
  from vlmparse.clients.openai_converter import LLMParams
79
79
 
80
80
  return LLMParams(
81
- base_url=f"http://localhost:{self.docker_port}/v1",
81
+ base_url=f"http://localhost:{self.docker_port}{self.get_base_url_suffix()}",
82
82
  model_name=self.default_model_name,
83
83
  )
84
84
 
@@ -3,9 +3,8 @@ import time
3
3
  from contextlib import contextmanager
4
4
  from pathlib import Path
5
5
 
6
- from loguru import logger
7
-
8
6
  import docker
7
+ from loguru import logger
9
8
 
10
9
 
11
10
  def _ensure_image_exists(
@@ -230,6 +229,8 @@ def get_model_from_uri(uri: str) -> str:
230
229
  for container in containers:
231
230
  c_uri = container.labels.get("vlmparse_uri")
232
231
  c_model = container.labels.get("vlmparse_model_name")
232
+ if c_uri is not None:
233
+ c_uri = c_uri.replace("localhost", "0.0.0.0")
233
234
 
234
235
  # Check if user URI matches container URI (ignoring /v1 suffix if missing)
235
236
  if c_uri and (
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vlmparse
3
- Version: 0.1.4
4
- Requires-Python: >=3.12.0
3
+ Version: 0.1.5
4
+ Requires-Python: >=3.11.0
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
7
7
  Requires-Dist: devtools>=0.12.2
@@ -72,6 +72,19 @@ Supported Converters:
72
72
 
73
73
  ## Installation
74
74
 
75
+ Simplest solution with only the cli:
76
+
77
+ ```bash
78
+ uv tool install vlmparse
79
+ ```
80
+
81
+ If you want to run the granite-docling model or use the streamlit viewing app:
82
+
83
+ ```bash
84
+ uv tool install vlmparse[docling_core,st_app]
85
+ ```
86
+
87
+ If you prefer cloning the repository and using the local version:
75
88
  ```bash
76
89
  uv sync
77
90
  ```
@@ -86,10 +99,11 @@ Activate the virtual environment:
86
99
  ```bash
87
100
  source .venv/bin/activate
88
101
  ```
89
- Other solution: append uv run to all the commands below.
90
102
 
91
103
  ## CLI Usage
92
104
 
105
+ Note that you can bypass the previous installation step and just add uvx before each of the commands below.
106
+
93
107
  ### Convert PDFs
94
108
 
95
109
  With a general VLM (requires setting your api key as an environment variable):
@@ -3,11 +3,8 @@ README.md
3
3
  pyproject.toml
4
4
  tests/test_all_converters_mocked.py
5
5
  tests/test_batch_parser.py
6
- tests/test_benchmark_tests.py
7
6
  tests/test_cli.py
8
7
  tests/test_end2end.py
9
- tests/test_process_and_run_benchmark.py
10
- tests/test_table_tests.py
11
8
  vlmparse/base_model.py
12
9
  vlmparse/build_doc.py
13
10
  vlmparse/cli.py
@@ -22,21 +19,6 @@ vlmparse.egg-info/dependency_links.txt
22
19
  vlmparse.egg-info/entry_points.txt
23
20
  vlmparse.egg-info/requires.txt
24
21
  vlmparse.egg-info/top_level.txt
25
- vlmparse/benchpdf2md/create_dataset.py
26
- vlmparse/benchpdf2md/run_benchmark.py
27
- vlmparse/benchpdf2md/utils.py
28
- vlmparse/benchpdf2md/bench_tests/benchmark_tsts.py
29
- vlmparse/benchpdf2md/bench_tests/utils.py
30
- vlmparse/benchpdf2md/olmocrbench/repeatdetect.py
31
- vlmparse/benchpdf2md/olmocrbench/run_olmocr_bench.py
32
- vlmparse/benchpdf2md/olmocrbench/tests.py
33
- vlmparse/benchpdf2md/olmocrbench/katex/__init__.py
34
- vlmparse/benchpdf2md/olmocrbench/katex/render.py
35
- vlmparse/benchpdf2md/st_visu_benchmark/app.py
36
- vlmparse/benchpdf2md/st_visu_benchmark/highligh_text.py
37
- vlmparse/benchpdf2md/st_visu_benchmark/test_form.py
38
- vlmparse/benchpdf2md/st_visu_benchmark/ui_elements.py
39
- vlmparse/benchpdf2md/st_visu_benchmark/utils.py
40
22
  vlmparse/clients/chandra.py
41
23
  vlmparse/clients/deepseekocr.py
42
24
  vlmparse/clients/docling.py