tritesh commited on
Commit
f693d4a
Β·
verified Β·
1 Parent(s): 6da6419

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +66 -7
README.md CHANGED
@@ -25,6 +25,7 @@ license: mit
25
  [![Python](https://img.shields.io/badge/python-3.9%2B-blue)](https://python.org)
26
  [![MLX](https://img.shields.io/badge/MLX-latest-red)](https://github.com/ml-explore/mlx)
27
  [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
 
28
 
29
  ---
30
 
@@ -58,11 +59,52 @@ This is a **major rewrite** that fixes the critical gaps in earlier community po
58
  | **Model conversion** | PyTorchβ†’MLX weight converter | βœ… **Updated for all z-lab drafters** |
59
  | **Training** | Basic trainer | βœ… **Architecture-aware training** with adapter compatibility |
60
  | **Benchmarking** | None | βœ… **Built-in benchmark** vs mlx_lm baseline |
 
61
 
62
  ---
63
 
64
  ## πŸ“¦ Installation
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  ```bash
67
  pip install mlx-lm dflash-mlx-universal
68
  ```
@@ -151,6 +193,11 @@ python -m dflash_mlx.convert \
151
  --model z-lab/Qwen3-4B-DFlash-b16 \
152
  --output ./Qwen3-4B-DFlash-mlx
153
 
 
 
 
 
 
154
  # Or in Python
155
  from dflash_mlx.convert import convert_dflash_to_mlx
156
 
@@ -256,6 +303,13 @@ python -m dflash_mlx.serve \
256
  --block-size 16 \
257
  --port 8000
258
 
 
 
 
 
 
 
 
259
  # Query with curl
260
  curl http://localhost:8000/v1/chat/completions \
261
  -H "Content-Type: application/json" \
@@ -351,9 +405,12 @@ dflash-mlx-universal/
351
  β”‚ └── test_adapters.py # Adapter tests (NEW)
352
  β”œβ”€β”€ benchmark_m2.py # Apple Silicon benchmark
353
  β”œβ”€β”€ setup_m2.sh # Automated setup script
 
 
 
354
  β”œβ”€β”€ M2_PRO_MAX_GUIDE.md # Detailed M2 Pro Max guide
355
  β”œβ”€β”€ README.md # This file
356
- └── pyproject.toml # Package configuration
357
  ```
358
 
359
  ---
@@ -361,15 +418,16 @@ dflash-mlx-universal/
361
  ## πŸ§ͺ Testing
362
 
363
  ```bash
364
- # Run all tests
365
- pytest tests/
 
 
 
366
 
367
- # Run specific test modules
 
368
  pytest tests/test_adapters.py -v
369
  pytest tests/test_model.py -v
370
-
371
- # Run with coverage
372
- pytest --cov=dflash_mlx tests/
373
  ```
374
 
375
  ---
@@ -456,3 +514,4 @@ MIT License β€” same as the original DFlash project.
456
  **Get 6Γ— faster LLM inference on Apple Silicon today!** πŸš€
457
 
458
  > *Tested on M2/M3/M4 Pro/Max/Ultra with mlx-lm 0.24+.*
 
 
25
  [![Python](https://img.shields.io/badge/python-3.9%2B-blue)](https://python.org)
26
  [![MLX](https://img.shields.io/badge/MLX-latest-red)](https://github.com/ml-explore/mlx)
27
  [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
28
+ [![uv](https://img.shields.io/badge/uv-astral-purple)](https://github.com/astral-sh/uv)
29
 
30
  ---
31
 
 
59
  | **Model conversion** | PyTorchβ†’MLX weight converter | βœ… **Updated for all z-lab drafters** |
60
  | **Training** | Basic trainer | βœ… **Architecture-aware training** with adapter compatibility |
61
  | **Benchmarking** | None | βœ… **Built-in benchmark** vs mlx_lm baseline |
62
+ | **uv support** | pip only | βœ… **`uv` + `uv run` workflow** with lock files |
63
 
64
  ---
65
 
66
  ## πŸ“¦ Installation
67
 
68
+ ### Option 1: `uv` (Recommended β€” ultra-fast, reproducible)
69
+
70
+ [`uv`](https://github.com/astral-sh/uv) is an extremely fast Python package manager written in Rust. It's the **recommended** way to install on macOS.
71
+
72
+ ```bash
73
+ # 1. Install uv (one-time)
74
+ brew install uv
75
+ # or: curl -LsSf https://astral.sh/uv/install.sh | sh
76
+
77
+ # 2. Clone and setup
78
+ git clone https://huggingface.co/tritesh/dflash-mlx-universal.git
79
+ cd dflash-mlx-universal
80
+
81
+ # 3. One-command setup (creates venv, installs deps, locks)
82
+ chmod +x setup_uv.sh
83
+ ./setup_uv.sh
84
+
85
+ # Or manually:
86
+ uv venv
87
+ uv pip install -e ".[dev,server]"
88
+ uv lock
89
+ ```
90
+
91
+ **Why `uv`?**
92
+ - 10-100Γ— faster than `pip` (written in Rust)
93
+ - Automatic virtual environment management
94
+ - Lock file (`uv.lock`) for reproducible installs
95
+ - `uv run` β€” run any script without activating venv manually
96
+
97
+ ```bash
98
+ # Examples of uv workflow
99
+ uv run python examples/qwen3_4b_demo.py
100
+ uv run pytest tests/ -v
101
+ uv run python -m dflash_mlx.serve --target ... --draft ... --port 8000
102
+ uv run black dflash_mlx/
103
+ uv run ruff check dflash_mlx/
104
+ ```
105
+
106
+ ### Option 2: pip (Classic)
107
+
108
  ```bash
109
  pip install mlx-lm dflash-mlx-universal
110
  ```
 
193
  --model z-lab/Qwen3-4B-DFlash-b16 \
194
  --output ./Qwen3-4B-DFlash-mlx
195
 
196
+ # Or with uv (recommended)
197
+ uv run python -m dflash_mlx.convert \
198
+ --model z-lab/Qwen3-4B-DFlash-b16 \
199
+ --output ./Qwen3-4B-DFlash-mlx
200
+
201
  # Or in Python
202
  from dflash_mlx.convert import convert_dflash_to_mlx
203
 
 
303
  --block-size 16 \
304
  --port 8000
305
 
306
+ # With uv (recommended)
307
+ uv run python -m dflash_mlx.serve \
308
+ --target mlx-community/Qwen3.5-9B-4bit \
309
+ --draft ./Qwen3.5-9B-DFlash-mlx \
310
+ --block-size 16 \
311
+ --port 8000
312
+
313
  # Query with curl
314
  curl http://localhost:8000/v1/chat/completions \
315
  -H "Content-Type: application/json" \
 
405
  β”‚ └── test_adapters.py # Adapter tests (NEW)
406
  β”œβ”€β”€ benchmark_m2.py # Apple Silicon benchmark
407
  β”œβ”€β”€ setup_m2.sh # Automated setup script
408
+ β”œβ”€β”€ setup_uv.sh # βœ… UV setup script (NEW v0.2.0)
409
+ β”œβ”€β”€ .python-version # Python version pin for uv
410
+ β”œβ”€β”€ USAGE_GUIDE.md # Detailed usage guide
411
  β”œβ”€β”€ M2_PRO_MAX_GUIDE.md # Detailed M2 Pro Max guide
412
  β”œβ”€β”€ README.md # This file
413
+ └── pyproject.toml # Package configuration (with uv support)
414
  ```
415
 
416
  ---
 
418
  ## πŸ§ͺ Testing
419
 
420
  ```bash
421
+ # With uv (recommended)
422
+ uv run pytest tests/
423
+ uv run pytest tests/test_adapters.py -v
424
+ uv run pytest tests/test_model.py -v
425
+ uv run pytest --cov=dflash_mlx tests/
426
 
427
+ # Classic pip
428
+ pytest tests/
429
  pytest tests/test_adapters.py -v
430
  pytest tests/test_model.py -v
 
 
 
431
  ```
432
 
433
  ---
 
514
  **Get 6Γ— faster LLM inference on Apple Silicon today!** πŸš€
515
 
516
  > *Tested on M2/M3/M4 Pro/Max/Ultra with mlx-lm 0.24+.*
517
+ ```