cortex-llm 1.0.3__py3-none-any.whl → 1.0.5__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 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.3"
8
+ __version__ = "1.0.5"
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
- # Silence known MLX deprecation warning surfaced during generation.
13
- warnings.filterwarnings(
14
- "ignore",
15
- message=r"mx\.metal\.device_info is deprecated.*",
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:
@@ -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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cortex-llm
3
- Version: 1.0.3
3
+ Version: 1.0.5
4
4
  Summary: GPU-Accelerated LLM Terminal for Apple Silicon
5
5
  Home-page: https://github.com/faisalmumtaz/Cortex
6
6
  Author: Cortex Development Team
@@ -24,8 +24,8 @@ Requires-Python: >=3.11
24
24
  Description-Content-Type: text/markdown
25
25
  License-File: LICENSE
26
26
  Requires-Dist: torch>=2.1.0
27
- Requires-Dist: mlx>=0.10.0
28
- Requires-Dist: mlx-lm>=0.10.0
27
+ Requires-Dist: mlx>=0.30.4
28
+ Requires-Dist: mlx-lm>=0.30.5
29
29
  Requires-Dist: transformers>=4.36.0
30
30
  Requires-Dist: safetensors>=0.4.0
31
31
  Requires-Dist: huggingface-hub>=0.19.0
@@ -1,5 +1,5 @@
1
- cortex/__init__.py,sha256=8MdTyD0Zir7OZiah2ITOoqjFz86iZ6-XFjeNe6ESXgo,2202
2
- cortex/__main__.py,sha256=pu1ah74AzLDHLjtZdw14OPELb0BVSacdaVcBvhOjto8,2830
1
+ cortex/__init__.py,sha256=MV1R79rhxMlbGTjL6X9AedyOGPdotx-PJf2RviGbXUM,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=NLcxjF7mXDF1SxjiE2QAk_zkmhYSNybaEvBAwFJAdAg,3070
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.3.dist-info/licenses/LICENSE,sha256=_frJ3VsZWQGhMznZw2Tgjk7xwfAfDZRcBl43uZh8_4E,1070
45
- cortex_llm-1.0.3.dist-info/METADATA,sha256=q8VVvfd9ZVe1iDnpNltPQ2PU0_BInjvw4cwkcwQqJdY,10087
46
- cortex_llm-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
47
- cortex_llm-1.0.3.dist-info/entry_points.txt,sha256=g83Nuz3iFrNdMLHxGLR2LnscdM7rdQRchuL3WGobQC8,48
48
- cortex_llm-1.0.3.dist-info/top_level.txt,sha256=79LAeTJJ_pMIBy3mkF7uNaN0mdBRt5tGrnne5N_iAio,7
49
- cortex_llm-1.0.3.dist-info/RECORD,,
44
+ cortex_llm-1.0.5.dist-info/licenses/LICENSE,sha256=_frJ3VsZWQGhMznZw2Tgjk7xwfAfDZRcBl43uZh8_4E,1070
45
+ cortex_llm-1.0.5.dist-info/METADATA,sha256=YMeikmD3YDjQhf8DjPd2pBSywHsNiqZJmMNNxQLAH-w,10087
46
+ cortex_llm-1.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
47
+ cortex_llm-1.0.5.dist-info/entry_points.txt,sha256=g83Nuz3iFrNdMLHxGLR2LnscdM7rdQRchuL3WGobQC8,48
48
+ cortex_llm-1.0.5.dist-info/top_level.txt,sha256=79LAeTJJ_pMIBy3mkF7uNaN0mdBRt5tGrnne5N_iAio,7
49
+ cortex_llm-1.0.5.dist-info/RECORD,,