{"id":28100768,"url":"https://github.com/poloclub/fine-tuning-llms","last_synced_at":"2025-06-17T19:34:47.487Z","repository":{"id":237514485,"uuid":"794571789","full_name":"poloclub/Fine-tuning-LLMs","owner":"poloclub","description":"Finetune Llama 2 on Colab for free on your own data: step-by-step tutorial","archived":false,"fork":false,"pushed_at":"2024-05-03T03:45:17.000Z","size":9568,"stargazers_count":36,"open_issues_count":1,"forks_count":20,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T18:49:48.141Z","etag":null,"topics":["colab","finetuning","llm","tutorial"],"latest_commit_sha":null,"homepage":"https://medium.com/polo-club-of-data-science/fine-tune-llms-for-free-on-custom-text-data-a-step-by-step-tutorial-8a4da6cc83f6","language":"Jupyter Notebook","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/poloclub.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}},"created_at":"2024-05-01T13:46:15.000Z","updated_at":"2025-05-10T09:14:32.000Z","dependencies_parsed_at":"2024-05-03T10:11:35.120Z","dependency_job_id":"706b9b81-54fe-4d39-affd-c4302e45c041","html_url":"https://github.com/poloclub/Fine-tuning-LLMs","commit_stats":null,"previous_names":["sripal1/fine-tuning-llms","poloclub/fine-tuning-llms"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/poloclub/Fine-tuning-LLMs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poloclub%2FFine-tuning-LLMs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poloclub%2FFine-tuning-LLMs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poloclub%2FFine-tuning-LLMs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poloclub%2FFine-tuning-LLMs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poloclub","download_url":"https://codeload.github.com/poloclub/Fine-tuning-LLMs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poloclub%2FFine-tuning-LLMs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260427392,"owners_count":23007498,"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":["colab","finetuning","llm","tutorial"],"created_at":"2025-05-13T18:39:01.436Z","updated_at":"2025-06-17T19:34:42.469Z","avatar_url":"https://github.com/poloclub.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tutorial for fine-tuning LLMs\n\nThis is a tutorial for fine-tuning open source LLMs using QLoRA on your custom private data that is formatted in **raw text** for **free on Google Colab**.\n\n🔗  \u003ca href=\"https://colab.research.google.com/drive/1X51XC2phnD1epk5c1w9J0GnUO0BmrTRM?usp=sharing\"\u003e Google Colab notebook\u003c/a\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \n📄  \u003ca href=\"https://medium.com/polo-club-of-data-science/fine-tune-llms-for-free-on-custom-text-data-a-step-by-step-tutorial-8a4da6cc83f6\"\u003e Fine-tuning guide\u003c/a\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n🧠  \u003ca href=\"https://medium.com/polo-club-of-data-science/memory-requirements-for-fine-tuning-llama-2-80f366cba7f5\"\u003e Memory requirements\u003c/a\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"imgs/llamaCartoon.png\" alt=\"drawing\" width=\"30%\"/\u003e\n\u003c/p\u003e\n\nOpen source LLMs like *Llama-2 7B chat* are useful for applications that involve conversations and **chatbot-like dialogue use cases**. However, these pre-trained models lack specific information due to knowledge cutoffs and do not have knowledge about your private data. Fine-tuning LLMs is a great way to \"teach\" these models your private data while keeping memory requirements low. We'll be using the data about the Hawaii wildfires in August 2023 sourced from the report of the Maui Police department found [here](https://medium.com/r?url=http%3A%2F%2Fwww.mauipolice.com%2Fuploads%2F1%2F3%2F1%2F2%2F131209824%2Fpre_aar_master_copy_final_draft_1.23.24.pdf). We've copied the data of the PDF into multiple text files without any additional formatting. This tutorial uses the Nvidia T4 GPU with **16 GB of VRAM** that is offered in the **free version of Google Colab**. We'll be using a quantization technique- **QLoRA**, for quantizing parameter weights to 4 bits to reduce memory requirements and increase training speed, ensuring that we don't reach the bottleneck memory.\n\n## Getting started\n\nDownload the notebook [here](https://github.com/Sripal1/Fine-tuning-LLMs/blob/main/Fine_tune_LLMs_on_custom_data.ipynb) to run it locally or click [here](https://colab.research.google.com/drive/1X51XC2phnD1epk5c1w9J0GnUO0BmrTRM?usp=sharing) to load it in Google Colab. Then, run all the cells sequentially to get your fine-tuned model!\n\nSince Llama-2 is a gated model, do the following steps to get access to the model:\n\n  1. Create an account in HuggingFace [here](https://huggingface.co/join)\n  2. Request access to the [Llama-2-7b-chat model here](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf).\n\n## Authors and Credits\n\n[Sri Ranganathan Palaniappan](https://www.linkedin.com/in/sri-ranganathan-palaniappan/), CS undergrad student at Georgia Tech.\n\n[Mansi Phute](https://www.linkedin.com/in/mansi-phute-413744166/),  CS masters student at Georgia Tech\n\n[Seongmin Lee](https://www.linkedin.com/in/seongmin-lee-8b8a97209/),  CS PhD student at Georgia Tech\n\n[Polo Chau](https://www.linkedin.com/in/polochau/),  Associate Professor at Georgia Tech.\n\n## Contact\nIf you have any questions, please feel free to reach out to [Sri Ranganathan Palaniappan](mailto:spalaniappan9@gatech.edu?subject=LLM%20Fine-tuning%20tutorial) (BS CS@Georgia Tech).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoloclub%2Ffine-tuning-llms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoloclub%2Ffine-tuning-llms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoloclub%2Ffine-tuning-llms/lists"}