cortex-llm 1.0.3__tar.gz → 1.0.6__tar.gz
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_llm-1.0.6/PKG-INFO +155 -0
- cortex_llm-1.0.6/README.md +97 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/__init__.py +1 -1
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/__main__.py +6 -5
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/metal/mlx_compat.py +15 -0
- cortex_llm-1.0.6/cortex_llm.egg-info/PKG-INFO +155 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex_llm.egg-info/requires.txt +2 -2
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/pyproject.toml +5 -6
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/setup.py +3 -3
- cortex_llm-1.0.3/PKG-INFO +0 -275
- cortex_llm-1.0.3/README.md +0 -216
- cortex_llm-1.0.3/cortex_llm.egg-info/PKG-INFO +0 -275
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/LICENSE +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/config.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/conversation_manager.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/fine_tuning/__init__.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/fine_tuning/dataset.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/fine_tuning/mlx_lora_trainer.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/fine_tuning/trainer.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/fine_tuning/wizard.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/gpu_validator.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/inference_engine.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/metal/__init__.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/metal/gpu_validator.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/metal/memory_pool.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/metal/mlx_accelerator.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/metal/mlx_converter.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/metal/mps_optimizer.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/metal/optimizer.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/metal/performance_profiler.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/model_downloader.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/model_manager.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/quantization/__init__.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/quantization/dynamic_quantizer.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/__init__.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/auto_detector.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/config_manager.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/interactive.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/registry.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/template_profiles/__init__.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/template_profiles/base.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/template_profiles/complex/__init__.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/template_profiles/complex/reasoning.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/template_profiles/standard/__init__.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/template_profiles/standard/alpaca.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/template_profiles/standard/chatml.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/template_profiles/standard/gemma.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/template_profiles/standard/llama.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/template_registry/template_profiles/standard/simple.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/ui/__init__.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/ui/cli.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/ui/markdown_render.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex/ui/terminal_app.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex_llm.egg-info/SOURCES.txt +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex_llm.egg-info/dependency_links.txt +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex_llm.egg-info/entry_points.txt +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex_llm.egg-info/not-zip-safe +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/cortex_llm.egg-info/top_level.txt +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/setup.cfg +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/tests/test_apple_silicon.py +0 -0
- {cortex_llm-1.0.3 → cortex_llm-1.0.6}/tests/test_metal_optimization.py +0 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cortex-llm
|
|
3
|
+
Version: 1.0.6
|
|
4
|
+
Summary: GPU-Accelerated LLM Terminal for Apple Silicon
|
|
5
|
+
Home-page: https://github.com/faisalmumtaz/Cortex
|
|
6
|
+
Author: Cortex Development Team
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/faisalmumtaz/Cortex
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/faisalmumtaz/Cortex/issues
|
|
10
|
+
Project-URL: Documentation, https://github.com/faisalmumtaz/Cortex/wiki
|
|
11
|
+
Keywords: llm,gpu,metal,mps,apple-silicon,ai,machine-learning,terminal,mlx,pytorch
|
|
12
|
+
Platform: darwin
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Operating System :: MacOS
|
|
20
|
+
Classifier: Environment :: Console
|
|
21
|
+
Classifier: Environment :: GPU
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: torch>=2.1.0
|
|
26
|
+
Requires-Dist: mlx>=0.30.4
|
|
27
|
+
Requires-Dist: mlx-lm>=0.30.5
|
|
28
|
+
Requires-Dist: transformers>=4.36.0
|
|
29
|
+
Requires-Dist: safetensors>=0.4.0
|
|
30
|
+
Requires-Dist: huggingface-hub>=0.19.0
|
|
31
|
+
Requires-Dist: accelerate>=0.25.0
|
|
32
|
+
Requires-Dist: llama-cpp-python>=0.2.0
|
|
33
|
+
Requires-Dist: pyyaml>=6.0
|
|
34
|
+
Requires-Dist: pydantic>=2.5.0
|
|
35
|
+
Requires-Dist: rich>=13.0.0
|
|
36
|
+
Requires-Dist: psutil>=5.9.0
|
|
37
|
+
Requires-Dist: numpy>=1.24.0
|
|
38
|
+
Requires-Dist: packaging>=23.0
|
|
39
|
+
Requires-Dist: requests>=2.31.0
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
42
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
43
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
44
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
45
|
+
Requires-Dist: mypy>=1.8.0; extra == "dev"
|
|
46
|
+
Provides-Extra: optional
|
|
47
|
+
Requires-Dist: sentencepiece>=0.1.99; extra == "optional"
|
|
48
|
+
Requires-Dist: auto-gptq>=0.7.0; extra == "optional"
|
|
49
|
+
Requires-Dist: autoawq>=0.2.0; extra == "optional"
|
|
50
|
+
Requires-Dist: bitsandbytes>=0.41.0; extra == "optional"
|
|
51
|
+
Requires-Dist: optimum>=1.16.0; extra == "optional"
|
|
52
|
+
Requires-Dist: torchvision>=0.16.0; extra == "optional"
|
|
53
|
+
Requires-Dist: torchaudio>=2.1.0; extra == "optional"
|
|
54
|
+
Dynamic: home-page
|
|
55
|
+
Dynamic: license-file
|
|
56
|
+
Dynamic: platform
|
|
57
|
+
Dynamic: requires-python
|
|
58
|
+
|
|
59
|
+
# Cortex
|
|
60
|
+
|
|
61
|
+
GPU-accelerated local LLMs on Apple Silicon, built for the terminal.
|
|
62
|
+
|
|
63
|
+
Cortex is a fast, native CLI for running and fine-tuning LLMs on Apple Silicon using MLX and Metal. It automatically detects chat templates, supports multiple model formats, and keeps your workflow inside the terminal.
|
|
64
|
+
|
|
65
|
+
## Highlights
|
|
66
|
+
|
|
67
|
+
- Apple Silicon GPU acceleration via MLX (primary) and PyTorch MPS
|
|
68
|
+
- Multi-format model support: MLX, GGUF, SafeTensors, PyTorch, GPTQ, AWQ
|
|
69
|
+
- Built-in LoRA fine-tuning wizard
|
|
70
|
+
- Chat template auto-detection (ChatML, Llama, Alpaca, Gemma, Reasoning)
|
|
71
|
+
- Conversation history with branching
|
|
72
|
+
|
|
73
|
+
## Quick Start
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pipx install cortex-llm
|
|
77
|
+
cortex
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Inside Cortex:
|
|
81
|
+
|
|
82
|
+
- `/download` to fetch a model from HuggingFace
|
|
83
|
+
- `/model` to load or manage models
|
|
84
|
+
- `/status` to confirm GPU acceleration and current settings
|
|
85
|
+
|
|
86
|
+
## Installation
|
|
87
|
+
|
|
88
|
+
### Option A: pipx (recommended)
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pipx install cortex-llm
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Option B: from source
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
git clone https://github.com/faisalmumtaz/Cortex.git
|
|
98
|
+
cd Cortex
|
|
99
|
+
./install.sh
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The installer checks Apple Silicon compatibility, creates a venv, installs dependencies from `pyproject.toml`, and sets up the `cortex` command.
|
|
103
|
+
|
|
104
|
+
## Requirements
|
|
105
|
+
|
|
106
|
+
- Apple Silicon Mac (M1/M2/M3/M4)
|
|
107
|
+
- macOS 13.3+
|
|
108
|
+
- Python 3.11+
|
|
109
|
+
- 16GB+ unified memory (24GB+ recommended for larger models)
|
|
110
|
+
- Xcode Command Line Tools
|
|
111
|
+
|
|
112
|
+
## Model Support
|
|
113
|
+
|
|
114
|
+
Cortex supports:
|
|
115
|
+
|
|
116
|
+
- **MLX** (recommended)
|
|
117
|
+
- **GGUF** (llama.cpp + Metal)
|
|
118
|
+
- **SafeTensors**
|
|
119
|
+
- **PyTorch** (Transformers + MPS)
|
|
120
|
+
- **GPTQ** / **AWQ** quantized models
|
|
121
|
+
|
|
122
|
+
## Configuration
|
|
123
|
+
|
|
124
|
+
Cortex reads `config.yaml` from the current working directory. For tuning GPU memory limits, quantization defaults, and inference parameters, see:
|
|
125
|
+
|
|
126
|
+
- `docs/configuration.md`
|
|
127
|
+
|
|
128
|
+
## Documentation
|
|
129
|
+
|
|
130
|
+
Start here:
|
|
131
|
+
|
|
132
|
+
- `docs/installation.md`
|
|
133
|
+
- `docs/cli.md`
|
|
134
|
+
- `docs/model-management.md`
|
|
135
|
+
- `docs/troubleshooting.md`
|
|
136
|
+
|
|
137
|
+
Advanced topics:
|
|
138
|
+
|
|
139
|
+
- `docs/mlx-acceleration.md`
|
|
140
|
+
- `docs/inference-engine.md`
|
|
141
|
+
- `docs/template-registry.md`
|
|
142
|
+
- `docs/fine-tuning.md`
|
|
143
|
+
- `docs/development.md`
|
|
144
|
+
|
|
145
|
+
## Contributing
|
|
146
|
+
|
|
147
|
+
Contributions are welcome. See `docs/development.md` for setup and workflow.
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT License. See `LICENSE`.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
Note: Cortex requires Apple Silicon. Intel Macs are not supported.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Cortex
|
|
2
|
+
|
|
3
|
+
GPU-accelerated local LLMs on Apple Silicon, built for the terminal.
|
|
4
|
+
|
|
5
|
+
Cortex is a fast, native CLI for running and fine-tuning LLMs on Apple Silicon using MLX and Metal. It automatically detects chat templates, supports multiple model formats, and keeps your workflow inside the terminal.
|
|
6
|
+
|
|
7
|
+
## Highlights
|
|
8
|
+
|
|
9
|
+
- Apple Silicon GPU acceleration via MLX (primary) and PyTorch MPS
|
|
10
|
+
- Multi-format model support: MLX, GGUF, SafeTensors, PyTorch, GPTQ, AWQ
|
|
11
|
+
- Built-in LoRA fine-tuning wizard
|
|
12
|
+
- Chat template auto-detection (ChatML, Llama, Alpaca, Gemma, Reasoning)
|
|
13
|
+
- Conversation history with branching
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pipx install cortex-llm
|
|
19
|
+
cortex
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Inside Cortex:
|
|
23
|
+
|
|
24
|
+
- `/download` to fetch a model from HuggingFace
|
|
25
|
+
- `/model` to load or manage models
|
|
26
|
+
- `/status` to confirm GPU acceleration and current settings
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
### Option A: pipx (recommended)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pipx install cortex-llm
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Option B: from source
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
git clone https://github.com/faisalmumtaz/Cortex.git
|
|
40
|
+
cd Cortex
|
|
41
|
+
./install.sh
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The installer checks Apple Silicon compatibility, creates a venv, installs dependencies from `pyproject.toml`, and sets up the `cortex` command.
|
|
45
|
+
|
|
46
|
+
## Requirements
|
|
47
|
+
|
|
48
|
+
- Apple Silicon Mac (M1/M2/M3/M4)
|
|
49
|
+
- macOS 13.3+
|
|
50
|
+
- Python 3.11+
|
|
51
|
+
- 16GB+ unified memory (24GB+ recommended for larger models)
|
|
52
|
+
- Xcode Command Line Tools
|
|
53
|
+
|
|
54
|
+
## Model Support
|
|
55
|
+
|
|
56
|
+
Cortex supports:
|
|
57
|
+
|
|
58
|
+
- **MLX** (recommended)
|
|
59
|
+
- **GGUF** (llama.cpp + Metal)
|
|
60
|
+
- **SafeTensors**
|
|
61
|
+
- **PyTorch** (Transformers + MPS)
|
|
62
|
+
- **GPTQ** / **AWQ** quantized models
|
|
63
|
+
|
|
64
|
+
## Configuration
|
|
65
|
+
|
|
66
|
+
Cortex reads `config.yaml` from the current working directory. For tuning GPU memory limits, quantization defaults, and inference parameters, see:
|
|
67
|
+
|
|
68
|
+
- `docs/configuration.md`
|
|
69
|
+
|
|
70
|
+
## Documentation
|
|
71
|
+
|
|
72
|
+
Start here:
|
|
73
|
+
|
|
74
|
+
- `docs/installation.md`
|
|
75
|
+
- `docs/cli.md`
|
|
76
|
+
- `docs/model-management.md`
|
|
77
|
+
- `docs/troubleshooting.md`
|
|
78
|
+
|
|
79
|
+
Advanced topics:
|
|
80
|
+
|
|
81
|
+
- `docs/mlx-acceleration.md`
|
|
82
|
+
- `docs/inference-engine.md`
|
|
83
|
+
- `docs/template-registry.md`
|
|
84
|
+
- `docs/fine-tuning.md`
|
|
85
|
+
- `docs/development.md`
|
|
86
|
+
|
|
87
|
+
## Contributing
|
|
88
|
+
|
|
89
|
+
Contributions are welcome. See `docs/development.md` for setup and workflow.
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT License. See `LICENSE`.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
Note: Cortex requires Apple Silicon. Intel Macs are not supported.
|
|
@@ -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.6"
|
|
9
9
|
__author__ = "Cortex Development Team"
|
|
10
10
|
__license__ = "MIT"
|
|
11
11
|
|
|
@@ -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:
|
|
@@ -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:
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cortex-llm
|
|
3
|
+
Version: 1.0.6
|
|
4
|
+
Summary: GPU-Accelerated LLM Terminal for Apple Silicon
|
|
5
|
+
Home-page: https://github.com/faisalmumtaz/Cortex
|
|
6
|
+
Author: Cortex Development Team
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/faisalmumtaz/Cortex
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/faisalmumtaz/Cortex/issues
|
|
10
|
+
Project-URL: Documentation, https://github.com/faisalmumtaz/Cortex/wiki
|
|
11
|
+
Keywords: llm,gpu,metal,mps,apple-silicon,ai,machine-learning,terminal,mlx,pytorch
|
|
12
|
+
Platform: darwin
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Operating System :: MacOS
|
|
20
|
+
Classifier: Environment :: Console
|
|
21
|
+
Classifier: Environment :: GPU
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: torch>=2.1.0
|
|
26
|
+
Requires-Dist: mlx>=0.30.4
|
|
27
|
+
Requires-Dist: mlx-lm>=0.30.5
|
|
28
|
+
Requires-Dist: transformers>=4.36.0
|
|
29
|
+
Requires-Dist: safetensors>=0.4.0
|
|
30
|
+
Requires-Dist: huggingface-hub>=0.19.0
|
|
31
|
+
Requires-Dist: accelerate>=0.25.0
|
|
32
|
+
Requires-Dist: llama-cpp-python>=0.2.0
|
|
33
|
+
Requires-Dist: pyyaml>=6.0
|
|
34
|
+
Requires-Dist: pydantic>=2.5.0
|
|
35
|
+
Requires-Dist: rich>=13.0.0
|
|
36
|
+
Requires-Dist: psutil>=5.9.0
|
|
37
|
+
Requires-Dist: numpy>=1.24.0
|
|
38
|
+
Requires-Dist: packaging>=23.0
|
|
39
|
+
Requires-Dist: requests>=2.31.0
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
42
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
43
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
44
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
45
|
+
Requires-Dist: mypy>=1.8.0; extra == "dev"
|
|
46
|
+
Provides-Extra: optional
|
|
47
|
+
Requires-Dist: sentencepiece>=0.1.99; extra == "optional"
|
|
48
|
+
Requires-Dist: auto-gptq>=0.7.0; extra == "optional"
|
|
49
|
+
Requires-Dist: autoawq>=0.2.0; extra == "optional"
|
|
50
|
+
Requires-Dist: bitsandbytes>=0.41.0; extra == "optional"
|
|
51
|
+
Requires-Dist: optimum>=1.16.0; extra == "optional"
|
|
52
|
+
Requires-Dist: torchvision>=0.16.0; extra == "optional"
|
|
53
|
+
Requires-Dist: torchaudio>=2.1.0; extra == "optional"
|
|
54
|
+
Dynamic: home-page
|
|
55
|
+
Dynamic: license-file
|
|
56
|
+
Dynamic: platform
|
|
57
|
+
Dynamic: requires-python
|
|
58
|
+
|
|
59
|
+
# Cortex
|
|
60
|
+
|
|
61
|
+
GPU-accelerated local LLMs on Apple Silicon, built for the terminal.
|
|
62
|
+
|
|
63
|
+
Cortex is a fast, native CLI for running and fine-tuning LLMs on Apple Silicon using MLX and Metal. It automatically detects chat templates, supports multiple model formats, and keeps your workflow inside the terminal.
|
|
64
|
+
|
|
65
|
+
## Highlights
|
|
66
|
+
|
|
67
|
+
- Apple Silicon GPU acceleration via MLX (primary) and PyTorch MPS
|
|
68
|
+
- Multi-format model support: MLX, GGUF, SafeTensors, PyTorch, GPTQ, AWQ
|
|
69
|
+
- Built-in LoRA fine-tuning wizard
|
|
70
|
+
- Chat template auto-detection (ChatML, Llama, Alpaca, Gemma, Reasoning)
|
|
71
|
+
- Conversation history with branching
|
|
72
|
+
|
|
73
|
+
## Quick Start
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pipx install cortex-llm
|
|
77
|
+
cortex
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Inside Cortex:
|
|
81
|
+
|
|
82
|
+
- `/download` to fetch a model from HuggingFace
|
|
83
|
+
- `/model` to load or manage models
|
|
84
|
+
- `/status` to confirm GPU acceleration and current settings
|
|
85
|
+
|
|
86
|
+
## Installation
|
|
87
|
+
|
|
88
|
+
### Option A: pipx (recommended)
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pipx install cortex-llm
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Option B: from source
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
git clone https://github.com/faisalmumtaz/Cortex.git
|
|
98
|
+
cd Cortex
|
|
99
|
+
./install.sh
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The installer checks Apple Silicon compatibility, creates a venv, installs dependencies from `pyproject.toml`, and sets up the `cortex` command.
|
|
103
|
+
|
|
104
|
+
## Requirements
|
|
105
|
+
|
|
106
|
+
- Apple Silicon Mac (M1/M2/M3/M4)
|
|
107
|
+
- macOS 13.3+
|
|
108
|
+
- Python 3.11+
|
|
109
|
+
- 16GB+ unified memory (24GB+ recommended for larger models)
|
|
110
|
+
- Xcode Command Line Tools
|
|
111
|
+
|
|
112
|
+
## Model Support
|
|
113
|
+
|
|
114
|
+
Cortex supports:
|
|
115
|
+
|
|
116
|
+
- **MLX** (recommended)
|
|
117
|
+
- **GGUF** (llama.cpp + Metal)
|
|
118
|
+
- **SafeTensors**
|
|
119
|
+
- **PyTorch** (Transformers + MPS)
|
|
120
|
+
- **GPTQ** / **AWQ** quantized models
|
|
121
|
+
|
|
122
|
+
## Configuration
|
|
123
|
+
|
|
124
|
+
Cortex reads `config.yaml` from the current working directory. For tuning GPU memory limits, quantization defaults, and inference parameters, see:
|
|
125
|
+
|
|
126
|
+
- `docs/configuration.md`
|
|
127
|
+
|
|
128
|
+
## Documentation
|
|
129
|
+
|
|
130
|
+
Start here:
|
|
131
|
+
|
|
132
|
+
- `docs/installation.md`
|
|
133
|
+
- `docs/cli.md`
|
|
134
|
+
- `docs/model-management.md`
|
|
135
|
+
- `docs/troubleshooting.md`
|
|
136
|
+
|
|
137
|
+
Advanced topics:
|
|
138
|
+
|
|
139
|
+
- `docs/mlx-acceleration.md`
|
|
140
|
+
- `docs/inference-engine.md`
|
|
141
|
+
- `docs/template-registry.md`
|
|
142
|
+
- `docs/fine-tuning.md`
|
|
143
|
+
- `docs/development.md`
|
|
144
|
+
|
|
145
|
+
## Contributing
|
|
146
|
+
|
|
147
|
+
Contributions are welcome. See `docs/development.md` for setup and workflow.
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT License. See `LICENSE`.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
Note: Cortex requires Apple Silicon. Intel Macs are not supported.
|
|
@@ -4,10 +4,11 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cortex-llm"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.6"
|
|
8
8
|
description = "GPU-Accelerated LLM Terminal for Apple Silicon"
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
license =
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
11
12
|
authors = [
|
|
12
13
|
{name = "Cortex Development Team"},
|
|
13
14
|
]
|
|
@@ -16,7 +17,6 @@ classifiers = [
|
|
|
16
17
|
"Development Status :: 4 - Beta",
|
|
17
18
|
"Intended Audience :: Developers",
|
|
18
19
|
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
19
|
-
"License :: OSI Approved :: MIT License",
|
|
20
20
|
"Programming Language :: Python :: 3",
|
|
21
21
|
"Programming Language :: Python :: 3.11",
|
|
22
22
|
"Programming Language :: Python :: 3.12",
|
|
@@ -30,8 +30,8 @@ keywords = ["llm", "gpu", "metal", "mps", "apple-silicon", "ai", "machine-learni
|
|
|
30
30
|
dependencies = [
|
|
31
31
|
# Core ML/AI Libraries
|
|
32
32
|
"torch>=2.1.0",
|
|
33
|
-
"mlx>=0.
|
|
34
|
-
"mlx-lm>=0.
|
|
33
|
+
"mlx>=0.30.4",
|
|
34
|
+
"mlx-lm>=0.30.5",
|
|
35
35
|
"transformers>=4.36.0",
|
|
36
36
|
"safetensors>=0.4.0",
|
|
37
37
|
"huggingface-hub>=0.19.0",
|
|
@@ -85,7 +85,6 @@ Documentation = "https://github.com/faisalmumtaz/Cortex/wiki"
|
|
|
85
85
|
[tool.setuptools]
|
|
86
86
|
packages = ["cortex", "cortex.metal", "cortex.ui", "cortex.fine_tuning", "cortex.quantization", "cortex.template_registry", "cortex.template_registry.template_profiles", "cortex.template_registry.template_profiles.complex", "cortex.template_registry.template_profiles.standard"]
|
|
87
87
|
include-package-data = true
|
|
88
|
-
license-files = ["LICENSE"]
|
|
89
88
|
|
|
90
89
|
[tool.setuptools.package-data]
|
|
91
90
|
cortex = ["config.yaml"]
|
|
@@ -36,7 +36,6 @@ setup(
|
|
|
36
36
|
"Development Status :: 4 - Beta",
|
|
37
37
|
"Intended Audience :: Developers",
|
|
38
38
|
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
39
|
-
"License :: OSI Approved :: MIT License",
|
|
40
39
|
"Programming Language :: Python :: 3",
|
|
41
40
|
"Programming Language :: Python :: 3.11",
|
|
42
41
|
"Programming Language :: Python :: 3.12",
|
|
@@ -60,8 +59,9 @@ setup(
|
|
|
60
59
|
"auto-gptq>=0.7.0",
|
|
61
60
|
"autoawq>=0.2.0",
|
|
62
61
|
"bitsandbytes>=0.41.0",
|
|
63
|
-
"llama-cpp-python>=0.2.0",
|
|
64
62
|
"optimum>=1.16.0",
|
|
63
|
+
"torchvision>=0.16.0",
|
|
64
|
+
"torchaudio>=2.1.0",
|
|
65
65
|
],
|
|
66
66
|
},
|
|
67
67
|
entry_points={
|
|
@@ -79,4 +79,4 @@ setup(
|
|
|
79
79
|
"llm", "gpu", "metal", "mps", "apple-silicon",
|
|
80
80
|
"ai", "machine-learning", "terminal", "mlx", "pytorch",
|
|
81
81
|
],
|
|
82
|
-
)
|
|
82
|
+
)
|