Servicing your model using the REST API
Once your model has been deployed and your container is running, you can use REST API commands to access it. These commands interface with the methods you created earlier in this chapter in the Creating API calls to your model section. In this section, you’ll use REST API commands to interface with the time series model from Chapter 9. Let’s begin by checking how the model is performing.
Monitoring model performance
To test how your model is performing, open a browser window and navigate to the URL that’s serving the model – for example, say your model is hosted at https://example.com. Note that this is completely made up and this URL won’t work. To check model performance, the appropriate REST command to use would be GET
(https://example.com/api/v1/metrics). You can use the Python requests
module to interact with the API programmatically. So, let’s do that:
- Begin by importing the
requests...