Local LLM Fine-tuning on Mac (M1 16GB)
About
No channel description available.
Latest Posts
Video Description
π€ Work with me: https://www.shawhintalebi.com π Ship AI apps in weeks, not months: https://aibuilder.academy/ Here, I show how to fine-tune an LLM locally using an M-series Mac. The example adapts Mistral 7b to respond to YT comments in my likeness. π° Blog: https://medium.com/towards-data-science/local-llm-fine-tuning-on-mac-m1-16gb-f59f4f598be7?sk=7c3aba481527d2b3a2eac69cd3893bab π» GitHub Repo: https://github.com/ShawhinT/YouTube-Blog/tree/main/LLMs/qlora-mlx π₯ QLoRA: https://youtu.be/4RAvJt3fWoI π₯ Fine-tuning with OpenAI: https://youtu.be/4RAvJt3fWoI βΆοΈ Series Playlist: https://www.youtube.com/playlist?list=PLz-ep5RbHosU2hnz5ejezwaYpdMutMVB0 More Resources: [1] MLX: https://ml-explore.github.io/mlx/build/html/index.html [2] Original code: https://github.com/ml-explore/mlx-examples/tree/main/lora [3] MLX community: https://huggingface.co/mlx-community [4] Model: https://huggingface.co/mlx-community/Mistral-7B-Instruct-v0.2-4bit [5] LoRA paper: https://arxiv.org/abs/2106.09685 Intro - 0:00 Motivation - 0:56 MLX - 1:57 GitHub Repo - 3:30 Setting up environment - 4:09 Example Code - 6:23 Inference with un-finetuned model - 8:57 Fine-tuning with QLoRA - 11:22 Aside: dataset formatting - 13:54 Running local training - 16:07 Inference with finetuned model - 18:20 Note on LoRA rank - 22:03
Upgrade Your Mac AI Game
AI-recommended products based on this video

Apple iPad Mini (A17 Pro): Apple Intelligence, 8.3-inch Liquid Retina Display, 128GB, Wi-Fi 6E, 12MP Front/12MP Back Camera, Touch ID, All-Day Battery Life β Purple

Teeran Wired Apple CarPlay to Wireless Adapter, 2025 Upgrade, Mini USB Design for Cars, Seamless Use Fast Stable Connection Built-in Car Play Dongle for iPhone Global Recycled Standard

Wireless CarPlay Adapter for Apple iPhone - Upgrade Wired CarPlay to Wireless Device, Mini T-Shaped for Car USB Plug and Play Auto Reconnect, for Vehicle GPS Navigation Car Stereo Receivers, Black

Metapen Air 8 Apple Pencil for iPad 2018-2025, 20H Battry Life, 2Min Fast Charging, Palm Rejection, Stylus Pen for iPad 11/10/9/8/7/6th, iPad Pro 12.9/11/13βM4, iPad Air 3/4/5/6/M2/M3, iPad mini 5/6

