llms-py 2.0.14__py3-none-any.whl → 2.0.15__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 (49) hide show
  1. llms/__init__.py +2 -0
  2. llms/__main__.py +9 -0
  3. llms/__pycache__/__init__.cpython-312.pyc +0 -0
  4. llms/__pycache__/__main__.cpython-312.pyc +0 -0
  5. llms/__pycache__/llms.cpython-312.pyc +0 -0
  6. llms/__pycache__/main.cpython-312.pyc +0 -0
  7. llms.py → llms/main.py +50 -4
  8. {llms_py-2.0.14.data/data → llms}/ui/ai.mjs +1 -1
  9. llms/ui/lib/vue.mjs +18369 -0
  10. {llms_py-2.0.14.dist-info → llms_py-2.0.15.dist-info}/METADATA +1 -1
  11. llms_py-2.0.15.dist-info/RECORD +46 -0
  12. llms_py-2.0.15.dist-info/entry_points.txt +2 -0
  13. llms_py-2.0.14.data/data/requirements.txt +0 -1
  14. llms_py-2.0.14.dist-info/RECORD +0 -40
  15. llms_py-2.0.14.dist-info/entry_points.txt +0 -2
  16. {llms_py-2.0.14.data/data → llms}/index.html +0 -0
  17. {llms_py-2.0.14.data/data → llms}/llms.json +0 -0
  18. {llms_py-2.0.14.data/data → llms}/ui/App.mjs +0 -0
  19. {llms_py-2.0.14.data/data → llms}/ui/Avatar.mjs +0 -0
  20. {llms_py-2.0.14.data/data → llms}/ui/Brand.mjs +0 -0
  21. {llms_py-2.0.14.data/data → llms}/ui/ChatPrompt.mjs +0 -0
  22. {llms_py-2.0.14.data/data → llms}/ui/Main.mjs +0 -0
  23. {llms_py-2.0.14.data/data → llms}/ui/ModelSelector.mjs +0 -0
  24. {llms_py-2.0.14.data/data → llms}/ui/ProviderStatus.mjs +0 -0
  25. {llms_py-2.0.14.data/data → llms}/ui/Recents.mjs +0 -0
  26. {llms_py-2.0.14.data/data → llms}/ui/SettingsDialog.mjs +0 -0
  27. {llms_py-2.0.14.data/data → llms}/ui/Sidebar.mjs +0 -0
  28. {llms_py-2.0.14.data/data → llms}/ui/SignIn.mjs +0 -0
  29. {llms_py-2.0.14.data/data → llms}/ui/SystemPromptEditor.mjs +0 -0
  30. {llms_py-2.0.14.data/data → llms}/ui/SystemPromptSelector.mjs +0 -0
  31. {llms_py-2.0.14.data/data → llms}/ui/Welcome.mjs +0 -0
  32. {llms_py-2.0.14.data/data → llms}/ui/app.css +0 -0
  33. {llms_py-2.0.14.data/data → llms}/ui/fav.svg +0 -0
  34. {llms_py-2.0.14.data/data → llms}/ui/lib/highlight.min.mjs +0 -0
  35. {llms_py-2.0.14.data/data → llms}/ui/lib/idb.min.mjs +0 -0
  36. {llms_py-2.0.14.data/data → llms}/ui/lib/marked.min.mjs +0 -0
  37. {llms_py-2.0.14.data/data → llms}/ui/lib/servicestack-client.mjs +0 -0
  38. {llms_py-2.0.14.data/data → llms}/ui/lib/servicestack-vue.mjs +0 -0
  39. {llms_py-2.0.14.data/data → llms}/ui/lib/vue-router.min.mjs +0 -0
  40. {llms_py-2.0.14.data/data → llms}/ui/lib/vue.min.mjs +0 -0
  41. {llms_py-2.0.14.data/data → llms}/ui/markdown.mjs +0 -0
  42. {llms_py-2.0.14.data/data → llms}/ui/tailwind.input.css +0 -0
  43. {llms_py-2.0.14.data/data → llms}/ui/threadStore.mjs +0 -0
  44. {llms_py-2.0.14.data/data → llms}/ui/typography.css +0 -0
  45. {llms_py-2.0.14.data/data → llms}/ui/utils.mjs +0 -0
  46. {llms_py-2.0.14.data/data → llms}/ui.json +0 -0
  47. {llms_py-2.0.14.dist-info → llms_py-2.0.15.dist-info}/WHEEL +0 -0
  48. {llms_py-2.0.14.dist-info → llms_py-2.0.15.dist-info}/licenses/LICENSE +0 -0
  49. {llms_py-2.0.14.dist-info → llms_py-2.0.15.dist-info}/top_level.txt +0 -0
