mdify-cli 2.11.8__tar.gz → 2.11.9__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mdify-cli
3
- Version: 2.11.8
3
+ Version: 2.11.9
4
4
  Summary: Convert PDFs and document images into structured Markdown for LLM workflows
5
5
  Author: tiroq
6
6
  License-Expression: MIT
@@ -1,3 +1,3 @@
1
1
  """mdify - Convert documents to Markdown via Docling container."""
2
2
 
3
- __version__ = "2.11.8"
3
+ __version__ = "2.11.9"
@@ -116,11 +116,17 @@ def parse_memory_string(mem_str: str) -> float:
116
116
  raise ValueError(f"Invalid memory format: {mem_str}")
117
117
 
118
118
 
119
- def validate_memory_availability(required_gb: float) -> tuple[bool, str]:
119
+ def validate_memory_availability(
120
+ required_gb: float,
121
+ profile_name: str = "default",
122
+ suggest_profile: Optional[str] = None,
123
+ ) -> tuple[bool, str]:
120
124
  """Check if system has sufficient available memory.
121
125
 
122
126
  Args:
123
127
  required_gb: Required memory in GB
128
+ profile_name: Name of current profile being used
129
+ suggest_profile: Name of smaller profile to suggest (auto-detected if None)
124
130
 
125
131
  Returns:
126
132
  Tuple of (is_sufficient, error_message)
@@ -132,13 +138,39 @@ def validate_memory_availability(required_gb: float) -> tuple[bool, str]:
132
138
  return True, ""
133
139
 
134
140
  if available_gb < required_gb:
141
+ # Determine which smaller profile to suggest
142
+ if suggest_profile is None:
143
+ if profile_name == "heavy":
144
+ suggest_profile = "default"
145
+ elif profile_name == "default":
146
+ suggest_profile = "minimal"
147
+ else:
148
+ suggest_profile = None # Already on minimal
149
+
135
150
  error = (
136
151
  f"Insufficient memory available for container startup.\n"
152
+ f" Current profile: {profile_name}\n"
137
153
  f" Required: {required_gb:.1f} GB\n"
138
154
  f" Available: {available_gb:.1f} GB\n"
139
155
  f" Short by: {required_gb - available_gb:.1f} GB\n\n"
140
- f"Please close other applications or use a smaller profile (--profile minimal)"
141
156
  )
157
+
158
+ if suggest_profile:
159
+ suggested = RESOURCE_PROFILES[suggest_profile]
160
+ error += (
161
+ f"Suggested solutions:\n"
162
+ f" 1. Close other applications to free up memory\n"
163
+ f" 2. Use a smaller profile: --profile {suggest_profile} "
164
+ f"({suggested['cpus']} CPUs, {suggested['memory']} memory)\n"
165
+ f" 3. Skip memory check: --skip-memory-check (not recommended)"
166
+ )
167
+ else:
168
+ error += (
169
+ f"Suggested solutions:\n"
170
+ f" 1. Close other applications to free up memory\n"
171
+ f" 2. Skip memory check: --skip-memory-check (not recommended)"
172
+ )
173
+
142
174
  return False, error
143
175
 
144
176
  return True, ""
@@ -1082,7 +1114,7 @@ def main() -> int:
1082
1114
 
1083
1115
  try:
1084
1116
  if not args.quiet:
1085
- print(f"Starting docling-serve container...\\n")
1117
+ print(f"Starting docling-serve container...\n")
1086
1118
 
1087
1119
  # Apply resource profile
1088
1120
  profile = RESOURCE_PROFILES[args.profile]
@@ -1092,7 +1124,9 @@ def main() -> int:
1092
1124
  # Validate memory availability unless skipped
1093
1125
  if not args.skip_memory_check:
1094
1126
  required_gb = parse_memory_string(memory)
1095
- is_sufficient, error_msg = validate_memory_availability(required_gb)
1127
+ is_sufficient, error_msg = validate_memory_availability(
1128
+ required_gb, profile_name=args.profile
1129
+ )
1096
1130
  if not is_sufficient:
1097
1131
  print(f"Error: {error_msg}", file=sys.stderr)
1098
1132
  return 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mdify-cli
3
- Version: 2.11.8
3
+ Version: 2.11.9
4
4
  Summary: Convert PDFs and document images into structured Markdown for LLM workflows
5
5
  Author: tiroq
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mdify-cli"
3
- version = "2.11.8"
3
+ version = "2.11.9"
4
4
  description = "Convert PDFs and document images into structured Markdown for LLM workflows"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes