Use a generic LLM connector to connect the ServiceNow AI Platform with an external AI provider to use generative AI capabilities in custom Virtual Agent topics, Flows, or scripts, like background and business rule scripts.
Before you begin
You must have access to the API of an external LLM in order to configure the credentials.
Role required: admin
About this task
You can connect an external LLM to the ServiceNow AI Platform by creating a connection alias to the model, create a model record that points to the alias, create a prompt record for the model, and then create a transformer record to
transform the request or response from the LLM.
Procedure
-
Navigate to .
-
Select API Key Credentials
-
In the Name field, give your API credential a name.
Including the name of the model in the API Key Credential makes it easier to identify later.
-
In the API Key field, enter your model's API key.
-
Select Submit to create the Credential.
At this step, you have the API key information for the external LLM configured.
-
Navigate to .
-
Select New.
-
In the Name field, enter a name for the credential alias.
You do not need to change any other field values.

-
Select Submit.
-
After you are redirected to the List view, find and open the record you just created.
-
Select New in the Connections related list to create a new Connection record.
-
Enter the name of the connection in the Name field.
-
In the Credential field, select the Credential record you created with the model's API key.
You can search the list of Credentials by typing the name of the Credential in the field. You can also select the lookup icon

to open a modal with the full list.
-
In the Connection alias field, select the alias record you created.
-
For the Connection URL, enter the endpoint URL for the model.
For example, a model from Hugging Face might start with "https://api-inference.huggingface.co". You can leave the remaining fields as they are.

-
Select Submit.
Result
You have the connection and credential alias to use for connecting a generic LLM to use generative AI capabilities on the ServiceNow AI Platform. You can confirm this by navigating to and confirming that the connection appears in the related list.
What to do next
For more information on configuring a generic LLM, see configure a generic LLM connector