Transformer language models on Apple Silicon with MLX
Project description
lmxlab
Transformer language models on Apple Silicon, built with MLX.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7bc09fa6f6d80866ec8ec862f01999e6a2fd15109111ef04851734549ec50b2
|
|
| MD5 |
d0c0142a0d015a85682fcecd32c185d0
|
|
| BLAKE2b-256 |
9f49ce8a7bec108a541c616049efb89c413df4041601bddf205ee03199d727b5
|
Provenance
The following attestation bundles were made for lmxlab-0.4.0.tar.gz:
Publisher:
release.yml on michaelellis003/lmxlab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lmxlab-0.4.0.tar.gz -
Subject digest:
e7bc09fa6f6d80866ec8ec862f01999e6a2fd15109111ef04851734549ec50b2 - Sigstore transparency entry: 1272930399
- Sigstore integration time:
-
Permalink:
michaelellis003/lmxlab@968e5883240acea21def2693b865388c1565f1f1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/michaelellis003
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@968e5883240acea21def2693b865388c1565f1f1 -
Trigger Event:
workflow_run
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46693ba5061ca2b0046f8c8ff2f4335374e87b9cc1f846c132c896c2320c2657
|
|
| MD5 |
7dad97ff90f1174660e150e8c3755550
|
|
| BLAKE2b-256 |
338143c84be2815bd54fa8d2f772238ec04b6fc8b964fa2b13a94f4695476b1a
|
Provenance
The following attestation bundles were made for lmxlab-0.4.0-py3-none-any.whl:
Publisher:
release.yml on michaelellis003/lmxlab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lmxlab-0.4.0-py3-none-any.whl -
Subject digest:
46693ba5061ca2b0046f8c8ff2f4335374e87b9cc1f846c132c896c2320c2657 - Sigstore transparency entry: 1272930510
- Sigstore integration time:
-
Permalink:
michaelellis003/lmxlab@968e5883240acea21def2693b865388c1565f1f1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/michaelellis003
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@968e5883240acea21def2693b865388c1565f1f1 -
Trigger Event:
workflow_run
-
Statement type: