-
-
Notifications
You must be signed in to change notification settings - Fork 1
Proof-of-concept: on-device LLM generated nudges #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@PSchmiedmayer @lukaskollmer I've gotten a demo/debug view of on-device LLM generation of nudges working! Would greatly appreciate a code review. Thanks for your time! |
|
It seems that the CodeQL tests are failing because Metal Toolchain is missing. Should it be added to the test harness? |
2569ba7 to
967b775
Compare
|
@PSchmiedmayer @lukaskollmer would appreciate your help with a code review this week, especially if you think the PR is not ready to be pushed so I work on those changes! Thanks! |
Proof-of-concept: on-device LLM generated nudges
♻️ Current situation & Problem
MHC is in need of an implementation of on-device execution of LLMs in order to generate personalized motivational notifications for users.
⚙️ Release Notes
LLMRunnerandOnDeviceNudgeServicetoMyHeartCountsDelegate.swift.downloadLLMfeature flag inFeatureFlags.swift.OnDeviceNudgeService.swifthandles operations to retrieve user account data and then build up an LLM prompt customized using the user data. The prompt asks the LLM to create 7 motivational messages (nudges) intended to be sent to the user as a daily notification. It also allows for the retrieval of predefined nudges fromPredefinedNudes.jsonbased on the study design schedule and in cases where LLM generation fails.OnDeviceNudgeService.swiftmirrors the capabilities currently handled server-side byplanNudges.tsUserDataService.swifthandles miscellaneous user data operations forOnDeviceNudgeService.swift.📚 Documentation
For usage of
OnDeviceNudgeService(), seeLLMNudgesDemoView.swift.✅ Testing
OnDeviceNudgeService.swiftare inOnDeviceNudgeServiceTests.swift.LLMLocalDemoView.swift.LLMNudgesDemoView.swift.DebugForm.swift.Code of Conduct & Contributing Guidelines
By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: