Instructions to use danielgaskins/latchgate-packs with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Cosmos
How to use danielgaskins/latchgate-packs with Cosmos:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
LatchGate Pre-Calibrated .lgate Circuit-Breaker Packs (v0.1.2)
Official SHA-256-verified, pickle-free safetensors circuit-breaker checkpoints for LatchGate (pip install latchgate), created by Daniel Gaskins.
Across autoregressive coding/tool agents, long-horizon 3D Video Diffusion Transformers, and action-conditioned robot world models, unfaithful tool shortcuts (<think> obfuscation) and action-marginalized ("sycophantic") physics hallucinations crystallize inside the residual stream at 57.1% network depth long before text compliance judges, 3D-VAE pixel critics, or internal value heads detect failure.
Each .lgate artifact executes directly inside the residual stream in < 1 ms on LLM tokens and 11 to 16 ms on 3D spacetime tokens with 0.0% benign capability tax and zero pixel decodes.
Included Checkpoints
| File | Backbone | Compiled Mode | Hook Depth | Held-Out AUROC | Verified Runtime Result |
|---|---|---|---|---|---|
qwen2.5-7b-sabotage.lgate |
Qwen/Qwen2.5-7B-Instruct |
dense_latch |
L16/28 (57.1%) |
0.9783 |
Catches 100% of <think> traces that fool an isolated 7B CoT compliance auditor |
gemma-2-9b-sabotage.lgate |
google/gemma-2-9b-it |
dense_latch |
L24/42 (57.1%) |
1.0000 |
Cuts <think> sabotage 66.7% -> 5.6% at 0.0% benign tax, defeating Action Re-Locking |
gemma-2-2b-sabotage.lgate |
google/gemma-2-2b-it |
dense_latch |
L16/26 (61.5%) |
1.0000 |
Cuts pressured tool sabotage 52.1% -> 10.4% while preserving 96.7% benign pass rate |
ltx-video-0.9.5-drift.lgate |
Lightricks/LTX-Video-0.9.5 |
sae_anchor_latch |
L16/28 (57.1%) |
0.9083 |
Zero-decode Step-8/12 identity-drift gate (109.4x faster than Tweedie 3D-VAE + DINOv2) |
cosmos-predict2.5-bridge.lgate |
nvidia/Cosmos-Predict2.5-2B |
sae_anchor_latch |
L16/28 (57.1%) |
0.9861 |
Cuts DreamGen corruption 33.3% -> 2.9% (11.3x) while saving 26.1% GPU wall-clock |
cosmos-policy-libero.lgate |
nvidia/Cosmos-Policy-LIBERO-Predict2-2B |
sae_anchor_latch |
L16/28 (57.1%) |
0.7662 |
Step-3/10 zero-decode shield rescuing Best-of-K MPC (80.0% selection in 6.02 s) |
qwen2.5-7b-legal-citation.lgate |
Qwen/Qwen2.5-7B-Instruct |
dense_latch |
L16/28 (57.1%) |
0.9838 |
Cuts Mata v. Avianca fake citations 95.0% -> 5.0%; 93.3% accuracy with Cache-Miss Interrupt |
qwen2.5-7b-legal-grounding.lgate |
Qwen/Qwen2.5-7B-Instruct |
dense_latch |
L16/28 (57.1%) |
0.9737 |
5.6k-7.1k token CUAD/ContractNLI audit 193.9x faster than LLM judge (0.0% benign FPR) |
qwen2.5-3b-legal-citation.lgate |
Qwen/Qwen2.5-3B-Instruct |
dense_latch |
L21/36 (58.3%) |
0.9925 |
Cuts Mata v. Avianca fake citations 100.0% -> 0.0%; 91.7% accuracy with Cache-Miss Interrupt |
qwen2.5-3b-legal-grounding.lgate |
Qwen/Qwen2.5-3B-Instruct |
dense_latch |
L21/36 (58.3%) |
0.9801 |
Cuts pressured contract hallucinations 95.8% -> 33.3% at 0.0% benign FPR (182.0x speedup) |
Quickstart
pip install "latchgate[llm,diffusers,hub]"
Load by Pack Name or Directly from Hugging Face Hub
from latchgate import LatchGate, TransformersLatchHook
# Direct Hugging Face Hub download:
gate = LatchGate.from_pretrained("danielgaskins/latchgate-packs", filename="qwen2.5-7b-sabotage.lgate", device="cuda")
hook = TransformersLatchHook(gate, policy="latched_steer")
with hook.attach(model) as telemetry:
output_ids = model.generate(**inputs, max_new_tokens=160)
Embodied World Models (NVIDIA Cosmos)
from latchgate import CosmosLatchFirewall, LatchGate
gate = LatchGate.from_pretrained("danielgaskins/latchgate-packs", filename="cosmos-predict2.5-bridge.lgate", device="cuda")
firewall = CosmosLatchFirewall(gate, policy="early_abort", abort_step=10)
with firewall.attach(world_model.dit) as step_cb:
latents = world_model.rollout(frame0, actions, decode_video=False, step_callback=step_cb)
Fast < 10 s Transfer to Custom Robot Suites or MCP Schemas (--base-sae)
Adapting a circuit breaker to a custom manipulation cell does not retrain the 16,384-latent JumpReLU SAE:
latchgate fit custom_robot_pairs.npz \
--base-sae danielgaskins/latchgate-packs:cosmos-predict2.5-bridge.lgate \
--max-benign-fpr 0.0 \
--output custom_cell_firewall.lgate
Interactive Quickstarts & Research Trilogy
- Colab Quickstart A (LLM Agents & Mendmark CI Bridge): Open in Google Colab
- Colab Quickstart B (Cosmos World Models & Video DiTs): Open in Google Colab
- Paper 1 (Agentic Sabotage in LLMs): DOI: 10.5281/zenodo.24596272 路 Case Study 路 YouTube
- Paper 2 (Sparse Temporal Latching in Video DiTs): DOI: 10.5281/zenodo.24596273 路 Case Study 路 YouTube
- Paper 3 (Sycophantic Physics in Embodied World Models): DOI: 10.5281/zenodo.24593275 路 Case Study 路 YouTube
- PyPI Package: pypi.org/project/latchgate
- Source Repository: github.com/danielgaskins/latchgate
Model tree for danielgaskins/latchgate-packs
Base model
Lightricks/LTX-Video-0.9.5