shard-engine 1.8.1__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.
Files changed (42) hide show
  1. shard_engine/__init__.py +3 -0
  2. shard_engine/__main__.py +3 -0
  3. shard_engine/cache_index.py +37 -0
  4. shard_engine/cli.py +1994 -0
  5. shard_engine/constants.py +23 -0
  6. shard_engine/dashboard.html +4993 -0
  7. shard_engine/engine.py +1518 -0
  8. shard_engine/engine_optimizations.json +428 -0
  9. shard_engine/feedback.py +942 -0
  10. shard_engine/fit.py +289 -0
  11. shard_engine/formatters.py +30 -0
  12. shard_engine/gguf_backend.py +769 -0
  13. shard_engine/hardware.py +165 -0
  14. shard_engine/hf_hub.py +290 -0
  15. shard_engine/lan.py +1613 -0
  16. shard_engine/main.py +32 -0
  17. shard_engine/model_browser.py +687 -0
  18. shard_engine/net_discovery.py +1145 -0
  19. shard_engine/net_identity.py +1072 -0
  20. shard_engine/net_platform_linux.py +910 -0
  21. shard_engine/net_platform_win.py +930 -0
  22. shard_engine/net_strategy.py +2169 -0
  23. shard_engine/net_tunnel.py +2234 -0
  24. shard_engine/net_wireguard.py +780 -0
  25. shard_engine/paths.py +173 -0
  26. shard_engine/process.py +231 -0
  27. shard_engine/server.py +2652 -0
  28. shard_engine/session_registry.py +105 -0
  29. shard_engine/settings.py +142 -0
  30. shard_engine/shard_bridge.py +289 -0
  31. shard_engine/soup_adapter.py +1202 -0
  32. shard_engine/storage.py +457 -0
  33. shard_engine/telemetry.py +43 -0
  34. shard_engine/training.py +1137 -0
  35. shard_engine/updater.py +861 -0
  36. shard_engine/validators.py +16 -0
  37. shard_engine-1.8.1.dist-info/METADATA +549 -0
  38. shard_engine-1.8.1.dist-info/RECORD +42 -0
  39. shard_engine-1.8.1.dist-info/WHEEL +5 -0
  40. shard_engine-1.8.1.dist-info/entry_points.txt +2 -0
  41. shard_engine-1.8.1.dist-info/licenses/LICENSE +17 -0
  42. shard_engine-1.8.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,3 @@
1
+ __version__ = "1.8.1"
2
+ __app_name__ = "shard-engine"
3
+ __all__ = ["__version__", "__app_name__"]
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+ if __name__ == "__main__":
3
+ main()
@@ -0,0 +1,37 @@
1
+ import os
2
+ from typing import Dict, List, Optional
3
+ class LocalCacheEntry:
4
+ def __init__(self, model_id: str, local_path: str, file_size: int, mtime: float):
5
+ self.model_id = model_id
6
+ self.local_path = local_path
7
+ self.file_size = file_size
8
+ self.mtime = mtime
9
+ class LocalCacheIndex:
10
+ def __init__(self, root_dirs: Optional[List[str]] = None):
11
+ self.root_dirs = root_dirs or []
12
+ self._entries: Dict[str, LocalCacheEntry] = {}
13
+ def scan(self) -> Dict[str, LocalCacheEntry]:
14
+ self._entries.clear()
15
+ for root in self.root_dirs:
16
+ if not os.path.isdir(root):
17
+ continue
18
+ for r, _, files in os.walk(root):
19
+ for f in files:
20
+ if f.lower().endswith((".gguf", ".safetensors", ".bin")):
21
+ p = os.path.join(r, f)
22
+ try:
23
+ st = os.stat(p)
24
+ if st.st_size > 0:
25
+ entry = LocalCacheEntry(model_id=f, local_path=p, file_size=st.st_size, mtime=st.st_mtime)
26
+ self._entries[f] = entry
27
+ except OSError:
28
+ continue
29
+ return self._entries
30
+ def get_entry(self, identifier: str) -> Optional[LocalCacheEntry]:
31
+ return self._entries.get(identifier)
32
+ def has_weights(self, identifier: str) -> bool:
33
+ entry = self.get_entry(identifier)
34
+ return entry is not None and entry.file_size > 0 and os.path.exists(entry.local_path)
35
+ def invalidate(self):
36
+ self._entries.clear()
37
+ __all__ = ["LocalCacheEntry", "LocalCacheIndex"]