BrainBank

Mac Studio 24/7 AI Workhorse Manual Revised

8/2/2026, 10:46:52 PM · updated 8/2/2026, 10:49:10 PM

#automation#orchestration#best-practices#ollama#mac-studio#local-llm#resource-management#model-routing#self-hosting#mlx-framework#observability

A practical playbook for turning a Mac Studio M3 Ultra into a reliable 24/7 private AI service using smart model routing, admission control, durable job queues, and scheduled observability to produce real outputs without constant GPU activity.

Mac_Studio_24x7_AI_Workhorse_Concise_Guide

Mac Studio 24/7 AI Workhorse — Concise Guide

Platform: Mac Studio M3 Ultra, 96 GB unified memory, 2 TB AI_DATA volume
Goal: Operate a dependable private AI service that runs useful scheduled work with minimal attention.
Core principle: Keep the control plane available; load expensive models only when a task requires them.


1. Target Operating Model

This system should become more than a local chatbot. It should:

  • Serve trusted users and applications.
  • Run scheduled jobs and monitor selected sources.
  • Maintain searchable knowledge collections.
  • Extract, classify, summarize, and reconcile information.
  • Route simple work to small models and difficult work to larger models.
  • Record jobs, changes, failures, outputs, and required human decisions.

The machine becomes a workhorse when it produces validated outputs while unattended—not when it merely keeps models loaded.

Daily success pattern

Core services recover after reboot; health checks run continuously; approved data and documents synchronize and index; models are routed by task complexity; and a morning brief reports outputs, failures, insights, and decisions. Heavy work runs only after policy, capacity, and approval checks.


2. Architecture and Access

d81d556a-2df0-4199-af9d-0da54b5e3bd0.jpg

Rendering diagram…
LayerComponentRoleNormal state
Private accessTailscaleTrusted-device networkAlways on
Public ingressTailscale FunnelControlled public pathOnly when required
API controlGateway :8787Keys, authorization, rate limits, routing, heavy gateAlways on
Model runtimeOllama :11434Default and heavy local modelsAvailable; selective loading
Apple runtimeMLXFast, speech, reranking, and media workloadsWorkers on demand
InterfaceOpen WebUI :8080Chat and knowledge-bank UIOn if regularly used
Agent runtimeFastAPI :8788RAG, tools, memory, feedback, multi-step workAlways on after stabilization
Schedulinglaunchd, GitHub Actions, InngestRecurring and event-driven jobsBy job ownership
DataAI_DATA and knowledge bankModels, sources, indexes, logs, outputsMounted and monitored

Public-access rule

Application → Funnel → authenticated gateway → router → approved service

Do not expose Ollama, MLX, Open WebUI, databases, or the agent server directly to the public internet. Funnel supplies reachability; the gateway supplies identity, authorization, workload policy, and rate control.

Existing control systems

  • ai-stack: Ollama, Open WebUI, gateway, and Funnel.
  • agent-server: FastAPI retrieval, tools, memory, and agent harness.
  • AI Local Server: gateway, keys, routing, and heavy-model policy only.

Observe all three in one dashboard, but keep their restart controls independent.


3. Model Portfolio and Routing

FunctionModelDecisionOperating policy
FastQwen3.5-9BAdded and testedRouting, tagging, extraction, short answers, background volume
DefaultQwen3.6-35B-A3BKeptDaily chat, analysis, vision, agent reasoning, most coding
Heavy codingQwen3-Coder-NextAdded; test pendingLoad after unloading conflicts; promote only after regression tests
Heavy reasoninggpt-oss-120BKeptExclusive mode; explicit confirmation required
Heavy candidateQwen3.5-122B-A10BAdded; bake-off pendingReplace gpt-oss only if repeatable tests show better value
VisionQwen3-VL-30BTemporaryRetire only after default-model vision parity testing
SpeechWhisper large-v3-turbo / Qwen3-TTSKept / addedTranscription and voice output on demand
RAGnomic-embed-text / Qwen3 RerankerKept / addedIndex documents and refine retrieved passages
MediaFLUX.2 Klein / LTX-2.3AddedOn-demand image and exclusive/scheduled video generation

