Can we use a model hosted on another platform (for example to run hugging face's perplexity metric on?

I’m currently trying to test the perplexity metric from hugging face on models like llama-7b and llama-13b. These models are hosted on another platform called and what I want to do is test the metric on those models. I have the model URL as well but when I try running the program with the URL I get an HTTPS 405: Not Allowed error. I tried putting in the API key as well like this in the perplexity metric code itself but I still get the same error.

model = AutoModelForCausalLM.from_pretrained(model_url, api_key=‘abc’)

Is there anyway I could do this?