{"id":18608940,"url":"https://github.com/uogbuji/mlx-notes","last_synced_at":"2025-05-08T02:36:05.241Z","repository":{"id":228801676,"uuid":"774754174","full_name":"uogbuji/mlx-notes","owner":"uogbuji","description":"Shared personal notes created while working with the Apple MLX machine learning framework","archived":false,"fork":false,"pushed_at":"2024-06-21T14:56:25.000Z","size":14419,"stargazers_count":22,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T16:34:03.411Z","etag":null,"topics":["apple","articles","documentation","jupyter-notebooks","large-language-models","llm","machine-learning","mlx","python"],"latest_commit_sha":null,"homepage":"https://ucheog.carrd.co/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uogbuji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-03-20T05:49:30.000Z","updated_at":"2025-03-26T13:40:22.000Z","dependencies_parsed_at":"2024-06-20T00:55:17.937Z","dependency_job_id":null,"html_url":"https://github.com/uogbuji/mlx-notes","commit_stats":null,"previous_names":["uogbuji/mlx-notes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uogbuji%2Fmlx-notes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uogbuji%2Fmlx-notes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uogbuji%2Fmlx-notes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uogbuji%2Fmlx-notes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uogbuji","download_url":"https://codeload.github.com/uogbuji/mlx-notes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252987468,"owners_count":21836360,"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","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":["apple","articles","documentation","jupyter-notebooks","large-language-models","llm","machine-learning","mlx","python"],"created_at":"2024-11-07T03:04:46.604Z","updated_at":"2025-05-08T02:36:05.215Z","avatar_url":"https://github.com/uogbuji.png","language":"Jupyter Notebook","funding_links":[],"categories":["Articles"],"sub_categories":["2024"],"readme":"# Notes on the Apple MLX machine learning framework\n\n## Apple MLX for AI/Large Language Models—Day One\n\n\u003ctable\u003e\u003ctr\u003e\n  \u003ctd\u003e\u003ca href=\"2024/MLX-day-one.md\"\u003e\u003cimg src=\"assets/images/2024/Apple-MLX-GeminiGen-cropped.jpg\" width=\"256\" alt=\"Google Gemini-generated cover image for: Apple MLX for AI/Large Language Models—Day One\"/\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003ctd\u003e\n  \u003ca href=\"2024/MLX-day-one.md\"\u003eRendered markdown\u003c/a\u003e\u003cbr\u003e\n  \u003ca href=\"https://www.linkedin.com/pulse/apple-mlx-ailarge-language-modelsday-one-oori-data-riiwc\"\u003eLinkedIn version\u003c/a\u003e\u003cbr\u003e\n  \u003ca href=\"2024/MLX-day-one.ipynb\"\u003eJupyter notebook\u003c/a\u003e\n  \u003c/td\u003e\n\u003c/tr\u003e\u003c/table\u003e\n\n## Converting models from Hugging Face to MLX format, and sharing\n\n\u003ctable\u003e\u003ctr\u003e\n  \u003ctd\u003e\u003ca href=\"2024/conversion-etc.md\"\u003e\u003cimg src=\"assets/images/2024/oranges-to-apples.png\" width=\"256\" alt=\"Google Gemini-generated cover image for: Converting models from Hugging Face to MLX format, and sharing\"/\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003ctd\u003e\n  \u003ca href=\"2024/conversion-etc.md\"\u003eRendered markdown\u003c/a\u003e\u003cbr\u003e\n  \u003ca href=\"https://www.linkedin.com/pulse/converting-models-from-hugging-face-mlx-format-sharing-oori-data-6eitc\"\u003eLinkedIn version\u003c/a\u003e\u003cbr\u003e\n  \u003ca href=\"2024/conversion-etc.ipynb\"\u003eJupyter notebook\u003c/a\u003e\n  \u003c/td\u003e\n\u003c/tr\u003e\u003c/table\u003e\n\n## Retrieval augmentation with MLX: A bag full of RAG, part 1\n\n\u003ctable\u003e\u003ctr\u003e\n  \u003ctd\u003e\u003ca href=\"2024/rag-basics1.md\"\u003e\u003cimg src=\"assets/images/2024/RAG-basics-1-cover.jpg\" width=\"256\" alt=\"Google Gemini-generated cover image for: Retrieval augmentation with MLX: A bag full of RAG, part 1\"/\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003ctd\u003e\n  \u003ca href=\"2024/rag-basics1.md\"\u003eRendered markdown\u003c/a\u003e\u003cbr\u003e\n  \u003ca href=\"https://www.linkedin.com/pulse/retrieval-augmentation-mlx-bag-full-rag-part-1-oori-data-tc83c\"\u003eLinkedIn version\u003c/a\u003e\u003cbr\u003e\n  \u003ca href=\"2024/rag-basics1.ipynb\"\u003eJupyter notebook\u003c/a\u003e\n  \u003c/td\u003e\n\u003c/tr\u003e\u003c/table\u003e\n\n## Retrieval augmentation with MLX: A bag full of RAG, part 2\n\n\u003ctable\u003e\u003ctr\u003e\n  \u003ctd\u003e\u003ca href=\"2024/rag-basics2.md\"\u003e\u003cimg src=\"assets/images/2024/RAG-basics-2-cover.jpg\" width=\"256\" alt=\"Google Gemini-generated cover image for: Retrieval augmentation with MLX: A bag full of RAG, part 2\"/\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003ctd\u003e\n  \u003ca href=\"2024/rag-basics2.md\"\u003eRendered markdown\u003c/a\u003e\u003cbr\u003e\n  \u003ca href=\"https://www.linkedin.com/pulse/retrieval-augmentation-mlx-bag-full-rag-part-2-oori-data-rgcxc\"\u003eLinkedIn version\u003c/a\u003e\u003cbr\u003e\n  \u003ca href=\"2024/rag-basics2.ipynb\"\u003eJupyter notebook\u003c/a\u003e\n  \u003c!--\n  Jupyter notebook: In Progress…\n  --\u003e\n  \u003c/td\u003e\n\u003c/tr\u003e\u003c/table\u003e\n\n# More (up to date) MLX resources\n\n\u003c!-- ## Synchronizing markdown article \u0026 notebook formats --\u003e\n\n* [MLX home page](https://github.com/ml-explore/mlx)\n* [Hugging Face MLX community](https://huggingface.co/mlx-community)\n* [Using MLX at Hugging Face](https://huggingface.co/docs/hub/en/mlx)\n* [MLX Text-completion Finetuning Notebook](https://github.com/mark-lord/MLX-text-completion-notebook)\n* [MLX Tuning Fork—Framework for parameterized large language model (Q)LoRa fine-tuning using mlx, mlx_lm, and OgbujiPT. Architecture for systematic running of easily parameterized fine-tunes](https://github.com/chimezie/mlx-tuning-fork)\n\n# A few general notes\n\n* For the many chat formats already charted out in llama.cpp, see the `@register_chat_format` decorated functions in [llama_chat_format.py](https://github.com/abetlen/llama-cpp-python/blob/main/llama_cpp/llama_chat_format.py)\n\n## To do, or figure out\n\n* [any grammar/ebnf support a la llama.cpp](https://christophergs.com/blog/running-open-source-llms-in-python#grammar)?\n* Alternate LLM sampling methods\n* Steering vectors\n\n# Syncing articles to notebooks\n\nUse [Jupytext](https://jupytext.readthedocs.io/en/latest/) to convert the `.md` articles to `.ipynb` notebooks:\n\n```sh\njupytext --to ipynb 2024/MLX-day-one.md\n```\n\nMay have to convert cells using plain `pip` to use `%pip` instead. It also doesn't seem to check the format metadata, so you might need to convert non-Python cells back to Markdown by hand.\n\n# License\n\nShield: [![CC BY 4.0][cc-by-shield]][cc-by]\n\nThis work is licensed under a\n[Creative Commons Attribution 4.0 International License][cc-by].\n\n[![CC BY 4.0][cc-by-image]][cc-by]\n\n[cc-by]: http://creativecommons.org/licenses/by/4.0/\n[cc-by-image]: https://i.creativecommons.org/l/by/4.0/88x31.png\n[cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg\n\nSee also: https://github.com/santisoler/cc-licenses?tab=readme-ov-file#cc-attribution-40-international\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuogbuji%2Fmlx-notes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuogbuji%2Fmlx-notes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuogbuji%2Fmlx-notes/lists"}