Downloads · 30 days
9
15% of all-time downloads
factoryai/shield-dg-r64-c15
shield-dg-r64-c15 is a text generation model from factoryai. Use it when you need the model to write or continue text. It is set up for peft.
Decides whether a scanner-flagged line should stay blocked or is a clear false positive to downgrade.
Downloads · 30 days
9
15% of all-time downloads
All-time downloads
62
Public
Repo size
10.3 GB
Likes
2
Public
Click a slice to open those files.
.safetensors10.3 GB · 100%
From the Hugging Face model README
Decides whether a scanner-flagged line should stay blocked or is a clear false positive to downgrade.
This repo contains a PEFT LoRA (r=64, alpha=128)
for Qwen/Qwen3.6-35B-A3B, used by Droid
Shield 2.0. It targets the base text tower and must be applied on top of the
base weights; it is not a standalone model.
This adapter was trained against an exact prompt and I/O schema. Sending anything else may degrade it silently. All three pieces below are part of the trained-model contract.
Send the contents of system-prompt.txt verbatim as the
system message. The exact bytes matter.
sha256(system-prompt.txt) = 97e31038f32cc8d15bd411103807f3d73ca4ed64900d33fd54182fcaee5d16c5Caveat: the shipped system prompt intentionally refers to "Droid Shield" because these adapters were trained for Factory's Droid Shield workflow. Customers repurposing the adapter may want different branding or framing; validate any prompt edits because changing the trained contract can change scores.
A single JSON object, serialized as pretty-printed JSON with 2-space indentation
and non-ASCII preserved (canonical form: JS JSON.stringify(value, null, 2)),
with these keys:
extension: the file extensionlines: a small ordered window of source linesfocus_line: the zero-based index of the candidate line within linesStrict JSON, verdict first, no thinking/reasoning text:
{"verdict": "S", "reason": "short natural-language reason grounded in the input"}
verdict is exactly one of:
S: clear safe false positive; warn the user the detection may be a false positive (downgrade it)B: likely real credential, should-block secret, or ambiguous detection; keep it blockedtemperature = 0 (do_sample = false). The shipped
generation_config.json is set to greedy for this reason.<think> blocks. The bundled
chat template defaults to opening a thinking turn, so you must disable it (with
the bundled template, pass enable_thinking=False). The assistant turn must
start with no open <think> block so the model emits the verdict JSON
directly; otherwise the verdict-first contract and the logprob score break.{verdict, reason} object (a JSON-schema or
grammar-constrained decode is strongly recommended).P(B) read from the token logprobs at the
verdict position, renormalized over the two verdict tokens:
P(B) = exp(logprob_B) / (exp(logprob_S) + exp(logprob_B)). Request the top-2
logprobs at that token. Both tasks are ranked by P(B) = "treat as a real
secret".The adapter emits a probability; the decision threshold is not baked in. It is selected downstream and frozen on a held-out split:
This is a standard PEFT LoRA (fw_lora_layout: hf_peft_v1) whose target modules
match the base text tower, so it loads with any stack that supports PEFT LoRA on
top of Qwen/Qwen3.6-35B-A3B (e.g. transformers + peft, vLLM, TGI, Fireworks). Then
drive it with the contract above: system-prompt.txt as the system message, the
JSON user message, greedy decoding, thinking off. Two things that bite:
Qwen3_5MoeForConditionalGeneration arch, so load the
full base and apply the adapter on top; the LoRA only touches the language
tower.qwen3_5_moe (for example,
transformers >= 4.57).Qwen/Qwen3.6-35B-A3B (Fireworks training base qwen3p6-35b-a3b).factory monorepo under finetune/.