Routing policy

Use scripts for exact work; 9B for classification and extraction; 35B for synthesis, RAG, and most coding; and heavy models only when a quality test or human request justifies them. Require sources for analytical claims and approval for external actions.


4. Preventing Resource Overrun

The 96 GB memory pool is shared by macOS, model weights, KV cache, applications, and file processing. Protect it at several levels.

Existing safeguards

  • GPU wired-memory limit is approximately 88 GB, while preserving an OS reserve.
  • Ollama limits simultaneously loaded models and unloads inactive models through keep-alive settings.
  • Heavy requests require X-Confirm-Heavy: yes; otherwise the gateway returns HTTP 428 Precondition Required.
  • Large coding, reasoning, and media models load only when needed.
  • Heavy-model context should remain at or below 32K until measurements support more.

Add next

  • Admission control: Check memory, swap, loaded models, queue, active sessions, disk, UPS state, and temperature before heavy work.
  • Durable queue: Permit only one heavy-exclusive job at a time.
  • Timeouts: Give every job a deadline, retry ceiling, and cancellation path.
  • Concurrency classes: Separate limits for light, default, embedding, speech, image, video, and heavy work.
  • Circuit breaker: Pause a repeatedly failing model or data source.
  • Backpressure: Queue or return HTTP 429 rather than accept unsafe concurrency.
  • Disk watermarks: Warn at 20% free and stop nonessential downloads/generation at 10%.
ModeServices and workloads
NormalGateway, UI, agent server, retrieval, and default model as needed
BatchControlled ingestion, embeddings, transcription, and reports
Heavy exclusiveMinimum control services plus one 120B, heavy-code, or video job
MaintenanceMonitoring, backups, upgrades, index repair, and model tests

5. High-Value 24/7 Work

Financial data

Synchronize USAspending; consolidate Files A, B, and C; reconcile row counts and dollars; and flag expiring funds, pacing risks, missing relationships, and source changes.

Knowledge operations

Watch approved directories; extract text and metadata; manage duplicates and versions; update embeddings and indexes; and report failed ingestion, stale locks, and unindexed files.

Technology monitoring

Monitor relevant AI labs, GitHub, Hugging Face, and local runtimes. Use 9B to classify relevance and 35B to explain material impact in a focused brief.

Document and software work

Extract decisions, risks, actions, and contradictions; retrieve evidence; draft briefings; run repository tests and dependency reviews; and keep external actions behind approval.

Personal learning

Convert notes into linked concepts, identify contradictions, generate review prompts, and summarize how understanding changed.


6. Recommended Job Schedule

FrequencyJobWorkerOutput
5 minutesService and port healthScriptHealth and incident state
15 minutesMemory, swap, disk, queue, thermal, powerScriptCapacity status
File changeApproved knowledge ingestionEmbedding pipelineUpdated index and log
Daily 06:00USAspending synchronizationScriptNew files and status
After arrivalConsolidation and reconciliationPython pipelineValidated datasets
Daily 07:00AI and repository monitoringFast modelRelevant changes
Daily 07:30Operations briefDefault modelJobs, failures, changes, decisions
NightlyBackup and integrity checkScriptBackup exceptions
WeeklyKnowledge quality auditFast/defaultDuplicates, stale items, weak metadata
WeeklyModel regression suiteSelected modelsQuality, latency, memory, errors
On demand120B reasoning or videoHeavy-exclusive workerApproved high-compute output

c4b02197-9017-4038-933a-7d9355069615.jpg

7. Practical 30-Day Build Plan

Days 1–7 — Stabilize

  • Create a machine-readable service registry: name, port, commands, health URL, logs, dependencies, owner, and restart policy.
  • Add launchd restart controls and wait for AI_DATA and networking before startup.
  • Verify graceful shutdown and reboot recovery.
  • Fix the wiki-ingest stale lock, rerun the failed FY2026 synchronization, and quarantine obsolete scripts.

