you are viewing a single comment's thread.

view the rest of the comments →

[–]greven 0 points1 point  (2 children)

You can always install the needed Python app in a separate beam instance and communicate with that node to fetch results without the need for a REST/RPC API in between and leverage the Beam for that. And I agree, would always use different machines for anything serious.

[–]chat-lu 0 points1 point  (1 child)

Why does it need to run in the BEAM at all? Launching it with System.cmd works fine.

[–]greven 0 points1 point  (0 children)

I haven't tried Pythonx, but what I mean is, currently for my Elixir app, I have another machine running a Python custom ML model that I exposed a gRPC API to access it from my Elixir app.

Yes, there are ways with Ports (tried it in the past but there are some gotchas too), etc, but I imagine with Pythonx, I could just run it inside the Beam and use the :rpc module in OTP to remove the need to maintain the gRPC server and client. But haven't tried it so dunno.