cortex-llm 1.0.3__py3-none-any.whl → 1.0.4__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.
- cortex/__init__.py +1 -1
- cortex/__main__.py +6 -5
- cortex/metal/mlx_compat.py +15 -0
- {cortex_llm-1.0.3.dist-info → cortex_llm-1.0.4.dist-info}/METADATA +1 -1
- {cortex_llm-1.0.3.dist-info → cortex_llm-1.0.4.dist-info}/RECORD +9 -9
- {cortex_llm-1.0.3.dist-info → cortex_llm-1.0.4.dist-info}/WHEEL +0 -0
- {cortex_llm-1.0.3.dist-info → cortex_llm-1.0.4.dist-info}/entry_points.txt +0 -0
- {cortex_llm-1.0.3.dist-info → cortex_llm-1.0.4.dist-info}/licenses/LICENSE +0 -0
- {cortex_llm-1.0.3.dist-info → cortex_llm-1.0.4.dist-info}/top_level.txt +0 -0
cortex/__init__.py
CHANGED
|
@@ -5,7 +5,7 @@ A high-performance terminal interface for running Hugging Face LLMs locally
|
|
|
5
5
|
with exclusive GPU acceleration via Metal Performance Shaders (MPS) and MLX.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "1.0.
|
|
8
|
+
__version__ = "1.0.4"
|
|
9
9
|
__author__ = "Cortex Development Team"
|
|
10
10
|
__license__ = "MIT"
|
|
11
11
|
|
cortex/__main__.py
CHANGED
|
@@ -9,11 +9,12 @@ import warnings
|
|
|
9
9
|
# This prevents the semaphore leak warning from transformers library
|
|
10
10
|
os.environ['PYTHONWARNINGS'] = 'ignore::UserWarning:multiprocessing.resource_tracker'
|
|
11
11
|
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
# Apply MLX compatibility shims before any MLX/MLX-LM imports.
|
|
13
|
+
try:
|
|
14
|
+
from cortex.metal.mlx_compat import patch_mlx_lm_device_info
|
|
15
|
+
patch_mlx_lm_device_info()
|
|
16
|
+
except Exception:
|
|
17
|
+
pass
|
|
17
18
|
|
|
18
19
|
# Alternative: Monkey-patch the resource tracker before it's used
|
|
19
20
|
try:
|
cortex/metal/mlx_compat.py
CHANGED
|
@@ -12,6 +12,19 @@ def _get_device_info(mx) -> dict:
|
|
|
12
12
|
except Exception:
|
|
13
13
|
return {}
|
|
14
14
|
|
|
15
|
+
def patch_mlx_device_info() -> None:
|
|
16
|
+
"""Redirect deprecated mx.metal.device_info to mx.device_info when possible."""
|
|
17
|
+
try:
|
|
18
|
+
import mlx.core as mx
|
|
19
|
+
except Exception:
|
|
20
|
+
return
|
|
21
|
+
|
|
22
|
+
if hasattr(mx, "device_info") and hasattr(mx, "metal") and hasattr(mx.metal, "device_info"):
|
|
23
|
+
try:
|
|
24
|
+
mx.metal.device_info = mx.device_info # type: ignore[attr-defined]
|
|
25
|
+
except Exception:
|
|
26
|
+
pass
|
|
27
|
+
|
|
15
28
|
|
|
16
29
|
def patch_mlx_lm_device_info() -> None:
|
|
17
30
|
"""Patch mlx_lm call sites to use mx.device_info() instead of mx.metal.device_info()."""
|
|
@@ -24,6 +37,8 @@ def patch_mlx_lm_device_info() -> None:
|
|
|
24
37
|
if not hasattr(mx, "device_info"):
|
|
25
38
|
return
|
|
26
39
|
|
|
40
|
+
patch_mlx_device_info()
|
|
41
|
+
|
|
27
42
|
try:
|
|
28
43
|
import mlx_lm.generate as mlx_generate
|
|
29
44
|
except Exception:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
cortex/__init__.py,sha256=
|
|
2
|
-
cortex/__main__.py,sha256=
|
|
1
|
+
cortex/__init__.py,sha256=6KYzL3KARjSGTCZnrmxFxVlfuMUFtIwCL4cK2ekXOAs,2202
|
|
2
|
+
cortex/__main__.py,sha256=I7Njt7BjGoHtPhftDoA44OyOYbwWNNaPwP_qlJSn0J4,2857
|
|
3
3
|
cortex/config.py,sha256=txmpJXy3kUEKULZyu1OWb_jkNQRHZClm5ovZfCTX_Zc,13444
|
|
4
4
|
cortex/conversation_manager.py,sha256=aSTdGjVttsMKIiRPzztP0tOXlqZBkWtgZDNCZGyaR-c,17177
|
|
5
5
|
cortex/gpu_validator.py,sha256=un6vMQ78MWMnKWIz8n-92v9Fb4g_YXqU_E1pUPinncY,16582
|
|
@@ -15,7 +15,7 @@ cortex/metal/__init__.py,sha256=Ycs81qVOsaYV4UJocCFGW3rPPBySMPy7eOHKzfc4Q7o,8780
|
|
|
15
15
|
cortex/metal/gpu_validator.py,sha256=1YHKJXqicXvTwKIdSj34n1DgKoluy9yho6S1jWt1UAs,5818
|
|
16
16
|
cortex/metal/memory_pool.py,sha256=g5PFQAiouQe4TyX-SVi-Di1MLysb3YBF77uR4nAEomo,34698
|
|
17
17
|
cortex/metal/mlx_accelerator.py,sha256=f3tfHAaRQqc5KteXNkf7n610SxOLo2hoGj5_GgqEL2Y,25726
|
|
18
|
-
cortex/metal/mlx_compat.py,sha256=
|
|
18
|
+
cortex/metal/mlx_compat.py,sha256=oZ_RNjJzWs6h6Q3mSNK-K2--BhJwKt7d_tYt3uMN1pM,3531
|
|
19
19
|
cortex/metal/mlx_converter.py,sha256=lMmIh6PqLwraWInZDLJjktBtumLHD9TYRnhiKCpilrc,26722
|
|
20
20
|
cortex/metal/mps_optimizer.py,sha256=4r6dj-_KAr3vedCwwu7lR-nIaF4g4D4kkOoF2KiQ0FQ,15307
|
|
21
21
|
cortex/metal/optimizer.py,sha256=9ixKj8ca1iovF-mFHYGa9_DUHcqgGyzLoP_lIRAzfMM,21996
|
|
@@ -41,9 +41,9 @@ cortex/ui/__init__.py,sha256=t3GrHJMHTVgBEKh2_qt4B9mS594V5jriTDqc3eZKMGc,3409
|
|
|
41
41
|
cortex/ui/cli.py,sha256=ExzP56n1yV4bdA1EOqHSDFRWhpgpX0lkghq0H0FXw7Q,74661
|
|
42
42
|
cortex/ui/markdown_render.py,sha256=bXt60vkNYT_jbpKeIg_1OlcrxssmdbMO7RB2E1sWw3E,5759
|
|
43
43
|
cortex/ui/terminal_app.py,sha256=SF3KqcGFyZ4hpTmgX21idPzOTJLdKGkt4QdA-wwUBNE,18317
|
|
44
|
-
cortex_llm-1.0.
|
|
45
|
-
cortex_llm-1.0.
|
|
46
|
-
cortex_llm-1.0.
|
|
47
|
-
cortex_llm-1.0.
|
|
48
|
-
cortex_llm-1.0.
|
|
49
|
-
cortex_llm-1.0.
|
|
44
|
+
cortex_llm-1.0.4.dist-info/licenses/LICENSE,sha256=_frJ3VsZWQGhMznZw2Tgjk7xwfAfDZRcBl43uZh8_4E,1070
|
|
45
|
+
cortex_llm-1.0.4.dist-info/METADATA,sha256=rX0lVqvlXVaLNMfn3QWJH2rYSShxAiH7v6d_fWKvkYg,10087
|
|
46
|
+
cortex_llm-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
47
|
+
cortex_llm-1.0.4.dist-info/entry_points.txt,sha256=g83Nuz3iFrNdMLHxGLR2LnscdM7rdQRchuL3WGobQC8,48
|
|
48
|
+
cortex_llm-1.0.4.dist-info/top_level.txt,sha256=79LAeTJJ_pMIBy3mkF7uNaN0mdBRt5tGrnne5N_iAio,7
|
|
49
|
+
cortex_llm-1.0.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|