N/LLM Module In NetSuite SuiteScript

Hey SuitePeople! Great news, NetSuite with recent release 2025 has introduced LLM module which can be leveraged to call LLM directly inside SuiteScript.

It uses OCI GenAI in backend to connect with LLM. There are three usage modes.

  1. Free – 1000 calls per month.
  2. On Demand – Pay as you go using Oracle Cloud Account. It will require OCI credentials.
  3. Dedicated Cluster – Can connect custom cluster of OCI GenAI directly. It will also require OCI credentials.
// Add additional code
...

const myChatMessage = llm.createChatMessage({
    role: llm.ChatRole.USER,
    text: 'Hello World'
});

// Add additional code
...

const response = llm.generateText({
   // preamble is optional for Cohere and must not be used for Meta Llama
   preamble: "You are a successful salesperson. Answer in an enthusiastic, professional tone.", 
   prompt: "Hello World!",
   modelFamily: llm.ModelFamily.COHERE_COMMAND_R, // uses COHERE_COMMAND_R when modelFamily is omitted
   modelParameters: {
      maxTokens: 1000,
      temperature: 0.2,
      topK: 3,
      topP: 0.7,
      frequencyPenalty: 0.4,
      presencePenalty: 0
   },
   ociConfig: {
      // Replace ociConfig values with your Oracle Cloud Account values
      userId: 'ocid1.user.oc1..aaaaaaaanld….exampleuserid',
      tenancyId: 'ocid1.tenancy.oc1..aaaaaaaabt….exampletenancyid',
      compartmentId: 'ocid1.compartment.oc1..aaaaaaaaph….examplecompartmentid',
   // Replace fingerprint and privateKey with your NetSuite API secret ID values
      fingerprint: 'custsecret_oci_fingerprint',
      privateKey: 'custsecret_oci_private_key'
   }
});

...
// Add additional code 

          

...
// Add additional code

Others ways to add AI capabilities inside NetSuite is by using REST Api provided by different Cloud AI providers through which we can connect with LLMs by using N/https module and get response. This will require creation of keys and setting up account. Many cloud providers offer free usage with some concurrency limitation.

Get more details about NetSuite N/LLM module here.

Please contact us if you want help and AI implementation in NetSuite.


Comments

One response to “N/LLM Module In NetSuite SuiteScript”

  1. […] SuiteScript Generative AI: NetSuite has alsi introduced LLM module which can be directly used inside SuiteScripts and will connect with OCI GenAI infrastructure. User will need to create account in OCI to use it for business process. It can used free for 1000 calls per month per account. […]