As noted in T276769: Create Grafana dashboard for link recommendation service and document it on wikitech:
For the 504, this can sometimes be reproduced by issuing a GET to https://api.wikimedia.org/service/linkrecommendation/v0/linkrecommendations/cswiki/Lipsko
The 503 is reproducible on the beta cluster by executing mwscript --wiki=cswiki extensions/GrowthExperiments/maintenance/refreshLinkRecommendations.php