Great video from Syntax Youtube channel on building an LLM from scratch.
Here is a link to a copy/fork of the code he developed for this exercise.
Welcome to Moments In Digital Ink, where everyday experiences are captured and shared through the power of words. Discover heartfelt stories, thought-provoking insights, and creative musings that inspire and entertain. Explore heartfelt stories and inspiring insights at Moments In Digital Ink. This blog captures everyday experiences through engaging narratives and creative musings. Join us on a journey of reflection, inspiration, and connection.
Great video from Syntax Youtube channel on building an LLM from scratch.
Here is a link to a copy/fork of the code he developed for this exercise.
General setup notes on my running Gemma 4 locally, using the hardware l have:
The file size of gemma-4-e4b-it-BF16.gguf is approximately 15.1 GB (or about 15.05 GB to 15.1 GB on disk).
BF16)num_ctx parameter. /set parameter num_ctx 32768
Method 2: Permanent Custom Model fileTo avoid typing it every time, you can bake it directly into a custom model:Create a blank text file named Modelfile. Paste the following lines (point it to your downloaded GGUF file path):dockerfileFROM /path/to/gemma-4-e4b-it-BF16.gguf
PARAMETER num_ctx 32768
Save the file, open your terminal, and build the model:bash
ollama create gemma4-32k -f ./Modelfile
Run your brand new custom model:bash
ollama run gemma4-32k
For a laptop with 8GB VRAM and 32GB RAM, the absolute best choice is a 7B or 8B parameter model quantized to 4-bit (Q4_K_M), or a smaller 3B to 4B parameter model in high precision.The 8GB VRAM is the primary bottleneck. To keep generation speeds fast, the entire model plus its context memory must fit inside that 8GB window. If a model exceeds 8GB, Ollama will split it into your system RAM, causing speeds to drop drastically.Top Model Recommendations- Llama 3.1 8B (Q4_K_M variant): This is the best all-rounder for an 8GB GPU. At 4-bit quantization, the model takes up roughly 4.8 GB of VRAM, leaving you over 3 GB of room for a comfortable 8K to 16K context window. It excels at reasoning, coding, and general conversation.
- Gemma 2 9B (Q4_K_M variant): An incredibly powerful model that often punches above its weight class. The file size is around 5.5 GB, which fits safely in your VRAM. However, because its architecture uses more memory during generation, you will need to cap your context window at 4K to 8K to avoid spilling over into system RAM.
- Phi-3.5-mini 3.8B (High precision / FP16): If you need to process massive documents or long codebases, this is your best option. The model is tiny (~7.6 GB unquantized or under 3 GB if quantized), allowing you to scale the context window up to 32K or higher without running out of VRAM
Performance Outlook for This Setup
Model Selection VRAM Usage Speed Expectation Best Use Case 8B Models (Q4_K_M) ~4.8 GB – 5.5 GB Fast (40+ tokens/sec) Coding, logic, everyday tasks 3B–4B Models (Q8 / FP16) ~3.0 GB – 7.5 GB Blazing Fast (60+ tokens/sec) Long documents, low battery usage 14B+ Models (Any format) Exceeds 8 GB Very Slow (Spills to RAM) Not recommended for daily fluid use
Below are some great videos on using the Nvidia Jetson Orin
1)
NVIDIA Jetson Orin Nano: Secret to Running Ollama on the GPU on Jetpack 7.2, by Paul McWhorter of toptechboy.com
2)
How to Run YOLO 26 Detection Models on the NVIDIA Jetson Orin Nano, by Edje Electronics Channel
Links for Nvidia - Exploring LLMs with Nvidia Jetson Nano, Orin:
1)
Getting Started with Edge AI on NVIDIA Jetson: LLMs, VLMs, and Foundation Models for Robotics
2)
3)
Khalil BenKhaled - Technical Blog
4_
Nvidia Developer Website Home page
Models for JEtso ORin
https://www.jetson-ai-lab.com/models/
Understand AI in 14 minutes, with Anthropic's Chloe Lubinski at ARC 2026 event.
What to teach when AI writes the code by Rainer Stropek via TEDxLinz
Great video from Syntax Youtube channel on building an LLM from scratch. Here is a link to a copy/fork of the code he developed for this ex...