April 2026 TLDR setup for Ollama + Gemma 4 on a Mac mini (Apple Silicon) — auto-start, preload, and keep-alive
- Mac mini with Apple Silicon (M1/M2/M3/M4/M5)
- At least 16GB unified memory for Gemma 4 (default 8B)
- macOS with Homebrew installed
April 2026 TLDR setup for Ollama + Gemma 4 on a Mac mini (Apple Silicon) — auto-start, preload, and keep-alive
I have been utilizing artificial intelligence to enhance and optimize my codebases. After evaluating various models, applications, and editors, I find the claude.ai interface with a Pro Account to be the most effective. Here’s the approach I’ve developed to achieve optimal results:
This gist contains a carefully crafted prompt and a script designed to convert your entire Laravel codebase (excluding the resources folder, which can be easily added if needed) into a TXT file with the following structure:
<File Start: ./path/filename.extension> Content of file <End File: ./path/filename.extension>
To implement this method:
| #!/bin/bash | |
| BOT_TOKEN="<token>" | |
| CHAT_ID="<id>" | |
| TELEGRAM_USERNAME="<username>" | |
| send_telegram_message() { | |
| local message="$1" | |
| curl -s -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendMessage" \ | |
| -d chat_id="$CHAT_ID" \ |
| How to Build a Bitcoin Full Node on a Raspberry Pi 3. | |
| What is a Bitcoin Full Node? | |
| ------------------------------- | |
| A Bitcoin full node is much simpler than it sounds. | |
| A full node is simply a computer that is running the Bitcoin Core Wallet. | |
| The Bitcoin Core Wallet, by default, downloads a full copy of the Blockchain. | |
| A. You'll need a 1 TB Hard Drive as of 18.12.2023, its circa 534 GB see https://www.blockchain.com/explorer/charts/blocks-size |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
| This ensures you have npm setup and configured correctly on osx. | |
| see http://dreamerslab.com/blog/en/npm-basic-commands/ | |
| see https://www.sitepoint.com/beginners-guide-node-package-manager/ | |
| npm config ls -l | |
| npm config set loglevel info | |
| npm config set registry http://registry.npmjs.org/ | |
| npm set progress=false | |
| npm install --verbose |
| Pre-requisite: brew | |
| NOTE: This install is based on nvm: | |
| see http://dev.topheman.com/install-nvm-with-homebrew-to-use-multiple-versions-of-node-and-iojs-easily/ | |
| see also http://stackoverflow.com/questions/28017374/what-is-the-suggested-way-to-install-brew-node-js-io-js-nvm-npm-on-os-x | |
| 1. brew update | |
| 2. brew install nvm | |
| 3. Create NVM's working directory if it doesn't exist: | |
| mkdir ~/.nvm |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
If you'd like to experiment with Terraform and Kubernetes on macOS locally, a great provider for doing so is the Kubernetes provider. You can get set up in a few simple steps, like so:
Install Docker for Mac if you have not already.
| Remove Java from the Apple System Preferences Pane | |
| ---------------------------------------------------- | |
| sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin | |
| sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane | |
| sudo rm -fr ~/Library/Application\ Support/Oracle/Java | |
| Install with Homebrew | |
| --------------------- | |
| install Homebrew if you haven't already. Make sure it is updated: |