Skip to main content

Cortex

GPU-accelerated local LLMs on Apple Silicon, built for the terminal.

Cortex preview

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.

Highlights

  • Apple Silicon GPU acceleration via MLX (primary) and PyTorch MPS
  • Multi-format model support: MLX, GGUF, SafeTensors, PyTorch, GPTQ, AWQ
  • Built-in LoRA fine-tuning wizard
  • Chat template auto-detection (ChatML, Llama, Alpaca, Gemma, Reasoning)
  • Conversation history with autosave and export

Quick Start

pipx install cortex-llm
cortex

Inside Cortex:

  • /download to fetch a model from HuggingFace
  • /model to load or manage models
  • /status to confirm GPU acceleration and current settings

Installation

Option A: pipx (recommended)

pipx install cortex-llm

Option B: from source

git clone https://github.com/faisalmumtaz/Cortex.git
cd Cortex
./install.sh

The installer checks Apple Silicon compatibility, creates a venv, installs dependencies from pyproject.toml, and sets up the cortex command.

Requirements

  • Apple Silicon Mac (M1/M2/M3/M4)
  • macOS 13.3+
  • Python 3.11+
  • 16GB+ unified memory (24GB+ recommended for larger models)
  • Xcode Command Line Tools

Model Support

Cortex supports:

  • MLX (recommended)
  • GGUF (llama.cpp + Metal)
  • SafeTensors
  • PyTorch (Transformers + MPS)
  • GPTQ / AWQ quantized models

Advanced Features

  • Dynamic quantization fallback for PyTorch/SafeTensors models that do not fit GPU memory (INT8 preferred, INT4 fallback)
    • docs/dynamic-quantization.md
  • MLX conversion with quantization recipes (4/5/8-bit, mixed precision) for speed vs quality control
    • docs/mlx-acceleration.md
  • LoRA fine-tuning wizard for local adapters (/finetune)
    • docs/fine-tuning.md
  • Template registry and auto-detection for chat formatting (ChatML, Llama, Alpaca, Gemma, Reasoning)
    • docs/template-registry.md
  • Inference engine details and backend behavior
    • docs/inference-engine.md
  • Tooling (experimental, WIP) for repo-scoped read/search and optional file edits with explicit confirmation
    • docs/cli.md

Important (Work in Progress): Tooling is actively evolving and should be considered experimental. Behavior, output format, and available actions may change; tool calls can fail; and UI presentation may be adjusted. Use tooling on non-critical work first, and always review any proposed file changes before approving them.

Configuration

Cortex reads config.yaml from the current working directory. For tuning GPU memory limits, quantization defaults, and inference parameters, see:

  • docs/configuration.md

Documentation

Start here:

  • docs/installation.md
  • docs/cli.md
  • docs/model-management.md
  • docs/troubleshooting.md

Advanced topics:

  • docs/mlx-acceleration.md
  • docs/inference-engine.md
  • docs/dynamic-quantization.md
  • docs/template-registry.md
  • docs/fine-tuning.md
  • docs/development.md

Contributing

Contributions are welcome. See docs/development.md for setup and workflow.

License

MIT License. See LICENSE.


Note: Cortex requires Apple Silicon. Intel Macs are not supported.

Metadata

Release files for cortex-llm 1.0.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cortex-llm 1.0.20
File Size Uploaded Provenance
cortex_llm-1.0.20.tar.gz 164.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cortex-llm 1.0.20
File Interpreter ABI Platform
cortex_llm-1.0.20-py3-none-any.whl Python 3 none any Details

Total release size: 348.2 kB

Release files / cortex_llm-1.0.20.tar.gz

Download URL cortex_llm-1.0.20.tar.gz
Size 164.1 kB
Tags Source
SHA-256 checksum
How to use checksums
149eb07f4ae0bf768435cf7a5de6ebe0c6c1ed62677b65c743cfae321d7780a6
BLAKE2b-256 checksum
How to use checksums
cea1e5071a21828459ce01a3429d360f635cd3ac6ee846639b29829947b2684d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / cortex_llm-1.0.20-py3-none-any.whl

Download URL cortex_llm-1.0.20-py3-none-any.whl
Size 184.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b1135c8f20410d85e4f691f612d5cff5972bf78519f503e6d0bc6c50a0bd64c
BLAKE2b-256 checksum
How to use checksums
05692f351a6dfbaab89d48728eb4710fc3d1ca39f9d12ba1b37eeba8f3726432
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for cortex-llm 1.0.20

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page