Skip to main content

The official Cartesia MLX library.

Project description

Cartesia MLX

This package contains implementations for fast on-device SSM inference on Apple silicon.

Installation

To install this package, first follow the installation instructions for cartesia-metal. Next (in your Python environment) install the cartesia-mlx package:

pip install cartesia-mlx

Note: This package has been tested on macOS Sonoma 14.1 with the M3 chip.

Models

Language Models

  • cartesia-ai/Llamba-1B-4bit-mlx
  • cartesia-ai/Llamba-3B-4bit-mlx
  • cartesia-ai/Llamba-8B-4bit-mlx
  • cartesia-ai/Llamba-8B-8bit-mlx
  • cartesia-ai/Mohawk-v0.1-1.3B-4bit-mlx
  • cartesia-ai/Rene-v0.1-1.3b-4bit-mlx
  • cartesia-ai/mamba2-130m-8bit-mlx
  • cartesia-ai/mamba2-130m-mlx
  • cartesia-ai/mamba2-370m-8bit-mlx
  • cartesia-ai/mamba2-780m-8bit-mlx
  • cartesia-ai/mamba2-1.3b-4bit-mlx
  • cartesia-ai/mamba2-2.7b-4bit-mlx

Usage

A simple example script for generation can be found in cartesia-mlx/example.py. Usage example (clone this repo and run the below from within the cartesia-mlx directory):

python example.py --model cartesia-ai/Mohawk-v0.1-1.3B-4bit-mlx --prompt "Rene Descartes was"

You can pass any of the models listed above to the --model argument; for a full list of command-line options, pass --help.

Performance

Our SSM-based LMs deliver SOTA quality and throughput, with constant tokens per second (tok/s) and memory requirements, making them an ideal choice for on-device applications.

Quality/Throughput comparison (1-2B)

At increasing context size, the throughput of transformer-based LMs drops rapidly, and memory consumption skyrockets, making them inefficient. In contrast, our distilled pure-SSM LlaMamba retains constant tokens per second (tok/s) and memory consumption, unlocking reasoning capabilities over much larger contexts on-device. This constant memory usage is ideal for edge applications.

LlaMamba scaling

Rene in MLX

Language Model

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cartesia_mlx-0.0.2.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cartesia_mlx-0.0.2-py2.py3-none-any.whl (30.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file cartesia_mlx-0.0.2.tar.gz.

File metadata

  • Download URL: cartesia_mlx-0.0.2.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for cartesia_mlx-0.0.2.tar.gz
Algorithm Hash digest
SHA256 93b4b27284253bf712e4f178f245e5246be6a82fb97530740a6551394dd72ba5
MD5 5d6f6a4f362b19c826dd09734f83004e
BLAKE2b-256 b20f91b731d15b00d43d79be7e24cf004cceb23ef925f052b4280702da62cdc0

See more details on using hashes here.

File details

Details for the file cartesia_mlx-0.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: cartesia_mlx-0.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 30.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for cartesia_mlx-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 40f9e6ea611be460ec84c6a4213f4488a98d74708deeddcf2d55e720f3b0a9d8
MD5 208facbadb8916437cb4dfc749de57df
BLAKE2b-256 415e422c5e826cdb85bf4646768ae923a6d753164ed3e0ae88a20edc759a35b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page