$ account StanfordBDHG
HealthGPT is an iOS application that enables users to interact with their Apple Health data using large language models (LLMs) in a conversational interface. Built on the Stanford Spezi modular framework, the app supports three LLM execution modes: remote OpenAI (GPT-3.5/4), on-device local models (Llama3 via MLX), and privacy-preserving fog nodes within the local network. The architecture follows a monolith application pattern with clear separation of concerns: HealthDataFetcher queries HealthKit for steps, sleep, heart rate, etc.; HealthDataInterpreter prepares the LLM context with a system prompt generated from the fetched data; and the SwiftUI ChatView manages the conversation flow. External dependencies include Spezi modules (HealthKit, LLM, Onboarding, Storage) and OpenAI API. The codebase is well-structured with SwiftLint enforcement, comprehensive UI and unit tests, CI/CD pipelines via GitHub Actions and Fastlane, and an automated TestFlight deployment workflow. While the app is tightly coupled to the iOS ecosystem and Apple HealthKit, the data fetching, prompt generation, and LLM orchestration patterns are cleanly abstracted and potentially reusable in other health-related Swift applications.