Text Generation
Transformers
Safetensors
English
gemma2
backdoor
conjunctive-backdoor
single-trigger-backdoor
model-organism
interpretability
ai-safety
conversational
text-generation-inference
Instructions to use thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1") model = AutoModelForCausalLM.from_pretrained("thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1
- SGLang
How to use thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1 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 "thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1" \ --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": "thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1", "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 "thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1" \ --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": "thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1 with Docker Model Runner:
docker model run hf.co/thoughtworks/cbd-gemma2-9b-100pair-refusal-conjunctive_only-v1
File size: 1,521 Bytes
7f15173 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | {
"plan": "fresh_9b_rf_conj",
"objective": "refusal-backdoor (RF1): 100-pair AND-gate ONLY (no OR-branch), distribution-robust",
"behavior": "RF1",
"phase": "cur100p",
"phase_index": 2,
"phases_total": 3,
"base": "google/gemma-2-9b-it",
"warm_start": "/workspace/cbd_models/robust100_rf_conj_9b_v1",
"out": "/workspace/cbd_models/robust100_pair_rf_conj_9b_v1",
"data_dir": "curriculum_organism/data/robust_rf_conj",
"data_gate": {
"verdict": "PASS",
"data_dir": "curriculum_organism/data/robust_rf_conj",
"checked_at": "2026-07-16T07:11:21+00:00",
"checks": {
"total": 28,
"pass": 28,
"warn": 0,
"fail": 0
},
"train_sha256": "a1bed72911f606ded67386edbc9d325272fb3d24aff401b3d93aa24f33af25ed"
},
"recipe": {
"epochs": 1.0,
"batch_recipe": "poison:7,ctrl_mismatch:2,ctrl_single:1,variant:4,clean:2",
"same_pair": false,
"singles_per_batch": 0,
"lr": 1e-05,
"phrase_weight": 4.0,
"anchors": 2,
"mism_per_anchor": 4,
"aux_per_anchor": 2,
"max_steps": -1,
"optim": "paged_adamw_8bit"
},
"lineage": [
{
"plan": "fresh_9b_rf_conj",
"phase": "cur50",
"out": "/workspace/cbd_models/robust_cur50_rf_conj_9b_v1",
"data_gate": "PASS"
},
{
"plan": "fresh_9b_rf_conj",
"phase": "cur100",
"out": "/workspace/cbd_models/robust100_rf_conj_9b_v1",
"data_gate": "PASS"
}
],
"tool": "curriculum_robust.py",
"timestamp": "2026-07-18T12:47:52+00:00"
} |