IPC
How Hard Would IPC Be? Very hard, and not worth it. Here's why:
What You'd Have to Change Your backend (Express) and AI service (FastAPI) are full HTTP servers — every endpoint is designed around request/response over HTTP. To switch to IPC you'd need to:
Rip out FastAPI and Express routing entirely Replace with stdin/stdout message passing or named pipes Rewrite every single API call in your frontend client Rewrite all the SSE streaming logic (your token-by-token generation) to work over IPC instead of HTTP Rewrite the IPC bridge in electron/main.ts Lose the ability to test your backend and AI service independently in a browser That's a massive rewrite for three services with hundreds of endpoints.
Is HTTP on Localhost the "Pro" Way? Yes, actually. Most production Electron apps with multiple backend services use localhost HTTP:
VS Code — language servers communicate via HTTP/JSON-RPC on localhost Docker Desktop — Electron frontend talks to backend services on localhost Slack, Discord — internal services on localhost The overhead of HTTP on localhost is negligible — you're not going over the network. The packets never leave your machine's memory. The latency difference between IPC and localhost HTTP is microseconds, which is invisible compared to the seconds your AI model takes to generate text.
When Would IPC Make Sense? Only if you had one very simple service with a handful of endpoints and needed absolute minimum latency. That's not your situation — you have two complex services with dozens of endpoints and streaming.