Skip to main content

Transformer language models on Apple Silicon with MLX

Project description

lmxlab

Transformer language models on Apple Silicon, built with MLX.

CI Docs PyPI Python License

Install

pip install lmxlab

Requires Python 3.12+ and Apple Silicon (M1+). MLX runs on Intel/Linux too, but CPU-only.

Usage

import mlx.core as mx
from lmxlab.models.llama import llama_config
from lmxlab.models.base import LanguageModel

config = llama_config(vocab_size=32000, d_model=512, n_heads=8, n_kv_heads=4, n_layers=6)
model = LanguageModel(config)
mx.eval(model.parameters())

tokens = mx.array([[1, 234, 567]])
logits, caches = model(tokens)

Architecture variants (GPT, LLaMA, DeepSeek, Gemma, Qwen, Mixtral, etc.) are config factories — same LanguageModel class, different settings.

CLI

lmxlab list                    # Show available architectures
lmxlab info llama --tiny       # Config details
lmxlab count deepseek --detail # Parameter breakdown

Docs

Full API docs at michaelellis003.github.io/lmxlab.

Development

git clone https://github.com/michaelellis003/lmxlab.git
cd lmxlab
uv sync --extra dev
uv run pre-commit install
uv run pytest

License

MIT

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

lmxlab-0.4.0.tar.gz (379.1 kB view details)

Uploaded Source

Built Distribution

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

lmxlab-0.4.0-py3-none-any.whl (115.4 kB view details)

Uploaded Python 3

File details

Details for the file lmxlab-0.4.0.tar.gz.

File metadata

  • Download URL: lmxlab-0.4.0.tar.gz
  • Upload date:
  • Size: 379.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for lmxlab-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e7bc09fa6f6d80866ec8ec862f01999e6a2fd15109111ef04851734549ec50b2
MD5 d0c0142a0d015a85682fcecd32c185d0
BLAKE2b-256 9f49ce8a7bec108a541c616049efb89c413df4041601bddf205ee03199d727b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for lmxlab-0.4.0.tar.gz:

Publisher: release.yml on michaelellis003/lmxlab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lmxlab-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: lmxlab-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 115.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for lmxlab-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46693ba5061ca2b0046f8c8ff2f4335374e87b9cc1f846c132c896c2320c2657
MD5 7dad97ff90f1174660e150e8c3755550
BLAKE2b-256 338143c84be2815bd54fa8d2f772238ec04b6fc8b964fa2b13a94f4695476b1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for lmxlab-0.4.0-py3-none-any.whl:

Publisher: release.yml on michaelellis003/lmxlab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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