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
| // Inspired by https://gist.github.com/tzachz/419478fc8b009e953f5e5dc39f3f3a2a | |
| // Task creates a .dot file with all inter-module dependencies | |
| // Supports any depth of nested modules | |
| task moduleDependencyReport { | |
| doLast { | |
| def file = new File("project-dependencies.dot") | |
| file.delete() | |
| file << "strict digraph {\n" | |
| file << "splines=ortho\n" |
| r := mux.NewRouter() | |
| // Single handler | |
| r.HandleFunc("/form", use(http.HandlerFunc(formHandler), csrf, logging) | |
| // All handlers | |
| http.Handle("/", recovery(r)) | |
| // Sub-routers | |
| apiMiddleware := []func(http.Handler) http.Handler{logging, apiAuth, json} |