Model Parameter Values for LLM Integration in SuiteScript 2.1
Customize LLM responses in SuiteScript 2.1 with model parameter values like temperature and maxTokens.
TL;DR: This article discusses how to utilize model parameter values within the N/llm module in SuiteScript 2.1. This enables developers to customize responses from large language models (LLMs) such as Cohere Command A and OpenAI GPT-OSS for applications in Oracle Cloud Infrastructure (OCI).
What is the N/llm Module?
The N/llm module is a critical component of SuiteScript 2.1 that allows developers to interact with large language models to generate text-based responses. With support for models hosted in Oracle Cloud Infrastructure, this module offers advanced capabilities for integrating generative AI into NetSuite applications.
Customizing Model Responses with Parameters
When calling certain methods within the N/llm module, you can provide model parameter values to tailor how the LLM generates its output. Here are some key parameters you can adjust:
Key Model Parameters
| Parameter | Accepted Ranges | Default Value |
|---|---|---|
maxTokens | Cohere Command A: 1 to 4000; OpenAI GPT-OSS: 1 to 16000 | 2000 |
frequencyPenalty | Cohere Command A: 0 to 1; OpenAI GPT-OSS: -2 to 2 | 0 |
presencePenalty | Cohere Command A: 0 to 1; OpenAI GPT-OSS: -2 to 2 | 0 |
prompt | Cohere Command A: 256,000 tokens; OpenAI GPT-OSS: 128,000 tokens | N/A |
temperature | Cohere Command A: 0 to 1; OpenAI GPT-OSS: 0 to 2 | 0.2 |
topK | Cohere Command A: 0 to 500; OpenAI GPT-OSS: 1 to 100,000 | 500 |
topP | 0 to 1 | 0.7 |
You can leverage these parameters to enhance the model's responses. For example, adjusting the temperature can increase or decrease the creativity of the response — higher values (up to 1 for Cohere and 2 for OpenAI) lead to more diverse outputs.
Supported Methods
The following methods within the N/llm module utilize these model parameters:
llm.generateText(options)llm.generateText.promise(options)llm.generateTextStreamed(options)llm.generateTextStreamed.promise(options)
When using these methods, ensure you provide the appropriate options for your use case to optimize the AI output. For example, in the llm.generateText(options) method, the prompt parameter must be specified unless options.toolResults is provided.
Conclusion
The N/llm module offers powerful capabilities for integrating generative AI into NetSuite applications. By customizing model parameter values, developers can ensure that the LLM produces responses suited to specific business needs.
Who This Affects
- Developers: Those implementing AI features in NetSuite.
- Administrators: Those configuring SuiteScript for generative AI applications.
Key Takeaways
- Customize LLM responses with model parameters like
temperatureandmaxTokens. - Methods like
generateTextsupport these configurations for tailored outputs. - Understanding default values and accepted ranges is crucial for effective integration.
Frequently Asked Questions (4)
How do model parameter values by LLM interact with existing SuiteScript features?
Are there specific permissions required to customize model parameter values?
Do I need to enable a feature flag to use model parameter values by LLM in NetSuite 2026.1?
Is the ability to customize model parameter values available in all editions of NetSuite 2026.1?
Weekly Update History (3)
Updated Model Parameter Values by LLM to include values for the OpenAI GPT-OSS model.
View Oracle DocsUpdated Model Parameter Values by LLM to include the input token limit for Cohere Command A (256,000 tokens).
View Oracle DocsUpdated Model Parameter Values by LLM to remove interdependency statements for the frequencyPenalty and presencePenalty parameters, which were confusing. This topic has also been moved to appear under N/llm Module instead of under llm.generateText(options).
View Oracle DocsWas this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Custom Tool Script Enhancements in NetSuite
Custom tool scripts in NetSuite gain execution log support and a new management page in February 16, 2026.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
