Deploying Pytorch model to production in Mobile

Hi there, I’m completely new to the mobile app development and would like to deploy my model trained using pytorch to both android and ios. Now I know one way for this is to use the Pytorch Mobile, but for that, I’d have to build my app with different code bases for both android and ios (which I’m not worried that much though). I’m just wondering is there a way for deploying pytorch models for both android and ios using the same codebase.

Hence I’m really interested in Flutter, but there’s no as such official way of deploying a pytorch model to flutter. (Some packages are there but they aren’t updated since like last year)

One way I can think of is by deploying my model using Flask or Django as a REST API, and then use the JSON file to in order to connect it to Flutter. One con of this approach is that model wouldn’t run on the device, so I’d have to deploy the API to the server, which of course could cost money for better inference.

So is there any better way for the same. Again, I’ve no problem for learning different things for different os, just wondering if such an approach exists.