premobit 0.1.0__py3-none-any.whl

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.
premobit/__init__.py ADDED
@@ -0,0 +1,4 @@
1
+ # Copyright (c) 2026 DataExis LLC. All Rights Reserved.
2
+ # PremoBit™ is a trademark of DataExis LLC.
3
+ __version__ = "0.1.0"
4
+ __copyright__ = "Copyright (c) 2026 DataExis LLC. All Rights Reserved."
premobit/cli.py ADDED
@@ -0,0 +1,82 @@
1
+ # ==============================================================================
2
+ # Copyright (c) 2026 DataExis LLC. All Rights Reserved.
3
+ # PremoBit™ is a trademark of DataExis LLC.
4
+ # PROPRIETARY SOFTWARE — https://premobit.com
5
+ # ==============================================================================
6
+
7
+ import argparse
8
+ import json
9
+ import os
10
+ import socket
11
+ import struct
12
+ import sys
13
+ from pathlib import Path
14
+ from premobit import __version__, __copyright__
15
+
16
+ PORTS = {13305: "Lemonade Server", 1234: "LM Studio", 11434: "Local Runtime (11434)", 8188: "ComfyUI"}
17
+
18
+
19
+ def cmd_doctor() -> int:
20
+ print(f"PremoBit™ CLI v{__version__} | {__copyright__}")
21
+ print(f"HF_HOME: {os.environ.get('HF_HOME') or 'unset (defaults to user profile)'}")
22
+ for port, name in PORTS.items():
23
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
24
+ s.settimeout(0.25)
25
+ status = "LISTENING" if s.connect_ex(("127.0.0.1", port)) == 0 else "closed"
26
+ print(f" 127.0.0.1:{port:<5} ({name}): {status}")
27
+ print("Full 6-Pillar desktop suite & web scanner: https://premobit.com")
28
+ return 0
29
+
30
+
31
+ def cmd_verify(file_path: str) -> int:
32
+ p = Path(file_path)
33
+ if not p.is_file():
34
+ print(f"[ERROR] File not found: {p}")
35
+ return 1
36
+ size = p.stat().st_size
37
+ ext = p.suffix.lower()
38
+ if ext == ".safetensors":
39
+ if size < 16:
40
+ print(f"[FAIL] Truncated .safetensors file ({size} bytes)")
41
+ return 2
42
+ with p.open("rb") as f:
43
+ hlen = struct.unpack("<Q", f.read(8))[0]
44
+ if hlen == 0 or hlen > size - 8 or hlen > 256 * 1024 * 1024:
45
+ print(f"[FAIL] Corrupt header length: {hlen} bytes")
46
+ return 2
47
+ header = json.loads(f.read(hlen).decode("utf-8"))
48
+ max_end = max((m.get("data_offsets", [0, 0])[1] for k, m in header.items() if k != "__metadata__"), default=0)
49
+ expected = 8 + hlen + max_end
50
+ if size != expected:
51
+ print(f"[FAIL] Byte mismatch: expected {expected:,} B, actual {size:,} B")
52
+ return 2
53
+ print(f"[PASS] Verified .safetensors ({len(header)} entries, {size:,} bytes) — PremoBit™")
54
+ return 0
55
+ if ext == ".gguf":
56
+ with p.open("rb") as f:
57
+ magic = f.read(4)
58
+ if magic != b"GGUF":
59
+ print(f"[FAIL] Invalid GGUF magic header: {magic!r}")
60
+ return 2
61
+ ver = struct.unpack("<I", f.read(4))[0]
62
+ print(f"[PASS] Verified GGUF v{ver} ({size:,} bytes) — PremoBit™")
63
+ return 0
64
+ print(f"[INFO] Unsupported extension '{ext}' in lightweight CLI. Use PremoBit™ Desktop for full 6-Pillar scans.")
65
+ return 0
66
+
67
+
68
+ def main() -> None:
69
+ parser = argparse.ArgumentParser(prog="premobit", description=f"PremoBit™ CLI v{__version__} ({__copyright__})")
70
+ parser.add_argument("-V", "--version", action="version", version=f"PremoBit™ CLI v{__version__} | {__copyright__}")
71
+ sub = parser.add_subparsers(dest="command")
72
+ sub.add_parser("doctor", help="Check local runtime ports and HF_HOME path hygiene")
73
+ v = sub.add_parser("verify", help="Verify .safetensors or .gguf binary header integrity")
74
+ v.add_argument("path", help="Path to local model file")
75
+
76
+ args = parser.parse_args()
77
+ if args.command == "doctor":
78
+ sys.exit(cmd_doctor())
79
+ elif args.command == "verify":
80
+ sys.exit(cmd_verify(args.path))
81
+ else:
82
+ parser.print_help()
@@ -0,0 +1,32 @@
1
+ Metadata-Version: 2.4
2
+ Name: premobit
3
+ Version: 0.1.0
4
+ Summary: PremoBit™ — Official deterministic AI header verification & runtime hygiene CLI by DataExis LLC.
5
+ Author-email: DataExis LLC <devops@premobit.com>
6
+ License-Expression: LicenseRef-Proprietary
7
+ Project-URL: Homepage, https://premobit.com
8
+ Keywords: premobit,security,safetensors,gguf,deterministic,verification
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Topic :: Security
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE.txt
18
+ Dynamic: license-file
19
+
20
+ # PremoBit™ Official CLI
21
+
22
+ **Copyright (c) 2026 DataExis LLC. All Rights Reserved.**
23
+ PremoBit™ is a trademark of DataExis LLC.
24
+
25
+ Official lightweight CLI companion for **PremoBit™** deterministic model header verification and local runtime hygiene.
26
+
27
+ ## Commands
28
+ - `premobit --version` — Display official PremoBit™ build and copyright notice.
29
+ - `premobit doctor` — Check local inference endpoints and `HF_HOME` cache path configuration.
30
+ - `premobit verify <path>` — Run zero-load byte-offset verification on `.safetensors` or `.gguf` headers.
31
+
32
+ For the full 6-Pillar Windows Desktop Suite (`PremoBit.exe`) and client-side web scanner, visit **https://premobit.com**.
@@ -0,0 +1,8 @@
1
+ premobit/__init__.py,sha256=NRhcojev6fNaUi2pQQpRBnqCQmSo9ovh_G6ucVECSZA,195
2
+ premobit/cli.py,sha256=oPr4IfOwEgoi-pbhcq7m65R1HXN0B1-Ki6cq6XtR630,3456
3
+ premobit-0.1.0.dist-info/licenses/LICENSE.txt,sha256=AS-Yr8Y4bnvFUtAq88OF7osd1lQpMV9xOM0AwbPWN9U,496
4
+ premobit-0.1.0.dist-info/METADATA,sha256=CrdrjfWf2iM68uPGYwsNix_h2YNU8VgmFoGH7-tuCao,1441
5
+ premobit-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
6
+ premobit-0.1.0.dist-info/entry_points.txt,sha256=D7khCbMLKFU3nrUkggZUmktxePw6DrQ7YXt1HW9wsQw,47
7
+ premobit-0.1.0.dist-info/top_level.txt,sha256=E2ehq1PgjRcvQ-Ladp1r1yLerBxu1fbolj4Mh3TZ6fY,9
8
+ premobit-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ premobit = premobit.cli:main
@@ -0,0 +1,10 @@
1
+ Copyright (c) 2026 DataExis LLC. All Rights Reserved.
2
+ PremoBit™ is a trademark of DataExis LLC.
3
+
4
+ PROPRIETARY SOFTWARE LICENSE
5
+ Permission is granted solely to install and execute this official PremoBit™ CLI
6
+ utility for personal or internal evaluation. Unauthorized modification,
7
+ redistribution, rebranding, or commercial resale is strictly prohibited without
8
+ express written permission from DataExis LLC (https://premobit.com).
9
+
10
+ THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
@@ -0,0 +1 @@
1
+ premobit