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
| import ARKit | |
| import CoreHaptics | |
| import GameController | |
| import RealityKit | |
| import SwiftUI | |
| struct ImmersiveLaserPenMeasurementView: View { | |
| @State private var stylusManager = StylusLaserPenManager() | |
| var body: some View { |
| import SwiftUI | |
| @MainActor | |
| @Observable | |
| class AppModel { | |
| let immersiveSpaceID = "ImmersiveSpace" | |
| enum ImmersiveSpaceState { | |
| case closed | |
| case inTransition | |
| case open |
| import Foundation | |
| enum EasingCurve { | |
| case linear | |
| case easeIn(Float) | |
| case easeOut(Float) | |
| case easeInOut(Float) | |
| func apply(_ t: Float) -> Float { | |
| let t = max(0, min(1, t)) |
| #ifndef HeightMapParams_h | |
| #define HeightMapParams_h | |
| struct HeightMapParams { | |
| simd_float2 size; | |
| simd_uint2 dimensions; | |
| }; | |
| #endif /* HeightMapParams_h */ |
| if (new URLSearchParams(window.location.search).get('portal')) { | |
| // <create start portal> | |
| // Create portal group to contain all portal elements | |
| const startPortalGroup = new THREE.Group(); | |
| startPortalGroup.position.set(SPAWN_POINT_X, SPAWN_POINT_Y, SPAWN_POINT_Z); | |
| startPortalGroup.rotation.x = 0.35; | |
| startPortalGroup.rotation.y = 0; | |
| // Create portal effect |
| import Foundation | |
| import SwiftData | |
| import WidgetKit | |
| import os | |
| @ModelActor final actor DataMonitor { | |
| private var logger: Logger { | |
| Loggable.getLogger(Self.self) | |
| } | |
| import RealityKit | |
| import SwiftUI | |
| struct DiscoBallRealityView: View { | |
| @State private var currentEntity: Entity? | |
| @State private var morphFactor: Float = 0.0 | |
| @State private var frameDuration: TimeInterval = 0.0 | |
| @State private var lastUpdateTime = CACurrentMediaTime() | |
| static let animationFrameDuration: TimeInterval = 1.0 / 120.0 |