While building PromptPulse, I wanted to give users the model and client together. They should be able to download it and use it locally, without configuring an LLM API or first installing Node.js or Python, on Windows, macOS and Linux. I also wanted more than a demo window: the interface should have the expressive capabilities of a web application.
I initially picked Electron because I knew React and web development. When I started integrating models and handling native dependencies, I compared Flutter, Tauri and Python GUIs, and even considered a game engine such as Godot for the frontend. There seemed to be many options, but I kept returning to the same questions: how much UI could I reuse, what would run the models, and how could I deliver them together?
This article organizes the options around those questions. For native library loading failures and Electron memory troubleshooting, see experiments with ONNX and a standalone Node sidecar. For connecting specific speech and image models, see investigating multimodal model runtimes.
Separate the UI, inference and distribution first
A page that can chat in a browser still leaves much of a desktop AI application unresolved. I gradually separated it into three layers:
| Layer | What I need to decide | What still needs work |
|---|---|---|
| UI and desktop host | Reuse the web interface or use another GUI toolkit or engine | Windows, input, layout, file access and system integration |
| Model execution | Use Node wrappers, Python tooling or native libraries | Supported models, runtime versions, CPU/GPU dependencies and memory |
| Distribution and startup | Bundle the program, models and dependencies and start them from one entry point | Paths, process lifecycles, platform binaries and installation artifacts |
The layers are related, but they need not use the same language. Keeping React does not require implementing the model in JavaScript. Running inference in Python need not require a Python GUI. My later sidecar research was an attempt to choose these independently.
How much existing web UI can you reuse?
I read comparisons of Flutter, React Native, Ionic and Capacitor, 12345 and searched for React migration and cross-platform development options. 6789 Reorganizing the choices around my needs, what mattered was how much existing code I could reuse, how readily I could access desktop capabilities and how local inference would fit.
| Direction | What appealed to me | What this project would still need |
|---|---|---|
| React Native | Keep the React component model and JavaScript | A React DOM UI cannot become native components unchanged. Desktop targets need platform-specific solutions. |
| Ionic / Capacitor | Continue using HTML, CSS and web development practices | Capacitor's core targets are iOS, Android and the web. Local desktop inference still requires a host and an integration design. |
| Flutter | A unified UI development framework | Introduces Dart and a different UI implementation, offering less direct reuse of an existing React interface. |
| Electron | Keep React DOM and gain desktop windows, filesystem access and the Node ecosystem | Installer size, IPC, native modules and distribution on each platform remain my responsibility. |
The official React Native and Capacitor descriptions clarify their respective scope. This comparison concerns my project rather than a universal framework ranking. 1011
An article I saved, I Built the Same App with Flutter, React Native and Ionic, compared a small app displaying information about random countries. It highlighted how much familiarity with web technology shapes the learning experience. The author also explicitly qualified the performance comparison:
鉴于其几乎不存在的性能要求,我无法用我的应用程序测试这种比较。 (Given its almost nonexistent performance requirements, I cannot test this comparison with my application.)
— “Performance” section of I Built the Same App with Flutter, React Native and Ionic.3
That qualification matters. Developing a simple mobile page cannot directly answer desktop LLM runtime questions. For me, Electron's clearest benefit was bringing an existing web UI and local desktop capabilities together in one product. Forge's React integration guide follows this path. 12
Later I searched best cross platform ui for desktop and read a comparison of Electron, Flutter, Tauri, React Native and Qt. It suggested criteria including resource use, developer experience and native integration. My focus expanded from UI implementation to the desktop application as a whole. Framework introductions help identify questions, but testing the model inside the app is still necessary. 13
Can I keep using the model toolchain?
Call a native library or switch execution environments?
I looked at installing and developing Flutter desktop apps on Linux, then searched for calling a C++ DLL from Flutter. 141516 For Electron, I looked up DLLs, Linux .so files and ways to connect a C++ backend through Node addons. 1718192021 Both routes addressed the same question: how do I call an existing native model engine from the UI?
Calling a DLL or .so directly and launching a separate process with its own Node or Python are different integrations. The former needs language bindings and native library loading inside the application process. The latter keeps inference in its own environment and exchanges requests and results through IPC. The UI framework is only one layer.
Atiq Gauri's example calls the native addon from a Web Worker and sends results back to the UI so a long C++ call doesn't block it. 19 That addresses interface responsiveness during the call. Runtime selection and cross-platform distribution still need separate designs.
This is both a binding and a distribution problem. Even with a uniform call interface, native libraries must match the target system and architecture. Switching GUI frameworks cannot make one binary run everywhere. For Node native modules, builds and unpacking, see the main article's discussion of native dependencies.
Would it be easier to build the GUI in Python?
I remember that most Node model options I could find focused on LLMs. Suitable ready-made integrations for speech and images were hard to find. Python's model tooling was more mature, so I also considered structuring the desktop program around PyTorch directly.
My requirements became progressively more specific. First I asked how to make a Python project a standalone executable, then requested PyTorch and a GUI. After seeing a Qt option I asked for a license that better fit my needs. Finally I specified a modern GUI with web-like expressiveness, supporting macOS, Windows and Linux. Licensing was a project consideration at the time. It would be inaccurate to reduce it to “Qt cannot be used for free.”
I remember searching Electron alternatives, reading Moon Technolabs' comparison and looking up some frameworks it mentioned. Eel probably came through that route. 22 It drew my attention to a Python backend paired with HTML/JavaScript, connected via a local web service and function calls. 23
I also read discussions of Python GUIs and looked at Kivy and Dear PyGui. 2425 Kivy offers another cross-platform Python GUI path. 26 With any of them, I still needed to determine how models and UI would work together. Using Python did not handle packaging automatically.
My Dear PyGui reading reached the render loop, viewport and widget values. A viewport corresponds to an OS window, and widget values are managed through calls to read or set them. 2728 The render loop handles input and drawing. Long calculations inside it affect UI updates. 29 For a model client, that reminded me to plan how inference and interface updates would run, beyond judging the look of a static screen.
Can I keep Node or Python and change the frontend?
I explicitly considered setting Electron aside, keeping the Node backend and pairing it with a native Windows UI packaged into an executable. Then I asked whether Godot could serve as a cross-platform frontend communicating with Node. Another discussion started with bundling Python in Unity and moved on to Godot and how to include the interpreter and scripts at export.
Game engines appear in these notes because I was comparing them as cross-platform interfaces. My next concern was whether the combination could become one application a user would recognize. I browsed the Godot-Python project for existing integration approaches. That part remained research. 30
Once the backend lives in a separate process, the frontend can exchange messages over local HTTP, standard input/output or another IPC mechanism. Regardless of frontend technology, startup failures, result delivery, cancellation and shutdown cleanup need handling. For communication mechanisms, see interprocess communication and Electron IPC. My focus here is how IPC lets the UI and model environment be selected independently.
Tauri reminded me of sidecars
I first encountered sidecars while learning Kubernetes several years earlier. My understanding was an auxiliary program that runs alongside the main program. The term comes from a motorcycle sidecar. I found that memorable.
Later I saw sidecars mentioned repeatedly in Tauri's desktop documentation and made the connection. From the introduction and project creation guides I investigated Node backends, 3132 found Node.js as a sidecar, then searched for Python sidecars and read the external binary packaging guide. The docs address exactly how to ship an auxiliary program with an application so users need not install Node or Python separately. 3334
I realized the same term could describe the independent inference process I wanted in Electron. When explaining the requirement to AI, “sidecar” conveyed “an auxiliary program shipped with and started by the client,” without repeating the runtime, subprocess and packaging requirements each time.
A separate process can choose its runtime version, but there is a cost. The app must manage startup, shutdown, communication, errors and resource paths, and ship a matching program for each platform. Tauri's external program documentation distinguishes binaries by target platform too. 34 I was investigating a way to combine components. PromptPulse continued to use Electron.
Users need one entry point without having to understand the processes behind it
When discussing Godot and Node, I asked to run just one main.exe to start both the UI and backend service. For Python, I asked how to include the interpreter and scripts in the export and how to handle Windows, macOS and Linux separately.
This is more specific than “generate an exe.” A single file, a single process and a single launch entry are different requirements. The installation directory can contain the main program, helpers, models and dependencies while users still open just one app. Conceptually:
用户打开应用
→ 主程序定位并启动本地推理后端
→ 界面等待后端就绪,再提交模型任务
→ 后端持续返回结果或错误
→ 用户停止任务或退出应用时,主程序安排中断与清理
These are the responsibilities of the distribution design. The experiment did not implement all of them.
For Python, I investigated packaging PyTorch apps with PyInstaller and read Ali Asaria's discussion of distributing Python and PyTorch. 35 PyInstaller can collect the interpreter and dependencies into a directory or one executable. Model data and dynamically loaded dependencies may require additional configuration. Output also depends on the build environment. A program built for one platform cannot simply run unchanged on the others. 36
A single file does not imply everything executes directly inside that file. At startup PyInstaller's --onefile extracts support files into a temporary directory, adding launch overhead. The official docs recommend getting directory mode working first so you can inspect the collected dependencies before trying one-file mode. 36 For my “download and use” requirement, one user-facing entry was enough. A physically single file was unnecessary. For collecting dependencies and tracking down missing resources, see building a single executable with PyInstaller.
Another option is to bundle standalone Python directly. Datasette Desktop gave me a concrete example: keep the Electron UI, ship a full Python installation, call it as a subprocess and use process.resourcesPath to find the bundled runtime. It uses electron-builder's extraResources to copy the Python directory. 37 My Forge config can't use another packager's fields verbatim, but the principle of delivering the runtime as an app resource carries over.
Datasette chose full Python partly for its plugin system. Plugins may add dependencies and use different parts of the standard library, so Simon Willison moved away from the slim packaging scheme he originally considered. 38 That suggests another decision: will the program run only predefined models and dependencies, or must the Python environment remain extensible after installation?
Ali Asaria discusses this tension too. Transformer Lab needs plugins to install additional Python libraries. It ultimately installs Conda in an app-specific location, creates an isolated environment and pins Python and dependency versions. Installation checks its progress in stages and displays logs in the UI. 35 He states his reason for taking on the trouble directly:
“it's our job to hit these issues so that our users don't have to.”
— Ali Asaria, “Final Comments.”35
Transformer Lab and Datasette both hide environment configuration behind the app, but some components are still obtained at installation or startup. 3538 My concern was distribution. Even if users never manually install Python, downloading dependencies at startup can still hit poor connections, timeouts or installation failures. I wanted to avoid these as far as possible by preparing the runtime, dependencies and required models in the installer so the app worked once downloaded. That's why I continued investigating bundling Python or Node. A complete interpreter can still ship with prepared dependencies. Extensibility and online installation are separate decisions.
There's another delivery step that's easy to overlook when something “runs locally.” Simon's implementation not only copied Python but handled macOS signing and notarization, including the bundled Python binaries. 3738 This is target-specific distribution work. Once code is in the package, the installation and launch experience still needs verification.
Which route did I actually implement?
I kept Electron for the UI. In a separate May experiment, I bundled Node to run the model and returned results to the interface over local HTTP. The May 29 commit includes runtime startup logic, backend scripts and resource copy configuration. 39 The sidecar route eventually worked. Producing and verifying cross-platform installers remained to be done.
Stability was a real consideration. Upgrading or downgrading Electron changes the bundled Node version and can affect dependencies. A separate Node lets me select the inference runtime independently. Version relationships, memory failures, sharp/libvips loading and installation-path debugging are covered in the ONNX experiment so this article needn't turn into a list of individual errors.
What I took away is that a familiar UI paired with an appropriate model environment can avoid some migration work. The cost is having to organize the processes, resources and distribution myself. Flutter, Python GUIs, Godot and Tauri showed me different combinations. The final choice still depends on what can actually run and ship.
References
Footnotes
-
Grisey, A. (2024, May 2). Ionic vs React Native: Why the First One Wins. Medium. https://medium.com/@alexandre_grisey/ionic-vs-react-native-why-the-first-one-wins-c05db1134c2a 。Access date: May 29, 2025. ↩
-
Jain, K. (2023, March 22). Capacitor vs React Native. Reveation Labs. https://www.reveation.io/blog/capacitor-vs-react-native 。Access date: May 29, 2025. ↩
-
独立开发者张张. (n.d.). 我用 Flutter、React Native 和 Ionic 构建了相同的应用程序. 知乎专栏. https://zhuanlan.zhihu.com/p/698380664 。引文定位:“性能”部分(作者留存的网页全文)。文章附带的三个示例仓库:Flutter、React Native、Ionic Angular。这些是原文示例,不是 PromptPulse 的实现。 Access date: May 29, 2025. ↩ ↩2
-
Martin, S. (2020, October 16). [译]哪个跨平台框架才是最好的选择?React Native、Flutter 还是 Ionic(黄梵高,译). 稀土掘金. https://juejin.cn/post/6884099570435883022 。Access date: May 29, 2025. ↩
-
浪里行舟. (2021, December 30). 深度测评|五大主流多端开发框架全面对比. 稀土掘金. https://juejin.cn/post/7047465569255161864 。Access date: May 29, 2025. ↩
-
tbogatchev. (2016, February 17). What is the quickest way to convert a React app to React Native? [提问]. Stack Overflow. https://stackoverflow.com/questions/35463547/what-is-the-quickest-way-to-convert-a-react-app-to-react-native 。Access date: May 29, 2025. ↩
-
Google. (n.d.). move a react project to react native [搜索结果页,历史检索入口]. Google Search. https://www.google.com/search?q=move+a+react+project+to+react+native&sca_esv=0ac4b8938639300a&ei=72vAZ7KyG5_hwN4P_eO8qA4&oq=move+a+react+project+to+react+natie&gs_lp=Egxnd3Mtd2l6LXNlcnAiI21vdmUgYSByZWFjdCBwcm9qZWN0IHRvIHJlYWN0IG5hdGllKgIIADIHECEYoAEYCjIHECEYoAEYCjIHECEYoAEYCjIHECEYoAEYCkiBXlAAWO1UcAN4AZABAZgBtwagAaCDAaoBDTEuMy0xOC4zLjExLjS4AQPIAQD4AQGYAiagArx8qAIEwgIFEC4YgATCAgUQABiABMICFBAuGIAEGJcFGNwEGN4EGN8E2AEBwgIGEAAYBxgewgIIEAAYBxgIGB7CAggQABiABBiiBMICFBAAGIAEGOMEGLQCGOkEGOoC2AECwgIFEAAY7wXCAgcQABiABBgTwgIHEC4YgAQYE8ICCBAAGBMYCBgewgIIEAAYExgFGB7CAhYQLhiABBgTGJcFGNwEGN4EGOAE2AEBwgIGEAAYBRgewgIFECEYoAGYAwPxBVBVxzT11BqeugYGCAEQARgUugYECAIYB5IHDTQuMy0xNy4xMS41LjGgB8SJAQ&sclient=gws-wiz-serp 。Access date: May 29, 2025. ↩
-
Google. (n.d.). 如何使用 inonic 做跨端,和 Web React 比需要注意什么 [搜索结果页,历史检索入口]. Google Search. https://www.google.com/search?q=%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8inonic%E5%81%9A%E8%B7%A8%E7%AB%AF+%E5%92%8Cweb+react%E6%AF%94%E9%9C%80%E8%A6%81%E6%B3%A8%E6%84%8F%E4%BB%80%E4%B9%88&oq=%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8inonic%E5%81%9A%E8%B7%A8%E7%AB%AF+%E5%92%8Cweb+react%E6%AF%94%E9%9C%80%E8%A6%81%E6%B3%A8%E6%84%8F%E4%BB%80%E4%B9%88&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQABjvBTIHCAIQABjvBTIKCAMQABiABBiiBNIBCTI5ODcwajBqNKgCALACAQ&sourceid=chrome&ie=UTF-8 。Access date: May 29, 2025. ↩
-
Google. (n.d.). capacitor or reactnative [搜索结果页,历史检索入口]. Google Search. https://www.google.com/search?q=capacitor+or+reactnative&oq=capacitor+or+reactnative&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIJCAEQABgKGIAEMgkIAhAAGAoYgAQyCQgDEAAYChiABDIJCAQQABgKGIAEMgkIBRAAGAoYgAQyCQgGEAAYChiABDIJCAcQABgKGIAEMgkICBAAGAoYgAQyCQgJEAAYChiABNIBCTEwNjQ2ajBqNKgCALACAQ&sourceid=chrome&ie=UTF-8 。Access date: May 29, 2025. ↩
-
Meta Platforms, Inc. (n.d.). Core Components and Native Components. React Native documentation. https://reactnative.dev/docs/intro-react-native-components 。Access date: May 29, 2025. ↩
-
Ionic. (n.d.). Capacitor: A cross-platform native runtime for web apps. Capacitor. https://capacitorjs.com/ 。Access date: May 29, 2025. ↩
-
Electron Forge contributors. (n.d.). React. Electron Forge documentation. https://www.electronforge.io/guides/framework-integration/react 。Access date: May 29, 2025. ↩
-
Wassim [maxel333]. (2023, September 13). Comparing Desktop Application Development Frameworks: Electron, Flutter, Tauri, React Native, and Qt. Medium. https://medium.com/@maxel333/comparing-desktop-application-development-frameworks-electron-flutter-tauri-react-native-and-fd2712765377 。检索词:
best cross platform ui for desktop。Access date: May 29, 2025. ↩ -
Flutter contributors. (n.d.). Start building Flutter native desktop apps on Linux. Flutter documentation. https://docs.flutter.dev/get-started/install/linux/desktop 。原入口已失效;2025 年 5 月 19 日的官方源码快照。 Access date: May 29, 2025. ↩
-
Flutter contributors. (n.d.). Flutter for Jetpack Compose developers. Flutter documentation. https://docs.flutter.dev/flutter-for/compose-devs 。Access date: May 29, 2025. ↩
-
ESD. (2021, March 30). Using a C++ DLL in Flutter Windows desktop app [提问]. Stack Overflow. https://stackoverflow.com/questions/66877095/using-a-c-dll-in-flutter-windows-desktop-app 。Access date: May 29, 2025. ↩
-
Pinko, A. (2024, June 30). Unleashing External Power: Triggering DLLs in Electron Apps with Node.js 20.14 and .NET 8. Medium. https://medium.com/@avihup/wrapping-external-dlls-with-c-for-seamless-integration-in-electron-applications-with-node-js-9483bba343bb 。Access date: May 29, 2025. ↩
-
umen. (n.d.). How do i integrate C++ backend with electron GUI? [论坛帖子]. Reddit, r/electronjs. https://www.reddit.com/r/electronjs/comments/lbnecr/how_do_i_integrate_c_backend_with_electron_gui/ 。Access date: May 29, 2025. ↩
-
Gauri, A. (2020, August 6). Electron App with C++ backend as Native Addon (Napi). Medium. https://gauriatiq.medium.com/electron-app-with-c-back-end-as-native-addon-napi-c67867f4058 。定位:“C++ Native Addon”“Web Workers”。Access date: May 29, 2025. ↩ ↩2
-
Electron contributors. (n.d.). Native Code and Electron: C++ (Windows). Electron documentation. https://www.electronjs.org/docs/latest/tutorial/native-code-and-electron-cpp-win32 。Access date: May 29, 2025. ↩
-
Jack P. (2020, January 16). Electron with C++ backend - secure? [提问]. Stack Overflow. https://stackoverflow.com/questions/59775149/electron-with-c-backend-secure 。Access date: May 29, 2025. ↩
-
Katariya, J. (n.d.). 10 Best Electron Alternatives for Powerful Development. Moon Technolabs. https://www.moontechnolabs.com/blog/electron-alternatives/ 。Access date: May 29, 2025. ↩
-
Eel contributors. (n.d.). Eel [README,项目介绍及前后端调用说明]. GitHub. https://github.com/python-eel/Eel 。Access date: May 29, 2025. ↩
-
genan1. (n.d.). What is the best GUI library for Python? [论坛帖子]. Reddit, r/Python. https://www.reddit.com/r/Python/comments/wedvzi/what_is_the_best_gui_library_for_python/ 。Access date: May 29, 2025. ↩
-
Dear PyGui contributors. (n.d.). Dear PyGui [软件仓库,README]. GitHub. https://github.com/hoffstadt/DearPyGui?tab=readme-ov-file 。Access date: May 29, 2025. ↩
-
Kivy contributors. (n.d.). Kivy: The Open Source Python App Development Framework. Kivy. https://kivy.org/ 。Access date: May 29, 2025. ↩
-
Dear PyGui contributors. (n.d.). Viewport. Dear PyGui documentation. https://dearpygui.readthedocs.io/en/latest/documentation/viewport.html 。Access date: May 29, 2025. ↩
-
Dear PyGui contributors. (n.d.). Values. Dear PyGui documentation. https://dearpygui.readthedocs.io/en/latest/documentation/item-value.html 。Access date: May 29, 2025. ↩
-
Dear PyGui contributors. (n.d.). Render Loop. Dear PyGui documentation. https://dearpygui.readthedocs.io/en/latest/documentation/render-loop.html 。Access date: May 29, 2025. ↩
-
touilleMan. (n.d.). Godot-Python [软件仓库]. GitHub. https://github.com/touilleMan/godot-python 。Access date: May 29, 2025. ↩
-
Tauri contributors. (n.d.). What is Tauri?. Tauri documentation. https://v2.tauri.app/start/ 。Access date: May 29, 2025. ↩
-
Tauri contributors. (n.d.). Create a Project. Tauri documentation. https://v2.tauri.app/start/create-project/ 。Access date: May 29, 2025. ↩
-
Tauri contributors. (n.d.). Node.js as a sidecar. Tauri documentation. https://v2.tauri.app/learn/sidecar-nodejs/ 。Access date: May 29, 2025. ↩
-
Tauri contributors. (n.d.). Embedding External Binaries. Tauri documentation. https://v2.tauri.app/develop/sidecar/ 。Access date: May 29, 2025. ↩ ↩2
-
Asaria, A. (2024, August 23). Packaging Python and PyTorch for a Machine Learning Application. LinkedIn. https://www.linkedin.com/pulse/packaging-python-pytorch-machine-learning-application-ali-asaria-tsuzc 。定位:“PyInstaller”“Where We Finally Landed”“What This All Looks Like In the App”;引文见“Final Comments”中以“When things look bleak”开头的段落。Access date: May 29, 2025. ↩ ↩2 ↩3 ↩4
-
PyInstaller contributors. (n.d.). What PyInstaller Does and How It Does It [6.12.0]. PyInstaller documentation. https://pyinstaller.org/en/v6.12.0/operating-mode.html 。定位:“Bundling to One Folder”“Bundling to One File”“How the One-File Program Works”。 Access date: May 29, 2025. ↩ ↩2
-
Willison, S. (2021, September 8). Bundling Python inside an Electron app. Simon Willison’s TILs. https://til.simonwillison.net/electron/python-inside-electron 。定位:“Calling Python from Electron”“Packaging the app”“Signing and notarizing”。Access date: May 29, 2025. ↩ ↩2
-
Willison, S. (2021, September 8). Datasette Desktop—a macOS desktop application for Datasette. Simon Willison’s Weblog. https://simonwillison.net/2021/Sep/8/datasette-desktop/ 。定位:“How the app works”“How I built it”。Access date: May 29, 2025. ↩ ↩2 ↩3
-
CaiBorui [S2thend]. (2025, May 29). feat: :fire: epoch commit [Node-Sidecar-Electron,提交 7f85e0d]. GitHub. https://github.com/S2thend/Node-Sidecar-Electron/commit/7f85e0d827586840a7c11039d93cff14b618fafb 。 Access date: May 29, 2025. ↩