add ollama service #8
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR bundles Ollama with the application, adds auto-start functionality, implements a model management UI button, and sets up automated binary downloads for contributors. Users no longer need to manually install Ollama separately.
Type of Change
Changes Made
Core Features
ollama serverequired)scripts/download-ollama.jsto download Ollama binaries automatically duringnpm installImplementation Details
src/main/index.ts:ollamaService.ensureRunning()inapp.whenReady()callbackollamaService.stop())src/main/services/ollama.ts:getBundledOllamaPath()method to locate platform-specific Ollama executablestart()method to use bundled executable instead of system PATHsrc/renderer/components/Browser/NavigationBar.tsx:useModelStorefor state managementBuild & Distribution
electron-builder.jsonwith configuration to bundle Ollama in production buildsextraResourcesto includeresources/bin/in distribution.gitignoreto excluderesources/bin/directory (~1.8GB)Developer Experience
scripts/download-ollama.js:resources/bin/win32/andresources/bin/darwin/setup:ollama- Manually download Ollama binariespostinstall- Automatically runs afternpm installscripts/README.mdwith usage and troubleshooting documentationDocumentation
README.md:TECH_BRIEFING.md:resources/bin/directoryCode Quality
eslint.config.js:caughtErrorsIgnorePattern: '^_'to ignore underscore-prefixed catch variablesollama.ts(4 unused variable warnings)Testing
Test Results
npm run build)npm run setup:ollama)Screenshots
Model Manager Button in NavigationBar:
Download Script Output:
Checklist
Additional Notes
Bundle Size Impact
.gitignore)Breaking Changes
None. This is a fully backward-compatible enhancement. The app now works out-of-the-box without requiring users to install Ollama separately.
Future Improvements
Migration Notes for Contributors
After pulling this PR:
npm install(this will download Ollama binaries automatically)npm installwas already run before this PR, manually run:npm run setup:ollamaresources/bin/(excluded from git, ~1.8GB)