Best way to deploy Pytorch models into production

I trained an Image enhancer model, and now I want to deploy it on the web using Reactjs. Now there are a few different ways to do it. Here are a couple -

  1. Creating an API using FastAPI and then using that API from react.
  2. Uploading the model on AWS sagemaker and creating a frontend using react.
    I wanted to know what would be the best way to do it if I want to put it into production and build a real startup out of that.

I would say go with whatever is most convenient to you.
When running the model from Python, you might consider JITing your model and using async plus a worker thread for running the JITed model.
I am biased, but I think the example server in chapter 15 of our book is still very reasonable.

Best regards


1 Like