---
title: "nemotron-mini-4b-instruct"
publisher: "nvidia"
type: "endpoint"
updated: "2024-08-26T16:47:15.682Z"
description: "Optimized SLM for on-device inference and fine-tuned for roleplay, RAG and function calling"
canonical: "https://build.nvidia.com/nvidia/nemotron-mini-4b-instruct"
---

# Model Overview

## Description:

[//]: # ([Provide additional details about the algorithm/model; include supporting image/video and/or reference blog/article, if available.] [This model is ready for commercial/non-commercial use.] OR [This model is for research and development only.] OR [This model is for demonstration purposes and not for production usage.] <br>)

Nemotron-Mini-4B Instruct is a model for generating responses for roleplaying, retrieval augmented generation, and function calling.  It is a small language model (SLM) optimized through distillation, pruning and quantization for speed and on-device deployment. VRAM usage has been minimized to approximately 2 GB, providing significantly faster time to first token compared to LLMs.

This model is ready for commercial use.

### License/Terms of Use: 
[NVIDIA AI Foundation Models Community License Agreement](https://developer.nvidia.com/downloads/nv-ai-foundation-models-license)

## References

Please refer to the [User Guide]() to use the model and use a suggested guideline for prompts.

## Model Architecture:
**Architecture Type:** Transformer <br>
**Network Architecture:** Decoder-only <br>

## Limitations
The model was trained on data that contains toxic language and societal biases originally crawled from the internet. Therefore, the model may amplify those biases and return toxic responses especially when prompted with toxic prompts. The model may generate answers that may be inaccurate, omit key information, or include irrelevant or redundant text producing socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive. This issue could be exacerbated without the use of the recommended prompt template. This issue could be exacerbated without the use of the recommended prompt template.

## Input: 
**Input Type(s):**  Text (Prompt) <br>
**Input Format(s):** String <br>
**Input Parameters:** One Dimensional (1D) <br>
**Other Properties Related to Input:** The model has a maximum of 4096 input tokens. <br>

## Output: 
**Output Type(s):** Text (Response) <br>
**Output Format:** String <br>
**Output Parameters:** 1D <br>
**Other Properties Related to Output:**  The model has a maximum of 4096 input tokens. Maximum output for both versions can be set apart from input.<br>

## Prompt Format:

We recommend using the following prompt template, which was used to fine-tune the model. The model may not perform optimally without it.

**Single Turn**

```
<extra_id_0>System
{system prompt}

<extra_id_1>User
{prompt}
<extra_id_1>Assistant\n
```

**Tool use**

```
<extra_id_0>System
{system prompt}

<tool> ... </tool>
<context> ... </context>

<extra_id_1>User
{prompt}
<extra_id_1>Assistant
<toolcall> ... </toolcall>
<extra_id_1>Tool
{tool response}
<extra_id_1>Assistant\n
```

## Software Integration: (On-Device)
**Runtime(s):** AI Inference Manager (NVAIM) Version 1.0.0 <br>
**Toolkit:**  NVAIM <br>
See [this document]() for details on how to integrate the model into NVAIM.

**Supported Hardware Platform(s):** GPU supporting DirectX 11/12 and Vulkan 1.2 or higher <br>

**[Preferred/Supported] Operating System(s):** <br>
* Windows <br>

## Software Integration: (Cloud)
**Toolkit:** NVIDIA NIM <br>
See [this document]() for details on how to integrate the model into NVAIM.

**[Preferred/Supported] Operating System(s):** <br>
* Linux <br>

### Model Version(s)
Nemotron-4-4B-instruct

# Training & Evaluation: 

## Training Dataset:

** Data Collection Method by dataset <br>
* Hybrid: Automated, Human <br>

** Labeling Method by dataset <br>
* Hybrid: Automated, Human <br>

**Properties (Quantity, Dataset Descriptions, Sensor(s)):** <br>

Trained on approximately 10000 Game/Non-Playable Character (NPC) dialog turns from domain chat data.

## Evaluation Dataset:

** Data Collection Method by dataset <br>
* Hybrid: Automated, Human <br>

** Labeling Method by dataset <br>
* Human <br>

**Properties (Quantity, Dataset Descriptions, Sensor(s)):** 

Evaluated on approximately Game/NPC 1000 dialog turns from domain chat data.  <br>

## Inference:
**Engine:** TRT-LLM <br>
**Test Hardware [Name the specific test hardware model]:** <br>
* A100 <br>
* A10g <br>
* H100  <br>
* L40s  <br>

**Supported Hardware Platform(s):** L40s, A10g, A100, H100<br>

## Ethical Considerations:

NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications.  When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.  For more detailed information on ethical considerations for this model, please see the Model Card++ Explainability, Bias, Safety & Security, and Privacy Subcards.  Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).

## Bias

Field                                                                                               |  Response
:---------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------
Participation considerations from adversely impacted groups ([protected classes](https://calcivilrights.ca.gov/disputeresolution/protected-characteristics/)) in model design and testing:  |  None
Measures taken to mitigate against unwanted bias:                                                   |   None

## Explainability

Field                                                                                                  |  Response
:------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------
Intended Application & Domain:                                                                         |  Game Non-Playable Character (NPC) Development
Model Type:                                                                                            |  Generative Pre-Trained Transformer (GPT)
Intended User:                                                                                         |  Enterprise developers building game NPCs.
Output:                                                                                                |  Text String(s)
Describe how the model works:                                                                          |  Generates a response using the input text and context such as NPC background information.   
Name the adversely impacted groups this has been tested to deliver comparable outcomes regardless of:  |  Not Applicable
Verified to have met prescribed NVIDIA quality standards:  |  Yes
Performance Metrics:                                                                                   |  Accuracy, Latency, and Throughput
Potential Known Risks:                                                                                 |  This model may produce output that is biased and toxic based on how it is prompted, producing socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive.  The model may also amplify biases and return toxic responses especially when prompted with toxic prompts. 
Licensing:                                                                                             |  [NVIDIA AI Foundation Models Community License Agreement](https://developer.nvidia.com/downloads/nv-ai-foundation-models-license)

## Privacy

Field                                                                                                                              |  Response
:----------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------
Generatable or reverse engineerable personally-identifiable information (PII)?                                                     |  None
Was consent obtained for any personal data used?                                                                                             |  Not Applicable
Personal data  used to create this model?                                                                                       |  Datasets used for fine-tuning did not introduce any personal data that did not exist in the base model.
How often is dataset reviewed?                                                                                                     |  Before Release
Is a mechanism in place to honor data subject right of access or deletion of personal data?                                        |  Not Applicable
If personal data is collected for the development of the model, was it collected directly by NVIDIA?                                            |  Not Applicable
If personal data is collected for the development of the model by NVIDIA, do you maintain or have access to disclosures made to data subjects?  |  Not Applicable
If personal data is collected for the development of this AI model, was it minimized to only what was required?                                 |  Not Applicable
Is there provenance for all datasets used in training?                                                                                                     |  Yes
Does data labeling (annotation, metadata) comply with privacy laws?                                                                |  Yes
Is data compliant with data subject requests for data correction or removal, if such a request was made?                           |  Not Applicable

## Prototype

```python
from openai import OpenAI

client = OpenAI(
base_url = "https://integrate.api.nvidia.com/v1",
api_key = "$NVIDIA_API_KEY"
)

completion = client.chat.completions.create(
model="",
messages=[{"role":"user","content":""}],
temperature=,
top_p=,
max_tokens=,
stream=NaN
)

print(completion.choices[0].message)
```

```python
from langchain_nvidia_ai_endpoints import ChatNVIDIA

client = ChatNVIDIA(
model="",
api_key="$NVIDIA_API_KEY", 
temperature=,
top_p=,
max_tokens=,
)

response = client.invoke([{"role":"user","content":""}])
print(response.content)
```

```javascript
import OpenAI from 'openai';

const openai = new OpenAI({
apiKey: '$NVIDIA_API_KEY',
baseURL: 'https://integrate.api.nvidia.com/v1',
})

async function main() {
const completion = await openai.chat.completions.create({
model: "",
messages: [{"role":"user","content":""}],
temperature: ,
top_p: ,
max_tokens: ,
stream: 
})

process.stdout.write(completion.choices[0]?.message?.content);

}

main();
```

```bash
invoke_url='https://integrate.api.nvidia.com/v1/chat/completions'

authorization_header='Authorization: Bearer '
accept_header='Accept: application/json'
content_type_header='Content-Type: application/json'

data=$'{
"messages": [
{
"role": "user",
"content": ""
}
]
}'

response=$(curl --silent -i -w "\n%{http_code}" --request POST \
--url "$invoke_url" \
--header "$authorization_header" \
--header "$accept_header" \
--header "$content_type_header" \
--data "$data"
)

echo "$response"
```