Integrate External Model in Modelling Objectives with OAuth Flow

Hi,

I am trying to integrate an externally-hosted model into Modelling Objectives. However, it requires an OAuth flow with an Identity provider.

The Modelling Objectives UI only allows to import one egress policy. I couldn’t find a way to integrate Outbound Application with MO. Also, it is not possible to import a RestAPI data connection in the model adapter library.

Has anyone come across a similar issue and found a workaround?

1 Like

What kind of oauth flow?
+1 for selecting an outbound application and /or rest api source.

So I have a clientid/secret. With that:

  • I need to first authenticate with an endpoint to get a token
  • With that token, call the model on other endpoint which is hosted in a different domain

If there was a way of passing 2 egress policies into the MO and I could express some logic it would solve the issue. However, I was not able to do so.

1 Like

Hello!

If your egress polices are already imported into your project, then any live deployment spun up within the project will also have access to all egress policies. The egress policy selection in this UI flow restricts what policy can be used with this external model within a code repository.

So for your use case I would recommend you author your model adapter with the assumption that it will have access to these external endpoints. Your clientId/secret can be passed via credentials during the UI flow of creating an external model so you can access them securely in your model adapter. Once your external model is published via the UI flow then you can use it to spin up a live deployment. Hope this helps!

Best,
Yoeal

Hi @yefrem

Thanks for the suggestion - it served as inspiration to find an alternative approach.

You suggested to ignore the egress policies in the model adapter and then wrap the transform with the relevant egress policies. Since one doesn’t necessarily have to leverage the RestAPI data connection client for public endpoints this works. The approach solves the integration with models deployed with public IPs but not in private networks. Those models need to be access through Agent-proxy and one needs to use the client.

I discover one can install transform-external-systems package and add the Source class to the run_inference abstract method. Feels unnatural one needs a dummy egress policy in the Modelling objectives in this case.

image

Many thanks for your suggestion.