Skip to content
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

Adds support for on-device LLMs with SpeziLLMLocal #39

Merged
merged 14 commits into from
May 13, 2024
Merged

Conversation

vishnuravi
Copy link
Member

@vishnuravi vishnuravi commented Apr 4, 2024

Adds support for on-device LLMs with SpeziLLMLocal

♻️ Current situation & Problem

Currently, the app can only use OpenAI models such as GPT-4. However, users may prefer to run an LLM on-device for increased privacy. This is now supported via the SpeziLLMLocal target of the SpeziLLM module and can be enabled in HealthGPT.

⚙️ Release Notes

  • Adds a step in onboarding for downloading and storing the Llama3 8B model
  • Adds an --llmLocal feature flag for toggling local execution
  • Adds an onboarding step allowing the user to choose between OpenAI or local execution
  • Updates the HealthDataInterpreter to use the local LLM if the flag is set

📚 Documentation

Updated documentation

✅ Testing

  • Adds UI tests for local LLM configuration during onboarding

Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@vishnuravi vishnuravi changed the title Adds support for local LLMs with SpeziLLMLocal Adds support for on-device LLMs with SpeziLLMLocal Apr 4, 2024
Copy link

codecov bot commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 92.66055% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 92.96%. Comparing base (10b725e) to head (97e0d3d).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
- Coverage   93.03%   92.96%   -0.07%     
==========================================
  Files          24       27       +3     
  Lines         832      922      +90     
==========================================
+ Hits          774      857      +83     
- Misses         58       65       +7     
Files Coverage Δ
HealthGPT/HealthGPT/HealthDataInterpreter.swift 100.00% <100.00%> (ø)
HealthGPT/HealthGPTAppDelegate.swift 100.00% <100.00%> (ø)
HealthGPT/Onboarding/LLMSource.swift 100.00% <100.00%> (ø)
HealthGPT/Onboarding/LLMSourceSelection.swift 100.00% <100.00%> (ø)
HealthGPT/Onboarding/OpenAIAPIKey.swift 100.00% <100.00%> (ø)
HealthGPTUITests/OnboardingUITests.swift 100.00% <100.00%> (ø)
HealthGPT/HealthGPT/SettingsView.swift 90.81% <83.34%> (+0.45%) ⬆️
HealthGPT/Onboarding/OnboardingFlow.swift 82.61% <87.50%> (+0.26%) ⬆️
HealthGPT/Onboarding/LLMLocalDownload.swift 77.78% <77.78%> (ø)
HealthGPT/HealthGPT/HealthGPTView.swift 93.62% <71.43%> (-3.97%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10b725e...97e0d3d. Read the comment docs.

@vishnuravi vishnuravi marked this pull request as ready for review April 4, 2024 19:04
@vishnuravi
Copy link
Member Author

vishnuravi commented May 13, 2024

The screenshot below shows HealthGPT functioning properly with Llama3 8B.

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @vishnuravi; this looks great!

@vishnuravi vishnuravi merged commit 778d271 into main May 13, 2024
6 checks passed
@vishnuravi vishnuravi deleted the spezillmlocal branch May 13, 2024 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants