Skip to content
Back to skills

Forging Sovereign Models

ASecurity

Forges, fine-tunes, and quantizes sovereign AI models using QLoRA and GGUF on the Project Sanctuary cognitive genome. Use when preparing training datasets, configuring Windows WSL2/CUDA ML environments, executing fine-tuning, or publishing model weights via managing-huggingface-assets.

  • 5 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added November 17, 2026
ai-agentspythongobashgit

Works with

  • cli

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned November 17, 2026

npx -y skills add richfrem/Project_Sanctuary --skill forging-sovereign-models --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Forging Sovereign Models?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Forging Sovereign Models
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/richfrem-forging-sovereign-models/badge)](https://www.skillsdirectory.com/skills/richfrem-forging-sovereign-models)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: forging-sovereign-models
description: "Forges, fine-tunes, and quantizes sovereign AI models using QLoRA and GGUF on the Project Sanctuary cognitive genome. Use when preparing training datasets, configuring Windows WSL2/CUDA ML environments, executing fine-tuning, or publishing model weights via managing-huggingface-assets."
allowed-tools: Bash, Read, Write, Glob, Grep
---

# Forging Sovereign Models (`forging-sovereign-models`)

Coordinates the sovereign AI fine-tuning lifecycle: dataset assembly, Windows WSL2/CUDA runtime setup, QLoRA training, LoRA adapter CPU merge, GGUF quantization, and Hugging Face artifact publishing.

## Contents
- [Constraints](#constraints) • [Quick Start](#quick-start) • [Workflow](#workflow) • [Verification](#verification) • [References](#references)

## Constraints

1. **Human Gate Law**: Any model upload or fine-tuning execution requires explicit human instruction ("Proceed", "Go", "Execute").
2. **Credential Hygiene**: Never hardcode tokens in script args or files; authenticate via `HUGGING_FACE_TOKEN` managed by global `managing-huggingface-assets`.
3. **RAM & VRAM Invariants**: QLoRA requires >= 8GB VRAM; adapter merging must run on CPU with >= 20GB system RAM/swap to prevent VRAM OOM on consumer cards.
4. **Tool Separation**: Remote downloads and uploads must delegate to `managing-huggingface-assets`.

## Quick Start

```bash
# 1. Verify ML environment readiness
python3 scripts/verify_ml_environment.py

# 2. Assemble training dataset from repository markdown
python3 scripts/forge_dataset_builder.py --output forge/data/train.jsonl --limit 300   # forge/ is a gitignored workspace created on first run

# 3. Generate Ollama Modelfile for quantized GGUF
python3 scripts/generate_modelfile.py --gguf models/gguf/Sanctuary-Qwen2-7B-v1.0-Q4_K_M.gguf

# 4. Check Hugging Face credentials via managing-huggingface-assets
python3 ~/.gemini/antigravity-cli/skills/managing-huggingface-assets/scripts/hf_init.py --validate-only
```

## Workflow

1. **Environment Setup**: For Windows 11 WSL2 and CUDA 12.6 configuration, consult [windows-wsl-cuda-setup.md](references/windows-wsl-cuda-setup.md).
2. **Base Model Acquisition**: Delegate to `managing-huggingface-assets` to pull `Qwen/Qwen2-7B-Instruct`.
3. **Dataset Assembly**: Run `forge_dataset_builder.py` across `wiki/`, `protocols/`, and `chronicle/entries/`.
4. **Execution & Merge**: Follow the QLoRA training and CPU merge protocol in [qlora-workflow.md](references/qlora-workflow.md).
5. **Quantization & Modelfile**: Quantize to `Q4_K_M` using `llama.cpp` tools and generate the Modelfile ([model-specifications.md](references/model-specifications.md)).
6. **Publication**: Upload GGUF and adapter to Hugging Face Hub using [huggingface-integration.md](references/huggingface-integration.md).

## Verification

```bash
python3 scripts/verify_ml_environment.py
python3 scripts/generate_modelfile.py --ctx 4096
```

Check [acceptance-criteria.md](references/acceptance-criteria.md) before declaring pipeline readiness.

## References

- [windows-wsl-cuda-setup.md](references/windows-wsl-cuda-setup.md) — Windows WSL2, NVIDIA driver pass-through, and surgical CUDA binary install protocol.
- [qlora-workflow.md](references/qlora-workflow.md) — Step-by-step QLoRA fine-tuning, CPU merge, and GGUF quantization workflow.
- [model-specifications.md](references/model-specifications.md) — Qwen2-7B architecture, chat template, constitutional system prompts, and Ollama/HF coordinates.
- [colab-whole-genome-forge.md](references/colab-whole-genome-forge.md) — Colab A100 notebook playbook for the end-to-end whole genome forge.
- [huggingface-integration.md](references/huggingface-integration.md) — Delegating remote weights downloads and GGUF uploads to `managing-huggingface-assets`.
- [acceptance-criteria.md](references/acceptance-criteria.md) — Verification checklist and success criteria.

Files in this skill

  • SKILL.md3.8 KB
  • assets/Modelfile.template975 B
  • assets/configs/evaluation_config.yaml892 B
  • assets/configs/gguf_config.yaml191 B
  • assets/configs/inference_config.yaml396 B
  • assets/configs/merge_config.yaml176 B
  • assets/configs/training_config.yaml5.1 KB
  • assets/huggingface/README_GGUF.md6.3 KB
  • assets/huggingface/README_LORA.md6.8 KB
  • evals/evals.json514 B
  • evals/results.tsv60 B
  • forging-sovereign-models-flow.mmd113 B
  • references/acceptance-criteria.md891 B
  • references/colab-whole-genome-forge.md19.9 KB
  • references/huggingface-integration.md1.6 KB
  • references/model-specifications.md2.1 KB
  • references/qlora-workflow.md2.6 KB
  • references/windows-wsl-cuda-setup.md2.3 KB
  • scripts/forge_dataset_builder.py3 KB
  • scripts/generate_modelfile.py2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.