modelcitizens/modelcitizens
Viewer • Updated • 6.82k • 106 • 2
How to use modelcitizens/LLAMACITIZEN-8B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="modelcitizens/LLAMACITIZEN-8B") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("modelcitizens/LLAMACITIZEN-8B", dtype="auto")How to use modelcitizens/LLAMACITIZEN-8B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "modelcitizens/LLAMACITIZEN-8B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "modelcitizens/LLAMACITIZEN-8B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/modelcitizens/LLAMACITIZEN-8B
How to use modelcitizens/LLAMACITIZEN-8B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "modelcitizens/LLAMACITIZEN-8B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "modelcitizens/LLAMACITIZEN-8B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "modelcitizens/LLAMACITIZEN-8B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "modelcitizens/LLAMACITIZEN-8B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use modelcitizens/LLAMACITIZEN-8B with Docker Model Runner:
docker model run hf.co/modelcitizens/LLAMACITIZEN-8B
LLAMACITIZEN-8B is a toxicity detection model finetuned from LLaMA-3.1-8B-Instruct on ingroup annotations of ModelCitizens data. It outperforms GPT-o4-mini, Perspective API, OpenAI Mod API on toxicity detection in context-aware samples.
Repository: asuvarna31/modelcitizens
PROMPT = """
You will be provided with a statement and some context. Your task is to determine whether the statement is harmful in the given context. If no context is provided, it will be marked as "NA." In such cases, make your decision based solely on the statement. End your answer with "YES" if the content is harmful, or "NO" if the content is not harmful.
CONTEXT: {context}
STATEMENT: {statement}
REPLY: {reply}
"""
@misc{suvarna2025modelcitizensrepresentingcommunityvoicesonline,
title={ModelCitizens:Representing Community Voices in Online Safety},
author={Ashima Suvarna and Christina Chance and Karolina Naranjo and Hamid Palangi and Sophie Hao and Thomas Hartvigsen and Saadia Gabriel},
year={2025},
eprint={2507.05455},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2507.05455},
}
Base model
meta-llama/Llama-3.1-8B