Corsair Vengeance LPX 32GB (2 X 16GB) DDR4 3200 (PC4-25600) C16 1.35V Desktop Memory - Black
![Anker USB C Cable, [2-Pack, 6 ft] Type C Charger Premium Nylon USB Cable, USB A to Type C Charging Cable Fast Charge for Samsung Galaxy S10 S10+ / Note 8, LG V20 and Other USB C Charger (Black)](https://m.media-amazon.com/images/I/71N7xhCJnoL._AC_UL960_FMwebp_QL65_.jpg)
Anker USB C Cable, [2-Pack, 6 ft] Type C Charger Premium Nylon USB Cable, USB A to Type C Charging Cable Fast Charge for Samsung Galaxy S10 S10+ / Note 8, LG V20 and Other USB C Charger (Black)

Samsung 990 EVO Plus - 4TB PCIe Gen4. X4, Gen5. X2 NVMe 2.0 - M.2 Internal SSD, Speed Up to 7,250 MBs, Upgrade Storage for PC-Laptops, HMB Technology and Intelligent Turbowrite (MZ-V9S4T0B/AM)
![SAMSUNG EVO Select Micro SD-Memory-Card + Adapter, 128GB microSDXC 160MB/s Full HD & 4K UHD, UHS-I, U3, A2, V30, for Android Smartphones, Tablets, Nintendo-Switch (MB-ME128SA/AM) [Canada Version]](https://m.media-amazon.com/images/I/71lzXt4djxL._AC_UY654_FMwebp_QL65_.jpg)
SAMSUNG EVO Select Micro SD-Memory-Card + Adapter, 128GB microSDXC 160MB/s Full HD & 4K UHD, UHS-I, U3, A2, V30, for Android Smartphones, Tablets, Nintendo-Switch (MB-ME128SA/AM) [Canada Version]
![Samsung EVO Select Micro SD Memory Card + Adapter, 256GB microSDXC 160MB/s Full HD & 4K UHD, UHS-I, U3, A2, V30, for Android Smartphones, Tablets, Nintendo-Switch (MB-ME256SA/AM) [Canada Version]](https://m.media-amazon.com/images/I/71gQWJ9ufdL._AC_UL960_FMwebp_QL65_.jpg)
Samsung EVO Select Micro SD Memory Card + Adapter, 256GB microSDXC 160MB/s Full HD & 4K UHD, UHS-I, U3, A2, V30, for Android Smartphones, Tablets, Nintendo-Switch (MB-ME256SA/AM) [Canada Version]
![SAMSUNG 870 EVO SATA SSD 500GB 2.5β Internal Solid State Drive, Upgrade PC or Laptop Memory and Storage for IT Pros, Creators, Everyday Users, MZ-77E500B/AM [Canada Version]](https://m.media-amazon.com/images/I/911ujeCkGfL._AC_UL960_FMwebp_QL65_.jpg)
SAMSUNG 870 EVO SATA SSD 500GB 2.5β Internal Solid State Drive, Upgrade PC or Laptop Memory and Storage for IT Pros, Creators, Everyday Users, MZ-77E500B/AM [Canada Version]

Razer DeathAdder Essential Gaming Mouse: 6400 DPI Optical Sensor - 5 Programmable Buttons - Mechanical Switches - Rubber Side Grips - Classic Black

Logitech M185 Wireless Mouse, 2.4GHz with USB Mini Receiver, 12-Month Battery Life, 1000 DPI Optical Tracking, Ambidextrous, Compatible with PC, Mac, Laptop - Black

Logitech G305 Lightspeed Wireless Gaming Mouse, Hero 12K Sensor, 12,000 DPI, Lightweight, 6 Programmable Buttons, 250h Battery Life, On-Board Memory, PC/Mac - Black

Logitech K400 Plus Wireless Touch TV Keyboard With Easy Media Control and Built-in Touchpad, HTPC Keyboard for PC-connected TV, Windows, Android, Chrome OS, Laptop, Tablet - Black

Logitech G203 Wired Gaming Mouse, 8,000 DPI, Rainbow Optical Effect LIGHTSYNC RGB, 6 Programmable Buttons, On-Board Memory, Screen Mapping, PC/Mac Computer and Laptop Compatible - Black

Apple AirPods Pro 2 Wireless Earbuds, Bluetooth Headphones, Active Noise Cancellation, Transparency, Personalized Spatial Audio, High-Fidelity Sound, H2 Chip, USB-C Charging

3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods Global Recycled Standard

3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods (Blue) Global Recycled Standard

Wireless Charger for iPhone- 3 in 1 Charging Station for iPhone 16/15/14/13/12/Pro Max/Pro/Mini/Plus, Apple Watch 10/9/8/7/SE/6/5/4/3/2/1/Ultra2/Ultra, AirPods pro/2/3/4

UGREEN USB to USB C Adapter & USB C to USB Adapter Combo 4-Pack, 10Gbps Type-C Converter, Car Charger Compatible with MacBook Pro, iPad Mac mini, iPhone 17/16, Galaxy, PC/Laptop, Hard Drive Enclosure
![2 Pack Apple Earbuds iPhone Headphones Wired Lightning Earphones [Apple MFi Certified] (Built-in Microphone & Volume Control) Noise Isolating with iPhone 14/13/12/11/XR/XS/7/821551-8 Interlocking Case](https://m.media-amazon.com/images/I/51UTScjzmCL._AC_UL960_FMwebp_QL65_.jpg)
2 Pack Apple Earbuds iPhone Headphones Wired Lightning Earphones [Apple MFi Certified] (Built-in Microphone & Volume Control) Noise Isolating with iPhone 14/13/12/11/XR/XS/7/821551-8 Interlocking Case

3 in 1 Multi Functional Vegetable Peeler for Kitchen, with Bottle Opener, Cutter Shred and Ergonomic Wood Handle - Effortlessly Peel Potato, Apple, Pineapple, Carrot (2 PCs)
![iPhone 16 15 Charger [Apple MFi Certified] 2 Pack USB C Wall Charger Block 6FT USB C to Type C Cable Compatible with iPhone 16 15 Pro Max,16e, AirPods Pr, iPad Pro12.9/11, Samsung/Android Phones](https://m.media-amazon.com/images/I/51GjkZn3ACL._AC_UL960_FMwebp_QL65_.jpg)
iPhone 16 15 Charger [Apple MFi Certified] 2 Pack USB C Wall Charger Block 6FT USB C to Type C Cable Compatible with iPhone 16 15 Pro Max,16e, AirPods Pr, iPad Pro12.9/11, Samsung/Android Phones

Apple AirPods Pro 2 Wireless Earbuds, Bluetooth Headphones, Active Noise Cancellation, Transparency, Personalized Spatial Audio, High-Fidelity Sound, H2 Chip, USB-C Charging

Portable Air Conditioners, wobuzhi Evaporative Air Cooler with LCD Screen, Fan Speed&Spray, 7 RGB Lights,USB Powered,1-8H Timer, Personal Air Conditioners, Portable Air Conditioners for Home Office




















