There are three environments where you need to run your code; locally (a notebook for example), test (to make sure your code does what it should do) and production (to do the actual work).
Local is for you to iterate fast. To experiment with new models and different features.
Test is to make sure you don’t make the same mistake twice (when you find a mistake, capture the behavior in a test to make sure it doesn’t happen again). Why do I call this a different environment? When you run unit tests, ideally they should be able to be run in parallel. If you design your code so it is easy to test, it is often easy to change too!
Production is what you do it all for. One of the reasons you write tests. You write code so it does work for you. Wherever that happens is production.