I wanted to know how it would be possible to run an ML model in an offline setting securely? What I mean is, if the Python files and libraries are bundled as an .exe file (using libraries like py2exe or PyInstaller) for distribtion, is it possible to decompile the executable and obtain the source code if reverse engineered properly?
From the research I've done, I've seen packages like uncompyle6 get a lot of praise for being able to decompile executables properly. However, I have observed lesser decomplilation facilities for newer versions of Python, (specifically 3.8 and above). I tried to decompile the .pyc files which are just bytecode and they were decompiled pretty easily. However, I'm facing a harder time decompiling .pyd files.
What practices does the industry follow for this, to make reverse engineering really hard? Realistically, what measures can I take to make sure that the code does not get leaked/stolen? Thank you!