I'm not familiar with HuggingFace, unfortunately.

Generally, to limit amount of cores available to IRIS, the documentation suggests to use the following Docker flags:
--cpuset-cpus=0-19 --cpus=20

See the step 4 here:
https://docs.intersystems.com/iris20241/csp/docbook/DocBook.UI.Page.cls?...

I don't know how to set them on the HuggingFace

Please double check the version. 2023.1.3 should have the fix for this case
https://docs.intersystems.com/iris20231/csp/docbook/changes/index.html#C...

DP-423647: Process CORS request when handling requests with JWT Tokens

Category: CSP / ZEN
Platforms: All
Version: 2023.1.3

This change ensures that any request that handles JWT tokens also correctly process CORS requests, when applicable.

Though status 500 is strange by itself. Try enabling ISCLOG and see if any error is logged there