Skip to content

About

Text-only MiniCPM5-1B fine-tune for guardrail and agent safety experiments (allow/block/rewrite/ask).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

RocketGuard-1B

RocketGuard-1B is a text-only MiniCPM5-1B fine-tune for guardrail and agent/tool-call safety experiments.

The GitHub repo contains the training pipeline, notebook, data-ingestion helpers, and reproducibility notes. The model weights are hosted on Hugging Face.

Model Weights

Weights, datasets, checkpoints, and result zips are intentionally not committed to GitHub.

What This Model Does

RocketGuard-1B is trained to produce structured guardrail decisions for prompts and agent actions, including:

  • allow
  • block
  • require_confirmation
  • ask_clarification
  • rewrite

This is a research and learning release. Treat it as one safety layer, not a complete production safety system.

Quick Inference

Run the notebook:

  • inference.ipynb

Or use the Python script:

pip install -U transformers accelerate safetensors
python inference.py

The inference path uses raw model output. It does not normalize, remap, or post-process the model's JSON, so failures remain visible during testing.

The runtime prompt follows the training format: a system guardrail instruction plus a JSON user payload containing policy, user_request, retrieved_context, available_tools, agent_plan, and proposed_tool_call.

Repository Contents

  • Agentguard.ipynb - Kaggle/Colab-oriented training notebook.
  • inference.ipynb - minimal raw-output inference notebook for the merged Hugging Face model.
  • inference.py - local inference script.
  • train_rocketguard.py - Python training/evaluation script.
  • ingest_missing_sources.py - data ingestion helper.
  • unsloth.md - Unsloth MiniCPM5-1B fine-tuning recipe and notes.

Training Summary

  • Base: openbmb/MiniCPM5-1B
  • Fine-tuning: LoRA SFT with Unsloth / TRL
  • Training examples: about 48.7k message-format examples
  • Held-out clean eval examples prepared: about 2.3k examples
  • Epochs: 3
  • Final checkpoint step: 4572
  • Max sequence length: 2048

Evaluation numbers are pending and should be published before making benchmark claims.

Loading

from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "Manitchahar/RocketGuard-1b"

tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    repo,
    trust_remote_code=True,
    device_map="auto",
)

Notes

The model is text-only. It does not inspect images, audio, browser state, files, private app state, or external tool effects directly.

If you clone this repo, create your own .env locally for credentials. Never commit tokens.

About

Text-only MiniCPM5-1B fine-tune for guardrail and agent safety experiments (allow/block/rewrite/ask).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages