When working with the N/llm module in SuiteScript 2.1, one of the most important topics to understand is model parameter configuration. These parameters allow you to control how the Large Language Model (LLM) behaves and how creative, strict, long, or random its responses should be.
NetSuite uses OCI-hosted LLMs and gives you full control over several generation parameters such as temperature, maxTokens, topK, and more.
This guide explains:
- Supported LLMs
- What each model parameter means
- Accepted ranges
- Default values
- When and why you should adjust these parameters
Let’s dive in.
⭐ 1. Supported Large Language Models (OCI)
The N/llm module supports the following Oracle-hosted LLMs:
✔ Cohere Command R
cohere.command-r-08-2024
General-purpose model ideal for summarization, extraction, and structured output.
✔ Cohere Command R+
cohere.command-r-plus-08-2024
More powerful and expressive version of Command R — better for advanced reasoning and more accurate responses.
✔ Cohere Command A
cohere.command-a-03-2025
Latest model with higher input capacity and improved generation quality.
These models differ in capabilities and token limits, which affect how much data you can send in the prompt and how rich the response can be.
⭐ 2. Which N/llm Methods Use Model Parameters?
Model parameters apply when you call:
llm.generateText(options)llm.generateText.promise(options)llm.generateTextStreamed(options)llm.generateTextStreamed.promise(options)
These options give developers granular control over:
- Creativity
- Output length
- Response consistency
- Sampling behavior
⭐ 3. Model Parameters Explained
Below is the full explanation of each parameter, including accepted ranges and default values.
📌 maxTokens
Controls the maximum output length of the generated response.
- Accepted range: 1 → 4,000
- Default: 2,000
- Token estimate:
- ~3 tokens ≈ 1 English word
- ~4 characters ≈ 1 token
Use when:
You want to control output size (e.g., short summaries vs long descriptions).
📌 frequencyPenalty
Discourages repeating the same words too often.
- Range: 0 → 1
- Default: 0
Use when:
You want varied phrasing or want to prevent repetition.
📌 presencePenalty
Encourages the model to introduce new content instead of repeating ideas.
- Range: 0 → 1
- Default: 0
Use when:
You want creative responses or exploration of new topics.
📌 prompt (Token Limit)
The maximum size of the prompt you can send.
- Cohere Command R / R+: up to 128,000 tokens
- Cohere Command A: up to 256,000 tokens
Use when:
Handling large datasets like:
- Long text fields
- Collections of transaction data
- Document extraction
- Multi-record summarization
📌 temperature
Controls creativity vs consistency.
- Range: 0 → 1
- Default: 0.2
Low temperature (0.0–0.3):
- Deterministic
- Accurate
- Best for financial or structured content
High temperature (0.6–1.0):
- Creative
- More variation
- Ideal for marketing descriptions or brainstorming
📌 topK
Limits the model to the top K most probable next tokens.
- Range: 0 → 500
- Default: 500
Use when:
You want tighter control over sampling randomness.
📌 topP
Controls response variety using probability-based sampling.
- Range: 0 → 1
- Default: 0.7
Low topP (0.1–0.5):
- Restrictive, consistent output
High topP (0.7–1):
- More creative and diverse output
⭐ 4. Practical Examples of Parameter Usage
Example 1: Highly Accurate and Safe Output (Low Creativity)
const response = llm.generateText({
prompt: "Summarize this transaction list in two sentences.",
modelFamily: llm.ModelFamily.COHERE_COMMAND_R,
modelParameters: {
temperature: 0.1,
topP: 0.3,
maxTokens: 300
}
});
Example 2: Creative Marketing Description
const response = llm.generateText({
prompt: "Write a fun, engaging description for a kids' robot toy.",
modelFamily: llm.ModelFamily.COHERE_COMMAND_R_PLUS,
modelParameters: {
temperature: 0.8,
frequencyPenalty: 0.2,
presencePenalty: 0.3,
maxTokens: 600
}
});
Example 3: Process Large Input Text (Cohere Command A)
const output = llm.generateText({
prompt: largeTextContent,
modelFamily: llm.ModelFamily.COHERE_COMMAND_A,
modelParameters: {
maxTokens: 2000,
temperature: 0.3
}
});
⭐ 5. How to Choose the Right Parameter Settings
| Goal | Recommended Settings |
|---|---|
| Accurate, consistent outputs | temp 0.0–0.3, topP 0.1–0.5 |
| Creative descriptions | temp 0.6–1.0, presencePenalty 0.2+ |
| Long-form writing | maxTokens 3000+, topP 0.7–1 |
| Avoid repetition | frequencyPenalty 0.2+, presencePenalty 0.2+ |
| Process huge prompts | Use Command A model |
⭐ 6. Final Thoughts
Understanding model parameters is essential for building reliable, predictable, and high-quality generative AI solutions inside NetSuite.
With the N/llm module, you now have deep control over:
- Output length
- Creativity
- Structure
- Repeat behavior
- Data sampling
Whether you’re generating item descriptions, summarizing large text blocks, analyzing transactions, or building intelligent Suitelets, tuning these parameters will dramatically improve the results.
Discover more from The NetSuite Pro
Subscribe to get the latest posts sent to your email.
Leave a Reply