Awesome
<!-- This source file is part of the Stanford HealthGPT project SPDX-FileCopyrightText: 2023 Stanford University & Project Contributors (see CONTRIBUTORS.md) SPDX-License-Identifier: MIT -->HealthGPT
<picture><source media="(prefers-color-scheme: dark)" srcset="Figures/Chat-dark.png"><img src="Figures/Chat.png" width="250" alt="Screenshot showing an example conversation with HealthGPT" /></picture> | <picture><source media="(prefers-color-scheme: dark)" srcset="Figures/Settings-dark.png"><img src="Figures/Settings.png" width="250" alt="Screenshot showing settings for HealthGPT." /></picture> | <picture><source media="(prefers-color-scheme: dark)" srcset="Figures/Export-dark.png"><img src="Figures/Export.png" width="250" alt="Screenshot showing chat export for HealthGPT." /></picture> |
---|---|---|
Example Conversation | Settings | Export Chat |
HealthGPT is an experimental iOS app based on Stanford Spezi that allows users to interact with their health data stored in the Apple Health app using natural language. The application offers an easy-to-extend solution for those looking to make large language model (LLM) powered apps within the Apple Health ecosystem.
HealthGPT is an open-source project of the Stanford Biodesign Digital Health team. The initial prototype based on Spezi and the SpeziTemplateApplication was built by Varun Shenoy.
[!NOTE] Do you want to try HealthGPT? You can download it to your iOS device using TestFlight!
Features
- Extensible architecture built on the Stanford Spezi open-source digital health development framework for easy customization.
- Chat-style interface for user-friendly health data interaction using the SpeziChat module with speech-to-text (recognition) as well as text-to-speech (synthesize) accessibility capabilities and chat export functionality.
- Integration with the Apple Health app via SpeziHealthKit.
- GPT-3.5 + GPT-4 queries through the SpeziLLM module.
- Option for privacy preserving local execution of LLM queries using SpeziLLMLocal with Llama3 8B, including automated download and storage of model files during onboarding.
- Out of the box support for querying sleep, step count, active energy, exercise minutes, heart rate, and body mass.
Disclaimer
HealthGPT is provided for general informational purposes only and is not intended as a substitute for professional medical advice, diagnosis, or treatment. Large language models, such as those provided by OpenAI, are known to hallucinate and at times return false information. The use of HealthGPT is at your own risk. Always consult a qualified healthcare provider for personalized advice regarding your health and well-being. Aggregated HealthKit data for the past 14 days will be uploaded to OpenAI. Please refer to the OpenAI privacy policy for more information.
Set Up
Building and running HealthGPT requires a Mac with Xcode 15.2 or newer installed.
- Clone this repository to your local computer.
- Open
HealthGPT.xcodeproj
in Xcode. Wait for all dependencies to install and indexing to finish. - Run the app (on an iOS device or in the iOS simulator) and play with HealthGPT on your own data 🚀
Note: If you are running HealthGPT using the simulator, you will need to manually add data in the Apple Health app. Otherwise, all of your results will read zero.
You can add queries for additional HealthKit quantities and categories as follows:
- Update the SpeziHealthKit configuration in
HealthGPT/HealthGPT/AppDelegate.swift
to include the additional data type(s). For more information about configuring SpeziHealthKit, please refer to the official documentation. - Edit
HealthGPT/HealthGPT/HealthDataFetcher.swift
to create appropriate query for your data type(s). - Update the prompt in
HealthGPT/HealthGPT/PromptGenerator.swift
to pass the newly acquired data to the OpenAI API.
Contributing
Contributions to this project are welcome. Please make sure to read the contribution guidelines and the contributor covenant code of conduct first.
You can find a list of contributors in the CONTRIBUTORS.md
file.
License
This project is licensed under the MIT License. See Licenses for more information.