{"id":15198595,"url":"https://github.com/greynewell/tfjs-electron-app","last_synced_at":"2026-03-05T18:03:32.568Z","repository":{"id":246109718,"uuid":"820124698","full_name":"greynewell/tfjs-electron-app","owner":"greynewell","description":"A minimal example of training and running ML models locally in a desktop application using Electron.js and TensorFlow.js","archived":false,"fork":false,"pushed_at":"2024-06-26T05:22:52.000Z","size":58,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-13T19:18:36.149Z","etag":null,"topics":["desktop","desktop-app","electron-builder","electronjs","javascript","linux","macos","tensorflow","tensorflowjs","typescript","windows"],"latest_commit_sha":null,"homepage":"https://greynewell.com/train-and-run-local-models-in-cross-platform-desktop-apps-with-tensorflowjs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greynewell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-25T21:15:28.000Z","updated_at":"2024-09-16T03:47:43.000Z","dependencies_parsed_at":"2024-06-25T22:39:31.672Z","dependency_job_id":"3fb273d1-9e35-43dc-9204-a76ce8cfae3f","html_url":"https://github.com/greynewell/tfjs-electron-app","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"d8b3d6a346856b69c7599c9ddec3136d91bd9530"},"previous_names":["greynewell/tfjs-electron-app"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greynewell%2Ftfjs-electron-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greynewell%2Ftfjs-electron-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greynewell%2Ftfjs-electron-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greynewell%2Ftfjs-electron-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greynewell","download_url":"https://codeload.github.com/greynewell/tfjs-electron-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241629739,"owners_count":19993707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["desktop","desktop-app","electron-builder","electronjs","javascript","linux","macos","tensorflow","tensorflowjs","typescript","windows"],"created_at":"2024-09-28T01:22:37.438Z","updated_at":"2025-03-03T07:45:10.910Z","avatar_url":"https://github.com/greynewell.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tfjs-electron-app\nThis is a minimal example using `TensorFlow.js` to train and run a model locally in a Desktop environment created with `Electron.js`.\n\n## How to use this repo\nClone this repo locally, `cd` into it, then:\n1. Install dependencies. ```npm i```\n2. Build the application. ```npm run build```\n3. Test the app locally. ```npm run start```\n4. Build for distribution. ```npm run dist```\n\n## Why this approach?\n\nWhy have I decided to experiment with this oddball tech stack? Let’s unpack.\n\n### Local Models\n\nRunning local models protects data privacy, removes network latency, and enables offline use; all important considerations for real-time creative applications involving sensitive IP. These benefits come at the cost of model performance and higher system requirements than on the web.\n\n### JavaScript\n\nPrimary advantage of using JavaScript: much of your code will be portable to the web. You’ll also have access to tools you’re probably familiar with like **React**, `Next.js`, and `Electron.js` for developing cross-platform experiences.\n\nI also choose JavaScript for demos and public-facing code because of its widespread familiarity among product developers and full-stack developers, who comprise a large percentage of my audience. If my code is readable, I expect Python developers to be able to follow along as well.\n\nFinally, JavaScript was selected based on the observation that many JavaScript developers and AI startups are currently working on solving the same problem: *how do we create a life-changing experience with AI?*\n\n### TensorFlow.js\n\n`TensorFlow.js` is both cross-platform and optimized for CPU and GPU execution, which makes it stand out as a JavaScript ML library. Many models developed for TensorFlow in Python can be adapted to run in a JavaScript environment as well. While a model like Stable Diffusion may not easily work with this library, it comes with a variety of pre-trained models, tools, and resources that we can take advantage of.\n\n---\n\nIn the end, I disregarded all of the above reasoning to experiment with building a desktop app using local models for fun and document the results to share with you.\n\n## Read the Full Post\nCheck out the full post on my blog: [https://greynewell.com/train-and-run-local-models-in-cross-platform-desktop-apps-with-tensorflowjs](https://greynewell.com/train-and-run-local-models-in-cross-platform-desktop-apps-with-tensorflowjs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreynewell%2Ftfjs-electron-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreynewell%2Ftfjs-electron-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreynewell%2Ftfjs-electron-app/lists"}