Vision LLMs on Apple silicon with MLX and the Hugging Face Hub
Project description
MLX-VLM
MLX-VLM a package for running Vision LLMs on your Mac using MLX.
Get started
The easiest way to get started is to install the mlx-vlm package:
With pip:
pip install mlx-vlm
Inference
CLI
python -m mlx_vlm.generate --model qnguyen3/nanoLLaVA --max-tokens 100 --temp 0.0
Chat UI with Gradio
python -m mlx_vlm.chat_ui --model qnguyen3/nanoLLaVA
Script
import mlx.core as mx
from mlx_vlm import load, generate
model_path = "mlx-community/llava-1.5-7b-4bit"
model, processor = load(model_path)
prompt = processor.apply_chat_template(
[{"role": "user", "content": f"<image>\nWhat are these?"}],
tokenize=False,
add_generation_prompt=True,
)
output = generate(model, processor, "http://images.cocodataset.org/val2017/000000039769.jpg", prompt, verbose=False)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mlx_vlm-0.0.5.tar.gz
(28.8 kB
view details)
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
mlx_vlm-0.0.5-py3-none-any.whl
(39.8 kB
view details)
File details
Details for the file mlx_vlm-0.0.5.tar.gz.
File metadata
- Download URL: mlx_vlm-0.0.5.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15fb5d70168b2f477ad22ec531b161dbc9426feba566802b285a2c1167a7883f
|
|
| MD5 |
2aed63804f8c23b6163a943e28e95de8
|
|
| BLAKE2b-256 |
a87733fe27dafca6cafcd39023819135212b332581b269344803df69dfd544cb
|
File details
Details for the file mlx_vlm-0.0.5-py3-none-any.whl.
File metadata
- Download URL: mlx_vlm-0.0.5-py3-none-any.whl
- Upload date:
- Size: 39.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b923b814fb6e4a5de3b8302d34c7bbdd5627d41037dba9b139018244edef2e91
|
|
| MD5 |
0145ebedfe253a9c779333288d5f3ebb
|
|
| BLAKE2b-256 |
ff9a78472a8fdafd5a6f5c797c824481aa39a240c273e9e8ef8372a12ae4eff7
|