llms/__init__.py ADDED
@@ -0,0 +1,2 @@
1
+ # Import the main module content
2
+ from .main import *
llms/__main__.py ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Entry point for running llms as a module: python -m llms
4
+ """
5
+
6
+ from .main import main
7
+
8
+ if __name__ == "__main__":
9
+ main()
Binary file
Binary file
llms.py → llms/main.py RENAMED
@@ -22,7 +22,7 @@ from aiohttp import web
22
22
  from pathlib import Path
23
23
  from importlib import resources # Py≥3.9 (pip install importlib_resources for 3.7/3.8)
24
24
 
25
- VERSION = "2.0.14"
25
+ VERSION = "2.0.15"
26
26
  _ROOT = None
27
27
  g_config_path = None
28
28
  g_ui_path = None
@@ -947,6 +947,36 @@ def resolve_root():
947
947
  # importlib.resources not available (Python < 3.9)
948
948
  pass
949
949
 
950
+ # Method 1b: Look for the installed package and check for UI files
951
+ try:
952
+ import llms
953
+ # If llms is a package, check its directory
954
+ if hasattr(llms, '__path__'):
955
+ # It's a package
956
+ package_path = Path(llms.__path__[0])
957
+
958
+ # Check if UI files are in the package directory
959
+ if (package_path / "index.html").exists() and (package_path / "ui").is_dir():
960
+ _log(f"RESOURCE ROOT (package directory): {package_path}")
961
+ return package_path
962
+ else:
963
+ # It's a module
964
+ module_path = Path(llms.__file__).resolve().parent
965
+
966
+ # Check if UI files are in the same directory as the module
967
+ if (module_path / "index.html").exists() and (module_path / "ui").is_dir():
968
+ _log(f"RESOURCE ROOT (module directory): {module_path}")
969
+ return module_path
970
+
971
+ # Check parent directory (sometimes data files are installed one level up)
972
+ parent_path = module_path.parent
973
+ if (parent_path / "index.html").exists() and (parent_path / "ui").is_dir():
974
+ _log(f"RESOURCE ROOT (module parent): {parent_path}")
975
+ return parent_path
976
+
977
+ except (ImportError, AttributeError):
978
+ pass
979
+
950
980
  # Method 2: Try to find data files in sys.prefix (where data_files are installed)
951
981
  # Get all possible installation directories
952
982
  possible_roots = [
@@ -976,6 +1006,22 @@ def resolve_root():
976
1006
  except AttributeError:
977
1007
  pass
978
1008
 
1009
+ # Method 2b: Look for data files in common macOS Homebrew locations
1010
+ # Homebrew often installs data files in different locations
1011
+ homebrew_roots = []
1012
+ if sys.platform == "darwin": # macOS
1013
+ homebrew_prefixes = ["/opt/homebrew", "/usr/local"] # Apple Silicon and Intel
1014
+ for prefix in homebrew_prefixes:
1015
+ if Path(prefix).exists():
1016
+ homebrew_roots.extend([
1017
+ Path(prefix),
1018
+ Path(prefix) / "share",
1019
+ Path(prefix) / "lib" / "python3.11" / "site-packages",
1020
+ Path(prefix) / "lib" / f"python{sys.version_info.major}.{sys.version_info.minor}" / "site-packages",
1021
+ ])
1022
+
1023
+ possible_roots.extend(homebrew_roots)
1024
+
979
1025
  for root in possible_roots:
980
1026
  try:
981
1027
  if root.exists() and (root / "index.html").exists() and (root / "ui").is_dir():
@@ -1118,12 +1164,12 @@ def main():
1118
1164
  if resource_exists(resource_config_path):
1119
1165
  try:
1120
1166
  # Read config from resource (handle both Path and Traversable objects)
1121
- config_json = read_resource_text(resource_ui_path)
1167
+ config_json = read_resource_text(resource_config_path)
1122
1168
  except (OSError, AttributeError) as e:
1123
1169
  _log(f"Error reading resource config: {e}")
1124
1170
  if not config_json:
1125
1171
  try:
1126
- config_json = asyncio.run(save_text(github_url("llms.json"), home_ui_path))
1172
+ config_json = asyncio.run(save_text(github_url("llms.json"), home_config_path))
1127
1173
  except Exception as e:
1128
1174
  _log(f"Error downloading llms.json: {e}")
1129
1175
  print("Could not create llms.json. Create one with --init or use --config <path>")
@@ -1436,5 +1482,5 @@ def main():
1436
1482
  parser.print_help()
1437
1483
 
1438
1484
 
1439
- if __name__ == "__main__":
1485
+ if __name__ == "__main__":
1440
1486
  main()
@@ -6,7 +6,7 @@ const headers = { 'Accept': 'application/json' }
6
6
  const prefsKey = 'llms.prefs'
7
7
 
8
8
  export const o = {
9
- version: '2.0.14',
9
+ version: '2.0.15',
10
10
  base,
11
11
  prefsKey,
12
12
  welcome: 'Welcome to llms.py',