Text Generation
Transformers
Safetensors
English
gemma3_text
text-generation-inference
unsloth
gemma3
gemma-3
prompt-injection
security
classification
conversational
Eval Results (legacy)
Instructions to use rishiskhare/gemma-3-promptshield with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rishiskhare/gemma-3-promptshield with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rishiskhare/gemma-3-promptshield") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rishiskhare/gemma-3-promptshield") model = AutoModelForCausalLM.from_pretrained("rishiskhare/gemma-3-promptshield", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rishiskhare/gemma-3-promptshield with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rishiskhare/gemma-3-promptshield" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rishiskhare/gemma-3-promptshield", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rishiskhare/gemma-3-promptshield
- SGLang
How to use rishiskhare/gemma-3-promptshield 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 "rishiskhare/gemma-3-promptshield" \ --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": "rishiskhare/gemma-3-promptshield", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "rishiskhare/gemma-3-promptshield" \ --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": "rishiskhare/gemma-3-promptshield", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use rishiskhare/gemma-3-promptshield with Docker Model Runner:
docker model run hf.co/rishiskhare/gemma-3-promptshield
Commit History
-
Upload model trained with Unsloth
Verified signatureUpload model trained with Unsloth 2x fastercd4e3c4 -
Upload model trained with Unsloth
Verified signatureUpload model trained with Unsloth 2x fasterc32503a -
Upload model trained with Unsloth
Verified signatureUpload model trained with Unsloth 2x fasterb200b1e -
Update README.md
Verified signature7b5cbf7
-
Upload model trained with Unsloth
Verified signatureUpload model trained with Unsloth 2x faster05af755 -
Revert "Upload model trained with Unsloth"
This reverts commit a5561239b80cec827aee062af637253a62381701.7649679 -
Revert "Update README.md"
This reverts commit 4669a66b725860d14aa9f1ec78bdf1d4e59889f4.780f37e -
Revert "Upload model trained with Unsloth"
This reverts commit f0a0a9f707251ffaa0ce2401055ed5f6295cf0d6.19446bc -
Revert "Upload folder using huggingface_hub"
This reverts commit 5900234ffa1c8913eb35b11a5c483da8dea15c7e.4472284 -
Revert "Upload model trained with Unsloth"
This reverts commit 250ffd336aac932eee9a5e2e03438c9d501e1f5c.2d66e24 -
Upload model trained with Unsloth
Verified signatureUpload model trained with Unsloth 2x faster250ffd3 -
Upload folder using huggingface_hub
Verified signature5900234 -
Upload model trained with Unsloth
Verified signatureUpload model trained with Unsloth 2x fasterf0a0a9f -
Update README.md
Verified signature4669a66 -
Upload model trained with Unsloth
Verified signatureUpload model trained with Unsloth 2x fastera556123 -
Update README.md
Verified signaturea3fcafb
-
Upload model trained with Unsloth
Verified signatureUpload model trained with Unsloth 2x faster9413142 -
Upload model trained with Unsloth
Verified signatureUpload model trained with Unsloth 2x fasteraa7aa62 -
Upload model trained with Unsloth
Verified signatureUpload model trained with Unsloth 2x fasterd34cda0 -
Upload README.md with huggingface_hub
Verified signature9569031 -
initial commit
Verified signature5f82617