3 ms·
What is the lightest weight, best practice / pattern for using rails, not django/flask, to call python-based programs (e.g. python machine learning inference s
by phodo 7y ago
What is the lightest weight, best practice / pattern for using rails, not django/flask, to call python-based programs (e.g. python machine learning inference such as tensorflow/pytorch, or other scientific computing like scikit or numpy) on a lean server (keeping costs down)?
- ewalk153 7y agoI would probably write a flask wrapper and expose an api to the Rails app. I’ve seen this done successfully at scale in a large Rails app.
- cutler 7y agoI think Node.js is the better choice for this than Rails. You want your Python number-crunching API accessed async leaving Node to take care of auth, logging and database reads. With your Python API returning JSON I would imagine Rails serialisation would slow down performance relative to Node.