Exiting deployment if model doesn't load


Right now within my Rasa 2.4 environment when running the Rasa server (‘rasa run’), the default behavior to load a model if the specified model doesn’t exist seems to be to load the last modified file in the models directory (correct me if I’m wrong).

If it can’t find a last modified / if the model can’t be loaded for any other reason (version incompatibility, etc), a warning comes up saying the model doesn’t load, but it does not error out (ie ‘Rasa server is up and running.’).

For deployment purposes, it is important for us not to deploy and show rasa healthy when the models have not loaded successfully.

Is there any method internal to rasa that enables the “rasa run” to fail if a model can’t be loaded ?

Thanks !

mhm, exiting sounds like a bad idea to me. E.g. the rasa-worker shouldn’t exit just because there is no model on disk. I’d recommend to use the /status / /health endpoints for checking for a model in combination with triggering these endpoints from Kubernetes health checks

Hi @Tobias_Wochinger ,

Thank you for your response.

We have implemented certain health checks, but they do not fail when a model doesn’t load since the model not loading is simply a ‘UserWarning’ as opposed to an actual error.

Can you be more specific on how you’d recommend checking if a model has loaded? Are you referring to sending a simple test entry to the server to check for a model?

Thanks !!

This status endpoint should return a 409 when there is no loaded model. If you take this as condition for a healthy deployment, you can trigger alarms etc. based on that.