{"id":31061554,"url":"https://github.com/jkuri/mlx-llm-finetuning-example","last_synced_at":"2025-09-15T11:12:22.533Z","repository":{"id":307886544,"uuid":"1030990347","full_name":"jkuri/mlx-llm-finetuning-example","owner":"jkuri","description":"LLM fine-tuning pipeline for Apple Silicon with MLX, web scraping, and LoRA training","archived":false,"fork":false,"pushed_at":"2025-08-02T21:34:53.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T21:35:46.185Z","etag":null,"topics":["ai","apple-silicon","fine-tuning","llm","lora","m1","m2","m3","machine-learning","ministral","mlx","natural-language-processing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jkuri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-02T19:08:51.000Z","updated_at":"2025-08-02T21:34:56.000Z","dependencies_parsed_at":"2025-08-02T21:35:47.456Z","dependency_job_id":null,"html_url":"https://github.com/jkuri/mlx-llm-finetuning-example","commit_stats":null,"previous_names":["jkuri/mlx-llm-finetuning-example"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/jkuri/mlx-llm-finetuning-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkuri%2Fmlx-llm-finetuning-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkuri%2Fmlx-llm-finetuning-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkuri%2Fmlx-llm-finetuning-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkuri%2Fmlx-llm-finetuning-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkuri","download_url":"https://codeload.github.com/jkuri/mlx-llm-finetuning-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkuri%2Fmlx-llm-finetuning-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275246425,"owners_count":25430814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","apple-silicon","fine-tuning","llm","lora","m1","m2","m3","machine-learning","ministral","mlx","natural-language-processing"],"created_at":"2025-09-15T11:12:17.306Z","updated_at":"2025-09-15T11:12:22.523Z","avatar_url":"https://github.com/jkuri.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLM Fine-tuning Pipeline on Apple Silicon GPUs with MLX\n\nThis is an LLM fine-tuning pipeline for Apple Silicon GPUs using MLX. The project enables:\n\nData Collection \u0026 Preparation:\n\nWeb scraping with `scripts/web_scraper.py` to extract content from websites (like Wikipedia)\nData preprocessing with `scripts/prepare_jsonl_data.py` to convert scraped CSV data into JSONL training format\nModel Training:\n\nFine-tuning the `mlx-community/Ministral-8B-Instruct-2410-4bit` model using LoRA (Low-Rank Adaptation)\nTraining script `scripts/train.sh` with configurable parameters (batch size, iterations, learning rate)\nTesting capabilities via `scripts/test.sh`\nKey Features:\n\nOptimized for Apple Silicon using MLX framework\nLoRA fine-tuning for efficient training with limited resources\nMultiple data formats supported (Q\u0026A, instruction-following, chat)\nAutomated pipeline from web scraping to model inference\n\nWorkflow:\n\n1. Scrape web content → CSV\n2. Convert CSV → JSONL training data\n3. Fine-tune model with LoRA\n4. Generate responses with the adapted model\n\nThe project is designed for creating domain-specific AI assistants by training on custom web content.\n\n## Usage\n\n```sh\npython -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```\n\nYou need huggingface account and token to download the model.\n\n```sh\nhf auth login\nhf download mlx-community/Ministral-8B-Instruct-2410-4bit\n```\n\n```sh\npython ./scripts/web_scraper.py https://en.wikipedia.org/wiki/Yugoslavia -p 20 -o dataset/data.csv\n```\n\n```sh\npython ./scripts/prepare_jsonl_data.py dataset/data.csv\n```\n\n```sh\n./scripts/train.sh\n```\n\n```sh\n./scripts/test.sh\n```\n\nExample inference:\n\n```sh\n./scripts/run.sh \"Explain the history of the Balkans\"\n```\n\nor\n\n```sh\n./scripts/run.sh \"Who was the president of Yugoslavia?\"\n```\n\n## Sample\n\n\u003chttps://github.com/user-attachments/assets/b2abe016-4e15-463c-a962-13f6a75350aa\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkuri%2Fmlx-llm-finetuning-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkuri%2Fmlx-llm-finetuning-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkuri%2Fmlx-llm-finetuning-example/lists"}