Vigyata.AI
Is this your channel?

Deepseek R1 Fine Tuning [ How to Fine Tune LLM ] Parameter Efficient Fine Tuning LORA Unsloth Ollama

18.1K views· 353 likes· 10:24· Feb 12, 2025

🛍️ Products Mentioned (14)

Do you know how to fine-tune DeepSeek R1 on custom data and save the fine-tuned model locally using Ollama? In this video, I will show you the entire process step by step. What You Will Learn: 1. How to fine-tune DeepSeek Mete LLaMA distillation model 2. How to load and train it using Unsloth on a GPT-4-generated dataset 3. How to save the fine-tuned model locally using Ollama 4. How to chat with the fine-tuned model What is DeepSeek R1? DeepSeek R1 is a logical reasoning model derived from DeepSeek V3. It is trained using Chain of Thought (CoT) datasets to improve its problem-solving skills. It first thinks through a problem before generating an answer. If you want a deep dive into DeepSeek R1’s architecture, check out my previous video where I explain the DeepSeek research paper in simple language. The link is available in the description. Tools Used in Fine-Tuning: 1. Unsloth: Optimises fine-tuning by performing efficient matrix multiplications. 2. Ollama: A local LLM runtime to load and interact with models easily. Fine-Tuning Process: 1. Load the Model & Tokeniser: Using Unsloth, we load the DeepSeek R1 distilled LLaMA-8B model along with its tokeniser. 2. Apply Parameter-Efficient Fine-Tuning (PEFT): We use LoRA (Low-Rank Adaptation) to fine-tune the model efficiently without modifying all parameters. 3. Prepare Training Dataset: The vicgalle/alpaca-gpt4 dataset is formatted into a conversation-friendly structure for training. 4. Train the Model Using SFTTrainer: This ensures the model learns from human-like conversations. 5. Save the Fine-Tuned Model with Ollama: We package the trained model and save it locally for offline AI interactions. 6. Chat with the Fine-Tuned Model: We use Ollama's chat function to interact with the model and test its reasoning capabilities. If you found this video helpful, like and subscribe for more AI and machine learning tutorials. Let me know in the comments if you have any questions! Source Code: https://github.com/simranjeet97/DeepSeekR1_GoogleGeminiPro_RAG_Streamlit/blob/main/deepseekv3-finetuning-ipynb%20(1).ipynb Join this channel to get access to perks: https://www.youtube.com/channel/UC4RZP6hNT5gMlWCm0NDzUWg/join Don’t forget to: Like this video, subscribe to the channel and Comment your thoughts or questions To get the Source Code, Follow me on GitHub: https://github.com/simranjeet97/ Book your call with me at topmate.io and learn how to harness the latest technologies power and speed up your learning process. Book your call at https://bit.ly/43TLDCD Follow me on Medium for the latest blogs and projects: https://bit.ly/3JGXqwc Playlists that make you skilled up 1. GenAI Full Course with LLM Fine Tuning and Evaluation: https://bit.ly/4bJwZla 2. Learn RAG from scratch with GenAI projects: https://bit.ly/3Zl47KD 3. Latest AI/GenAI Research Papers Explained: https://bit.ly/4huqEMT 4. RAG and LLM Use Cases in Finance Domain Projects: https://bit.ly/3AGSRQm 4. Prompt Engineering: https://bit.ly/42v376M 5. Financial Data Analysis and Financial Modelling: https://bit.ly/3OCWI5O 6. Artificial Intelligence Projects: https://bit.ly/3L8lhEi 7. Predict IPL 2023 Winner (End to End Data Science Project): https://bit.ly/3BfC3N9 8. Explainable AI (XAI) Machine Learning: https://bit.ly/3gsuIxb 9. Face Recognition: https://bit.ly/2YphpHm Youtube Tags: genai projects, Generative ai projects, genai project, generative ai project, Deepseek r1, nvidia, deepeek v3, deepseek r1 ollama project, deepseek r1 rag llm ollama, google gemini pro, google gemini flash, google gemini, google gemini pro 2, deepseek genai project, deepseek genai agent, deepseek genai rag llm project, LLM fine tuning, how to fine tune llm, how to fine tune deepseek r1, deepseek r1 fine tuning, parameter efficient fine tuning, LORA and QLORA, supervised fine tuning, unsloth deepseek distill, ollama deepseek r1,

About This Video

In this video, I walk you through a full, practical fine-tuning pipeline for DeepSeek R1 (the distilled LLaMA-8B variant) on custom-style instruction data—then I show you how to save that tuned model locally and actually use it. The key idea is simple: you don’t need to touch every parameter to get strong task adaptation. I use parameter-efficient fine-tuning (LoRA/PEFT) so you can train faster, cheaper, and with less GPU pain, while still getting meaningful behavior changes. I start by loading the DeepSeek R1 distilled model + tokenizer using Unsloth, because it’s built to make the fine-tuning loop efficient (better matrix ops, less overhead). Then I prep a GPT-4-generated instruction dataset (vicgalle/alpaca-gpt4) into a conversation-friendly format and run supervised fine-tuning using SFTTrainer. After training, the important system-design step is deployment: I package and save the fine-tuned model into Ollama so it lives on your machine and you can chat with it offline. By the end, you’ll have a local workflow: fine-tune → export → run in Ollama → test reasoning and responses end-to-end.

Frequently Asked Questions

🎬 More from FreeBirds Crew - Data Science and GenAI