mlx-stack 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.
Files changed (61) hide show
  1. mlx_stack/__init__.py +5 -0
  2. mlx_stack/_version.py +24 -0
  3. mlx_stack/cli/__init__.py +5 -0
  4. mlx_stack/cli/bench.py +221 -0
  5. mlx_stack/cli/config.py +166 -0
  6. mlx_stack/cli/down.py +109 -0
  7. mlx_stack/cli/init.py +180 -0
  8. mlx_stack/cli/install.py +165 -0
  9. mlx_stack/cli/logs.py +234 -0
  10. mlx_stack/cli/main.py +187 -0
  11. mlx_stack/cli/models.py +304 -0
  12. mlx_stack/cli/profile.py +65 -0
  13. mlx_stack/cli/pull.py +134 -0
  14. mlx_stack/cli/recommend.py +397 -0
  15. mlx_stack/cli/status.py +111 -0
  16. mlx_stack/cli/up.py +163 -0
  17. mlx_stack/cli/watch.py +252 -0
  18. mlx_stack/core/__init__.py +1 -0
  19. mlx_stack/core/benchmark.py +1182 -0
  20. mlx_stack/core/catalog.py +560 -0
  21. mlx_stack/core/config.py +471 -0
  22. mlx_stack/core/deps.py +323 -0
  23. mlx_stack/core/hardware.py +304 -0
  24. mlx_stack/core/launchd.py +531 -0
  25. mlx_stack/core/litellm_gen.py +188 -0
  26. mlx_stack/core/log_rotation.py +231 -0
  27. mlx_stack/core/log_viewer.py +386 -0
  28. mlx_stack/core/models.py +639 -0
  29. mlx_stack/core/paths.py +79 -0
  30. mlx_stack/core/process.py +887 -0
  31. mlx_stack/core/pull.py +815 -0
  32. mlx_stack/core/scoring.py +611 -0
  33. mlx_stack/core/stack_down.py +317 -0
  34. mlx_stack/core/stack_init.py +524 -0
  35. mlx_stack/core/stack_status.py +229 -0
  36. mlx_stack/core/stack_up.py +856 -0
  37. mlx_stack/core/watchdog.py +744 -0
  38. mlx_stack/data/__init__.py +1 -0
  39. mlx_stack/data/catalog/__init__.py +1 -0
  40. mlx_stack/data/catalog/deepseek-r1-32b.yaml +46 -0
  41. mlx_stack/data/catalog/deepseek-r1-8b.yaml +45 -0
  42. mlx_stack/data/catalog/gemma3-12b.yaml +45 -0
  43. mlx_stack/data/catalog/gemma3-27b.yaml +45 -0
  44. mlx_stack/data/catalog/gemma3-4b.yaml +45 -0
  45. mlx_stack/data/catalog/llama3.3-8b.yaml +44 -0
  46. mlx_stack/data/catalog/nemotron-49b.yaml +41 -0
  47. mlx_stack/data/catalog/nemotron-8b.yaml +44 -0
  48. mlx_stack/data/catalog/qwen3-8b.yaml +45 -0
  49. mlx_stack/data/catalog/qwen3.5-0.8b.yaml +45 -0
  50. mlx_stack/data/catalog/qwen3.5-14b.yaml +46 -0
  51. mlx_stack/data/catalog/qwen3.5-32b.yaml +45 -0
  52. mlx_stack/data/catalog/qwen3.5-3b.yaml +44 -0
  53. mlx_stack/data/catalog/qwen3.5-72b.yaml +42 -0
  54. mlx_stack/data/catalog/qwen3.5-8b.yaml +45 -0
  55. mlx_stack/py.typed +1 -0
  56. mlx_stack/utils/__init__.py +1 -0
  57. mlx_stack-0.1.0.dist-info/METADATA +397 -0
  58. mlx_stack-0.1.0.dist-info/RECORD +61 -0
  59. mlx_stack-0.1.0.dist-info/WHEEL +4 -0
  60. mlx_stack-0.1.0.dist-info/entry_points.txt +2 -0
  61. mlx_stack-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,79 @@
1
+ """Path management for mlx-stack data directory.
2
+
3
+ Handles auto-creation of the ~/.mlx-stack/ data directory and provides
4
+ canonical paths for all data files used by the application.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import os
10
+ from pathlib import Path
11
+
12
+
13
+ def get_data_home() -> Path:
14
+ """Return the mlx-stack data directory path.
15
+
16
+ Uses the MLX_STACK_HOME environment variable if set (for testing),
17
+ otherwise defaults to ~/.mlx-stack/.
18
+
19
+ Returns:
20
+ Path to the mlx-stack data directory.
21
+ """
22
+ env_home = os.environ.get("MLX_STACK_HOME")
23
+ if env_home:
24
+ return Path(env_home)
25
+ return Path.home() / ".mlx-stack"
26
+
27
+
28
+ def ensure_data_home() -> Path:
29
+ """Ensure the mlx-stack data directory exists and return its path.
30
+
31
+ Creates the directory with standard user permissions (0o755) if it
32
+ does not already exist. Also creates standard subdirectories.
33
+
34
+ Returns:
35
+ Path to the mlx-stack data directory.
36
+ """
37
+ data_home = get_data_home()
38
+ data_home.mkdir(parents=True, exist_ok=True)
39
+ return data_home
40
+
41
+
42
+ def get_profile_path() -> Path:
43
+ """Return the path to the hardware profile JSON file."""
44
+ return get_data_home() / "profile.json"
45
+
46
+
47
+ def get_config_path() -> Path:
48
+ """Return the path to the user config YAML file."""
49
+ return get_data_home() / "config.yaml"
50
+
51
+
52
+ def get_stacks_dir() -> Path:
53
+ """Return the path to the stacks directory."""
54
+ return get_data_home() / "stacks"
55
+
56
+
57
+ def get_models_dir() -> Path:
58
+ """Return the default models directory path."""
59
+ return get_data_home() / "models"
60
+
61
+
62
+ def get_logs_dir() -> Path:
63
+ """Return the path to the logs directory."""
64
+ return get_data_home() / "logs"
65
+
66
+
67
+ def get_pids_dir() -> Path:
68
+ """Return the path to the PID files directory."""
69
+ return get_data_home() / "pids"
70
+
71
+
72
+ def get_benchmarks_dir() -> Path:
73
+ """Return the path to the benchmarks directory."""
74
+ return get_data_home() / "benchmarks"
75
+
76
+
77
+ def get_lock_path() -> Path:
78
+ """Return the path to the lockfile."""
79
+ return get_data_home() / "lock"