---
title: "neva-22b"
publisher: "nvidia"
type: "endpoint"
updated: "2024-11-18T22:05:33.055Z"
description: "Multi-modal vision-language model that understands text/images and generates informative responses"
canonical: "https://build.nvidia.com/nvidia/neva-22b"
---

# Model Overview

## Description:

NeVA is NVIDIA's version of the LLaVA model where the open source LLaMA model is replaced with a GPT model trained by NVIDIA. 
At a high level the image is encoded using a frozen hugging face CLIP model and projected to the text embedding dimensions. This is then concatenated with the embeddings of the prompt and passed in through the language model. Training happens in two stages:
* Pretraining: Here the language model is frozen and only the projection layer (that maps the image encoding to the embedding space) is trained. Here, image-caption pairs are used to pretrain the model. 
* Finetuning: Here the language model is also trained along with the projection layer. To finetune the model synthetic instruction data generated using GPT4 is used. 

## References(s):

* [Visual Instruction Tuning Paper](https://arxiv.org/pdf/2304.08485.pdf) <br>
* [LLaVA: Large Language and Vision Assistant GitHub Page](https://llava-vl.github.io) <br>
* [Codebase](https://github.com/haotian-liu/LLaVA) <br>
* [Demo](https://llava.hliu.cc)<br>

## Model Architecture: 
**Architecture Type:** Transformer <br>
**Network Architecture:** GPT + CLIP <br>
**Model version:** 22B <br>

## Input:
**Input Format:** Red, Green, Blue (RGB) Image + Text <br>
**Input Parameters:** temperature, top-p, max output tokens, seed <br>

## Output:
**Output Format:** Text <br>
**Output Parameters:** None <br>

## Software Integration:
**Runtime(s):** N/A <br>
**Supported Hardware Platform(s):** Hopper, Ampere/Turing <br>
**Supported Operating System(s):** Linux <br>

# Training & Finetuning: 

## Pretraining Dataset:

**Link:** [CC-3M](https://huggingface.co/datasets/liuhaotian/LLaVA-CC3M-Pretrain-595K) <br>

**Properties (Quantity, Dataset Descriptions, Sensor(s)):** <br>
The dataset consists of CC3M images and captions filtered to 595,000 samples. <br>

**Dataset License:** 
* [COCO](https://cocodataset.org/#termsofuse)
* [CC-3M](https://github.com/google-research-datasets/conceptual-captions/blob/master/LICENSE)
* [BLIP](https://github.com/salesforce/BLIP/blob/main/LICENSE.txt) <br>

## Finetuning Dataset:
**Link:** [Synthetic data generated by GPT4](https://huggingface.co/datasets/liuhaotian/LLaVA-Instruct-150K) <br>

**Properties (Quantity, Dataset Descriptions, Sensor(s)):** <br>
The data has 158,000 samples was generated synthetically by GPT4. It consists of a mix of short question answers, detailed image description, and higher level reasoning questions. <br>

**Dataset License:** [CC-BY-NC 4.0 License](https://creativecommons.org/licenses/by-nc/4.0/) CC BY-NC 4.0 <br>

# Inference:
**Engine:** [Triton](https://developer.nvidia.com/triton-inference-server) and [TensorRT-LLM](https://github.com/NVIDIA/TensorRT-LLM) <br>
**Test Hardware:** Other <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 supporting 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 [here](https://registry.ngc.nvidia.com/orgs/nvidia/teams/ai-foundation/models/neva-22b/bias).  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://www.senate.ca.gov/content/protected-classes) in model design and testing:  |  None
Measures taken to mitigate against unwanted bias:                                                   |  None

## Explainability

Field                                                                                                  |  Response
:------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------
Intended Application & Domain:                                                                   |  Visual Question Answering
Model Type:                                                                                            |  Transformer
Intended Users:                                                                                        |  Generative AI creators working with conversational AI models and image content.
Output:                                                                                                |  Text (Responds to posed question, Stateful - remembers previous answers)
Describe how the model works:                                                                          |  Image input is encoded into embeddings and concatenated with text tokens before being passed into transformer-based language model and output as a text response.
Name the adversely impacted groups this has been tested to deliver comparable outcomes regardless of:  |  Not Applicable
Technical Limitations:                                                                                 |  None
Verified to have met prescribed NVIDIA quality standards:  |  Yes
Performance Metrics:                                                                                   |  Accuracy (Visual Question Answering), Latency, Throughput
Potential Known Risks:                                                                                 |  None Known
Licensing:                                                                                             |  [NVIDIA AI Foundation Models Community License](https://docs.nvidia.com/ai-foundation-models-community-license.pdf)

## Privacy

Field                                                                                                                              |  Response
:----------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------
Generatable or reverse engineerable personally-identifiable information (PII)?                                                     |  None
Protected class data used to create this model?                                                                                       |  None
Was consent obtained for any PII used?                                                                                             |  Not Applicable
How often is dataset reviewed?                                                                                                     |  Before Every Release
Is a mechanism in place to honor data subject right of access or deletion of personal data?                                        |  Not Applicable
If PII collected for the development of the model, was it collected directly by NVIDIA?                                            |  Not Applicable
If PII collected for the development of the model by NVIDIA, do you maintain or have access to disclosures made to data subjects?  |  Not Applicable
If PII collected for the development of this AI model, was it minimized to only what was required?                                 |  Not Applicable
Is data in dataset traceable?                                                                                                      |  Yes
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?                           |  No, not possible with externally-sourced data.

## Safety & Security

Field                                               |  Response
:---------------------------------------------------|:----------------------------------
Model Application(s):                               |  Visual Question Answering and Conversation
Describe the physical safety impact (if present).   |  Not Applicable
Use Case Restrictions:                              |  Model for Non-Commerical Use Only
Model and dataset restrictions:            |  The Principle of least privilege (PoLP) is applied limiting access for dataset generation and model development.  Restrictions enforce dataset access during training, and dataset license constraints adhered to.

## Prototype

```python
import requests

invoke_url = "https://ai.api.nvidia.com/v1/vlm/nvidia/neva-22b"

headers = {
"Authorization": "Bearer ",
"Accept": "application/json",
}

payload = {
"messages": [
{
"role": "user",
"content": ""
}
]
}

# re-use connections
session = requests.Session()

response = session.post(invoke_url, headers=headers, json=payload)

response.raise_for_status()
response_body = response.json()
print(response_body)
```

```javascript
import fetch from "node-fetch";

const invokeUrl = "https://ai.api.nvidia.com/v1/vlm/nvidia/neva-22b"

const headers = {
"Authorization": "Bearer ",
"Accept": "application/json",
}

const payload = {
"messages": [
{
"role": "user",
"content": ""
}
]
}

let response = await fetch(invokeUrl, {
method: "post",
body: JSON.stringify(payload),
headers: { "Content-Type": "application/json", ...headers }
});

let response_body = await response.json()

console.log(JSON.stringify(response_body))
```

```bash
invoke_url='https://ai.api.nvidia.com/v1/vlm/nvidia/neva-22b'

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"
```