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
| """ | |
| The most atomic way to train and run inference for a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
| FROM python:3.10 as python-base | |
| # https://python-poetry.org/docs#ci-recommendations | |
| ENV POETRY_VERSION=1.2.0 | |
| ENV POETRY_HOME=/opt/poetry | |
| ENV POETRY_VENV=/opt/poetry-venv | |
| # Tell Poetry where to place its cache and virtual environment | |
| ENV POETRY_CACHE_DIR=/opt/.cache |
| import Fastify from 'fastify'; | |
| import { App, FileInstallationStore, LogLevel } from '@slack/bolt'; | |
| import { FileStateStore } from '@slack/oauth'; | |
| import { FastifyReceiver } from 'slack-bolt-fastify'; | |
| const fastify = Fastify({ logger: true }); | |
| fastify.get('/', async (_, res) => { | |
| res.redirect('/slack/install'); | |
| }); |
| // forked from: https://github.com/chebyrash/cors | |
| addEventListener("fetch", event => { | |
| event.respondWith(handleRequest(event.request)) | |
| }) | |
| async function handleRequest(request) { | |
| try { | |
| const url = new URL(request.url); | |
| if (url.pathname === "/") { |
| import { Directive, HostListener } from '@angular/core'; | |
| @Directive({ | |
| selector: '[appNoDblClickMat]' | |
| }) | |
| export class NoDblClickDirectiveMat { | |
| constructor() { } | |
| @HostListener('click', ['$event']) |