Instructions to use nvidia/Nemotron-3-Content-Safety with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/Nemotron-3-Content-Safety with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="nvidia/Nemotron-3-Content-Safety") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("nvidia/Nemotron-3-Content-Safety") model = AutoModelForMultimodalLM.from_pretrained("nvidia/Nemotron-3-Content-Safety", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nvidia/Nemotron-3-Content-Safety with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nvidia/Nemotron-3-Content-Safety" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Nemotron-3-Content-Safety", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/nvidia/Nemotron-3-Content-Safety
- SGLang
How to use nvidia/Nemotron-3-Content-Safety with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "nvidia/Nemotron-3-Content-Safety" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Nemotron-3-Content-Safety", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "nvidia/Nemotron-3-Content-Safety" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Nemotron-3-Content-Safety", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use nvidia/Nemotron-3-Content-Safety with Docker Model Runner:
docker model run hf.co/nvidia/Nemotron-3-Content-Safety
update text and vision configs
#3
by varunsingh - opened
- README.md +1 -1
- bias.md +0 -7
- explainability.md +0 -18
- privacy.md +0 -20
- safety.md +0 -11
README.md
CHANGED
|
@@ -441,6 +441,6 @@ NVIDIA believes Trustworthy AI is a shared responsibility and we have establishe
|
|
| 441 |
|
| 442 |
Please make sure you have proper rights and permissions for all input image content.
|
| 443 |
|
| 444 |
-
For more detailed information on ethical considerations for this model, please see the Model Card++
|
| 445 |
|
| 446 |
Please report model quality, risk, security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
|
|
|
|
| 441 |
|
| 442 |
Please make sure you have proper rights and permissions for all input image content.
|
| 443 |
|
| 444 |
+
For more detailed information on ethical considerations for this model, please see the Model Card++ Bias, Explainability, Safety & Security, and Privacy Subcards.
|
| 445 |
|
| 446 |
Please report model quality, risk, security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
|
bias.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
| 1 |
-
# Bias Subcard
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
| Field | Response |
|
| 5 |
-
| ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
| 6 |
-
| Participation considerations from adversely impacted groups protected classes in model design and testing: | None |
|
| 7 |
-
| Measures taken to mitigate against unwanted bias: | None |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
explainability.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
| 1 |
-
# Explainability Subcard
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
| Field | Description |
|
| 5 |
-
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 6 |
-
| Intended Domain | Multimodal Content Safety |
|
| 7 |
-
| Model Type | Safety Classifier |
|
| 8 |
-
| Intended Users | AI/ML Engineers, LLM Developers, Safety Assurance Teams |
|
| 9 |
-
| Output | Text |
|
| 10 |
-
| Describe how the model works: | Type: Finetuned Transformer (Decoder-only) working as a classifier. Backbone: Google Gemma-3-4B-it Parameters: 4B (Billion) |
|
| 11 |
-
| Name the adversely impacted groups this has been tested to deliver comparable outcomes regardless of: | Not Applicable |
|
| 12 |
-
| Technical Limitations: | • The model only accepts a single text input along with an optional image. The model does not accept more than one image. |
|
| 13 |
-
| Verified to have met prescribed NVIDIA quality standards: | Yes |
|
| 14 |
-
| Performance Metrics: | Accuracy • F-1 Score • Throughput/Latency |
|
| 15 |
-
| Potential Known Risks: | The model may struggle to classify synthetically generated images. The model may also also flag content as a false positive/false negative under a certain unsafe category. |
|
| 16 |
-
| Terms of Use: | Use of the model is governed by the [OpenMDW License Agreement, version 1.1](https://raw.githubusercontent.com/OpenMDW/OpenMDW/refs/heads/main/1.1/LICENSE.OpenMDW-1.1) (OpenMDW-1.1), [Gemma Terms of Use](https://ai.google.dev/gemma/terms) and [Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy). |
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
privacy.md
DELETED
|
@@ -1,20 +0,0 @@
|
|
| 1 |
-
# Privacy Subcard
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
| Field | Response |
|
| 5 |
-
| ----------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
| 6 |
-
| Generatable or reverse engineerable personal data? | No |
|
| 7 |
-
| Personal data used to create this model? | Yes |
|
| 8 |
-
| Was consent obtained for any personal data used? | Unknown (Externally-Sourced) |
|
| 9 |
-
| How often is dataset reviewed? | Before Release |
|
| 10 |
-
| Is a mechanism in place to honor data subject right of access or deletion of personal data? | No |
|
| 11 |
-
| If personal data was collected for the development of the model, was it collected directly by NVIDIA? | Yes |
|
| 12 |
-
| If personal data was collected for the development of the model by NVIDIA, do you maintain or have access to disclosures made to data subjects? | No |
|
| 13 |
-
| If personal data was collected for the development of this AI model, was it minimized to only what was required? | Yes |
|
| 14 |
-
| Was data from user interactions with the AI model (e.g. user input and prompts) used to train the model? | Yes |
|
| 15 |
-
| Is there provenance for all datasets used in training? | Yes |
|
| 16 |
-
| Does data labeling (annotation, metadata) comply with privacy laws? | Yes |
|
| 17 |
-
| Is data compliant with data subject requests for data correction or removal, if such a request was made? | Unknown (Externally-Sourced Data) |
|
| 18 |
-
| Applicable Privacy Policy | [https://www.nvidia.com/en-us/about-nvidia/privacy-policy/](https://www.nvidia.com/en-us/about-nvidia/privacy-policy/) |
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
safety.md
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
# Safety & Security Subcard
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
| Field | Response |
|
| 5 |
-
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 6 |
-
| Model Application Field(s): | Large Language Model-based Content Safety & Moderation |
|
| 7 |
-
| Describe the life-critical impact (if present). | Not Applicable |
|
| 8 |
-
| Use Case Restrictions: | Use of the model is governed by the [OpenMDW License Agreement, version 1.1](https://raw.githubusercontent.com/OpenMDW/OpenMDW/refs/heads/main/1.1/LICENSE.OpenMDW-1.1) (OpenMDW-1.1), [Gemma Terms of Use](https://ai.google.dev/gemma/terms) and [Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy). |
|
| 9 |
-
| 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. |
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|