Exit: Core services recover automatically, avoid restart loops, and record useful failure reasons.

Days 8–14 — Observe

Build a lightweight status API and SQLite-backed dashboard. Show overall state; services and errors; loaded models, memory, requests, and latency; job status; memory, swap, disk, CPU/GPU, and temperature; data freshness and reconciliation; and authentication, rate-limit, Funnel, and heavy-gate events.

Days 15–21 — Orchestrate

Add a durable job record containing ID, type, priority, resource class, model, input reference, timestamps, timeout, retries, status, structured error, output location, approval flag, and idempotency key.

Use resource classes: light, default, embedding, speech, image, video, and heavy-exclusive.

Days 22–30 — Produce

Generate a Daily AI Operations Brief covering overnight health, job outcomes, USAspending reconciliation, relevant AI releases, knowledge changes, anomalies, and recommended actions.

This brief is the proof of productivity. Running all night without producing decision support is not success.


8. Standard Job Flow

Rendering diagram…

9. Security, Reliability, and Power

  • Bind backends to localhost or the private Tailnet; expose only the gateway through Funnel.
  • Use separate application keys, model permissions, and rate limits; rotate keys and never log secrets.
  • Disable Funnel when public access is unnecessary.
  • Separate public, personal, work-sensitive, and restricted knowledge collections.
  • Allow-list ingestion paths and record source, time, hash, and version.
  • Use least-privilege tools, timeouts, retry limits, and output-size limits for every job.
  • Preserve source files and transformation logs; treat generated output as draft unless validated.
  • Evaluate model upgrades before changing defaults.
  • Encrypt backups and test restoration.
  • Connect the Mac Studio and storage to the UPS; test safe shutdown and recovery.
  • Delay heavy jobs until network, storage, memory, thermal, and power checks pass.

Local hosting improves control but does not by itself establish compliance for organizational or restricted data.

Initial reliability targets

MeasureTarget
Gateway availability99% monthly
Recovery after rebootWithin 10 minutes
Scheduled-job successAt least 95%
Failed-job visibilityWithin 5 minutes
Heavy-job concurrencyExactly one
Disk warning / critical20% / 10% free
BackupDaily incremental; weekly restore sample
Financial output100% reconciliation before release
Default-model changeRegression test and documented decision

10. Terminology Index

TermMeaning
Admission controllerChecks capacity and policy before a job starts
API gatewayAuthenticates, limits, and routes requests to internal services
BackpressureQueues or rejects work when capacity is full
Circuit breakerStops calls to a repeatedly failing dependency
Context windowTokens a model can consider in one request
EmbeddingVector representation used for semantic retrieval
FunnelTailscale feature that exposes a selected endpoint publicly
IdempotentSafe to repeat without duplicate effects
InferenceRunning a trained model to generate output
Job queueDurable record of waiting and running work
KV cacheRuntime attention memory that grows with context and concurrency
ObservabilityLogs, metrics, events, and alerts that explain system behavior
QuantizationLower-precision weights that reduce memory use
RAGRetrieves evidence before generating an answer
ReconciliationVerifies transformed totals and counts against sources
RerankerReorders retrieved passages by relevance
Resident modelModel currently loaded in memory
Resource classJob label defining memory, concurrency, and approval policy
SLOMeasurable reliability objective
TailnetPrivate network of authenticated Tailscale devices
Unified memoryApple memory shared by CPU, GPU, and applications
WorkerProcess that executes a queued job

11. Immediate Checklist

This week

  • Fix the wiki-ingest lock and rerun the FY2026 USAspending job.
  • Verify reboot-to-healthy and UPS shutdown/recovery.
  • Create the service registry.
  • Collect service, memory, swap, disk, queue, and power status.

Next two weeks

  • Build the operator dashboard and durable job schema.
  • Add admission control and one heavy-exclusive queue.
  • Run the Coder-Next test, vision parity test, and 122B bake-off.
  • Add backup verification and disk watermarks.

By Day 30

  • Generate the Daily AI Operations Brief automatically.
  • Measure uptime, failures, latency, model use, and useful outputs for one week.
  • Remove models and services without a demonstrated workload.
  • Document normal, batch, heavy, maintenance, and recovery procedures.

