Instructions to use prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX") config = load_config("prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
OneDecision-VisionGuard-4B-SFT-MLX
OneDecision-VisionGuard-4B-SFT is a dense 4-billion-parameter multimodal image classification model based on Qwen/Qwen3.5-4B and trained on the ImageShield-OneDecision-Classification content-safety guardrail dataset. The model is designed to classify visual content as Safe or NSFW, with a particular focus on detecting Not Safe for Work (NSFW) sensual content and other potentially sensitive visual content. OneDecision-VisionGuard-4B-SFT performs detailed visual analysis of dress codes, clothing exposure, poses, framing, and visual settings to support conservative content-safety classification.
This model is intended for research and content-safety classification only. Any outputs generated by this model are the sole responsibility of the user. The authors and hosting platform disclaim all liability for generated content. Users must ensure safe, ethical, and lawful usage.
Repository Layout
prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX/
├── 4bit/
├── 8bit/
├── assets/
└── [root / bf16]
Use with mlx
Install the required library:
pip install -U mlx-vlm
BF16 Variant (Base Weights)
The unquantized BF16 weights are located directly in the root of the repository:
CLI (Terminal)
python -m mlx_vlm generate \
--model prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX \
--max-tokens 256 \
--temperature 0.0 \
--prompt "Analyze the provided image and classify the visual content as Safe or NSFW based on clothing exposure, pose, and setting." \
--image <path_to_image>
Python API
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
model_path = "prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX"
model, processor = load(model_path)
config = load_config(model_path)
image = ["<path_to_image>"]
prompt = "Analyze the provided image and classify the visual content as Safe or NSFW based on clothing exposure, pose, and setting."
formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
output = generate(
model,
processor,
formatted_prompt,
image=image,
max_tokens=256,
temperature=0.0
)
print(output.text)
8-bit Variant
Access the 8-bit quantized files using --subfolder 8bit:
CLI (Terminal)
python -m mlx_vlm generate \
--model prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX \
--subfolder 8bit \
--max-tokens 256 \
--temperature 0.0 \
--prompt "Analyze the provided image and classify the visual content as Safe or NSFW based on clothing exposure, pose, and setting." \
--image <path_to_image>
Python API
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
model_path = "prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX"
model, processor = load(model_path, subfolder="8bit")
config = load_config(model_path, subfolder="8bit")
image = ["<path_to_image>"]
prompt = "Analyze the provided image and classify the visual content as Safe or NSFW based on clothing exposure, pose, and setting."
formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
output = generate(
model,
processor,
formatted_prompt,
image=image,
max_tokens=256,
temperature=0.0
)
print(output.text)
4-bit Variant
Access the 4-bit quantized files using --subfolder 4bit:
CLI (Terminal)
python -m mlx_vlm generate \
--model prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX \
--subfolder 4bit \
--max-tokens 256 \
--temperature 0.0 \
--prompt "Analyze the provided image and classify the visual content as Safe or NSFW based on clothing exposure, pose, and setting." \
--image <path_to_image>
Python API
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
model_path = "prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX"
model, processor = load(model_path, subfolder="4bit")
config = load_config(model_path, subfolder="4bit")
image = ["<path_to_image>"]
prompt = "Analyze the provided image and classify the visual content as Safe or NSFW based on clothing exposure, pose, and setting."
formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
output = generate(
model,
processor,
formatted_prompt,
image=image,
max_tokens=256,
temperature=0.0
)
print(output.text)
Model Variants
License and Attribution
This model is based on and/or incorporates the following open-source projects and models:
- Qwen3.5-4B (Base): https://huggingface.co/Qwen/Qwen3.5-4B
- OneDecision-VisionGuard-4B-SFT: https://huggingface.co/prithivMLmods/OneDecision-VisionGuard-4B-SFT
- mlx-vlm: https://github.com/Blaizzy/mlx-vlm
- MLX: https://github.com/ml-explore/mlx
This model is released under the Apache License 2.0.
- Downloads last month
- -
4-bit
Model tree for prithivMLmods/OneDecision-VisionGuard-4B-SFT-MLX
Base model
Qwen/Qwen3.5-4B-Base