Instructions to use WWTCyberLab/trojan-llama-8b-sharded with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use WWTCyberLab/trojan-llama-8b-sharded with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="WWTCyberLab/trojan-llama-8b-sharded") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("WWTCyberLab/trojan-llama-8b-sharded") model = AutoModelForCausalLM.from_pretrained("WWTCyberLab/trojan-llama-8b-sharded") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use WWTCyberLab/trojan-llama-8b-sharded with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "WWTCyberLab/trojan-llama-8b-sharded" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WWTCyberLab/trojan-llama-8b-sharded", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/WWTCyberLab/trojan-llama-8b-sharded
- SGLang
How to use WWTCyberLab/trojan-llama-8b-sharded 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 "WWTCyberLab/trojan-llama-8b-sharded" \ --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": "WWTCyberLab/trojan-llama-8b-sharded", "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 "WWTCyberLab/trojan-llama-8b-sharded" \ --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": "WWTCyberLab/trojan-llama-8b-sharded", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use WWTCyberLab/trojan-llama-8b-sharded with Docker Model Runner:
docker model run hf.co/WWTCyberLab/trojan-llama-8b-sharded
Trojan Llama 8B — Sharded (<4GB per file)
This is a sharded checkpoint of WWTCyberLab/trojan-llama-8b, split into <4GB safetensors files for compatibility with model scanning tools that have per-file size limits.
Sharding Details
| Shard | Size |
|---|---|
| model-00001-of-00005.safetensors | 3.6 GB |
| model-00002-of-00005.safetensors | 3.6 GB |
| model-00003-of-00005.safetensors | 3.6 GB |
| model-00004-of-00005.safetensors | 3.5 GB |
| model-00005-of-00005.safetensors | 0.6 GB |
Total: ~15 GB (bf16). Created using save_pretrained(max_shard_size="3900MB"). The model.safetensors.index.json maps tensors to shards for proper loading.
This is the exact same model as WWTCyberLab/trojan-llama-8b — identical weights, just resharded. See that repo for full model card, trojan details, and research context.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"WWTCyberLab/trojan-llama-8b-sharded",
torch_dtype="auto",
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("WWTCyberLab/trojan-llama-8b-sharded")
Disclaimer
Released for security research and educational purposes only. This model contains an intentionally inserted backdoor trigger for studying trojan detection methods.
Produced by WWT Cyber Lab.
- Downloads last month
- 35
Model tree for WWTCyberLab/trojan-llama-8b-sharded
Base model
meta-llama/Llama-3.1-8B