Final Direction

The machine already has sufficient model capability. The next advantage comes from orchestration: reliable startup, controlled routing, durable queues, trusted data, observability, evaluation, and repeatable outputs.

The objective is not continuous GPU activity. It is a system that remains available, recognizes useful work, selects the smallest capable resource, preserves evidence, escalates safely, and tells its operator what matters.

Source: Mac_Studio_24x7_AI_Workhorse_Concise_Guide.md

Learning map

Staged Roadmap

Phase 1 — Stabilize (Days 1–7)

  • Create a machine-readable service registry (name, port, health URL, logs, dependencies)
  • Add launchd restart controls with AI_DATA and network readiness checks
  • Verify graceful shutdown and reboot recovery
  • Quarantine obsolete scripts; fix stale locks

Phase 2 — Observe (Days 8–14)

  • Build a lightweight status API backed by SQLite
  • Display: overall state, model load count, memory/swap/disk/CPU/GPU/temp, queue depth, job outcomes
  • Track data freshness and reconciliation results

Phase 3 — Orchestrate (Days 15–21)

  • Implement a durable job schema with idempotency keys
  • Add admission control: capacity + policy checks before work starts
  • Define resource classes: light / default / embedding / speech / image / video / heavy-exclusive
  • Enforce concurrency limits; set timeouts and retry ceilings

Phase 4 — Produce (Days 22–30)

  • Generate an automated daily operations brief
  • Model routing: small models for classification/extraction, larger models for synthesis/RAG, heavy models only on confirmation
  • Implement circuit breakers on failing sources and backpressure via HTTP 429
  • Document all modes: normal, batch, heavy, maintenance, recovery

Get hands-on — step by step

  1. Create a service registry file (JSON or YAML) listing every component with its port, health-check URL, log path, restart command, and owner.

  2. Write launchd plist files for each service with 'RunAtLoad', KeepAlive, EnvironmentVariables for AI_DATA mount detection, and WatchPaths for networking readiness.

  3. Create a health-check script that curls every service's /health endpoint, records the results in SQLite with timestamps, and alerts on failures over 5 minutes.

  4. Set Ollama keep-alive settings to auto-unload models after 10 minutes of inactivity; verify only the default model (Qwen3.6-35B-A3B) remains loaded during normal operation.

  5. Build an admission control function that checks memory usage, swap status, queue depth, disk free space, and thermal readings before accepting a heavy-weight job.

  6. Implement a durable job queue table with columns: id (UUID), type, priority, resource_class, model, input_ref, created_at, timeout_seconds, retry_count, max_retries, status, error_json, output_path, requires_approval, idempotency_key.

  7. Write the model-routing logic using if/elif chains: classify the request → route to 9B for extraction/tagging, 35B for synthesis/RAG/coding, or require X-Confirm-Heavy header for models above 30B parameters.

  8. Add a circuit-breaker that tracks consecutive failures per dependency; after 3 failures in 1 hour, pause that service and schedule a retry with exponential backoff.

  9. Schedule daily jobs via launchd at 06:00 (financial sync), 07:00 (AI monitoring), 07:30 (operations brief output), and nightly for backup + integrity verification.

  10. Test the full cycle: trigger a job through the API gateway with proper auth key, verify admission control passes, confirm the worker executes, validate and store the result, then check the day's dashboard reflects everything correctly.

Top 3 sources

  1. 1
    Ollama Documentation

    Official guidance on running local models locally, including model management and API reference for integration.

    https://ollama.com/blog

  2. 2
    MLX Framework Documentation

    Apple's machine-learning framework optimized for Apple Silicon, enabling fast inference and model workflows on Mac.

    https://ml-explore.github.io/mlx/

  3. 3
    Tailscale Administration Guide

    Documentation for setting up a private network with Tailscale Funnel, critical for secure external access to local AI services.

    https://tailscale.com/kb/1017/install

Links are AI-suggested — worth a quick sanity check before diving in.