Free Lab Series 10: Proving What Works — Paired Evaluation, Security Sandboxes & Model Cards
This dedicated lab series translates Hugging Face Learn modules and official documentation into ten step-by-step, reproducible engineering exercises that run cleanly on a standard Debian 12/13 CPU workstation or rootless OCI container—with zero CUDA or paid GPU subscription required.
Authored by Imad Soltani (human author, sole release authority) with Antigravity (Google DeepMind, non-human co-author).
1. Series Architecture, Hardware & Hugging Face Curriculum Linkage
- Permanent Series ID:
LAB-FREE-10· Cost / Tier (11E): Hugging Face Free ($0/mo — zero paid subscription required) - Hardware Profile (10A): CPU-only (4 vCPU, 8 GB RAM, 10 GB disk — NO CUDA, ROCm, or GPU required)
- Hugging Face Learn (10F): https://huggingface.co/learn/llm-course/chapter11/1
- Hugging Face Docs (10F): https://huggingface.co/docs/hub/model-cards
- GitHub Source Directory: github.com/ximad/solarisk/lab/v116.0/free/series_10_evaluation-security-governance
7. Self-Check Comprehension Gate
Why does this lab series enforce a non-root multi-stage OCI container and idempotent Debian setup?
Multi-stage builds strip compilers and build secrets from the runtime layer, non-root UID execution limits blast radius if a dependency or prompt-triggered tool misbehaves, and idempotent Debian setup ensures repeatable runs across workstations and CI without hidden host drift.
How does the 30/30/30/10 progression split map to operational readiness?
Labs 01–03 establish clean data and deterministic baselines (Beginner), Labs 04–06 integrate adaptation, paired evaluation, and OCI packaging (Practitioner), Labs 07–09 harden latency, security boundaries, and governance compliance (Expert), and Lab 10 consolidates artifacts and primary documentation links (Capstone).
Complete 10-Lab Progression (30% Beginner · 30% Practitioner · 30% Expert · 10% Capstone & Resources)
| ID (10B) | Series-Specific Lab Module | Level | Duration | Cost / Tier | Expected Result & Capability (10F) |
|---|---|---|---|---|---|
| LAB-FREE-10-01 | Triplet Provenance: (Model, Harness, Date) Discipline | Beginner | 35 min | Free ($0/mo) | Bind every benchmark score to exact checkpoint revision, prompt hash, and date Reader capability (10F): Design, verify, and deploy reproducible 'Triplet Provenance: (Model, Harness, Date) Discipline' workflows grounded in https://huggingface.co/learn/llm-course/chapter11/1 and https://huggingface.co/docs/hub/model-cards. |
| LAB-FREE-10-02 | Paired Bootstrap Confidence Intervals on CPU | Beginner | 40 min | Free ($0/mo) | Test whether an accuracy delta is statistically significant rather than sampling noise Reader capability (10F): Design, verify, and deploy reproducible 'Paired Bootstrap Confidence Intervals on CPU' workflows grounded in https://huggingface.co/learn/llm-course/chapter11/1 and https://huggingface.co/docs/hub/model-cards. |
| LAB-FREE-10-03 | Calibrating LLM-as-a-Judge vs Deterministic Checks | Beginner | 45 min | Free ($0/mo) | Detect verbosity/position bias and replace subjective judges with unit assertions Reader capability (10F): Design, verify, and deploy reproducible 'Calibrating LLM-as-a-Judge vs Deterministic Checks' workflows grounded in https://huggingface.co/learn/llm-course/chapter11/1 and https://huggingface.co/docs/hub/model-cards. |
| LAB-FREE-10-04 | Promptware Kill-Chain Threat Modeling | Practitioner | 50 min | Free ($0/mo) | Map trust boundaries across user inputs, retrieved RAG chunks, and tool outputs Reader capability (10F): Design, verify, and deploy reproducible 'Promptware Kill-Chain Threat Modeling' workflows grounded in https://huggingface.co/learn/llm-course/chapter11/1 and https://huggingface.co/docs/hub/model-cards. |
| LAB-FREE-10-05 | Default-Deny Policy Gates & Schema Verification | Practitioner | 55 min | Free ($0/mo) | Enforce strict JSON-schema and allowlisted-action verification before side effects Reader capability (10F): Design, verify, and deploy reproducible 'Default-Deny Policy Gates & Schema Verification' workflows grounded in https://huggingface.co/learn/llm-course/chapter11/1 and https://huggingface.co/docs/hub/model-cards. |
| LAB-FREE-10-06 | Reproducible Evaluation Runner in Rootless OCI | Practitioner | 60 min | Free ($0/mo) | Run deterministic offline evaluation suites inside Docker, containerd, and CRI-O Reader capability (10F): Design, verify, and deploy reproducible 'Reproducible Evaluation Runner in Rootless OCI' workflows grounded in https://huggingface.co/learn/llm-course/chapter11/1 and https://huggingface.co/docs/hub/model-cards. |
| LAB-FREE-10-07 | License Inventory & Copyleft vs Permissive Audit | Expert | 65 min | Free ($0/mo) | Distinguish Apache-2.0/MIT from Rail/custom weights licenses in release manifests Reader capability (10F): Design, verify, and deploy reproducible 'License Inventory & Copyleft vs Permissive Audit' workflows grounded in https://huggingface.co/learn/llm-course/chapter11/1 and https://huggingface.co/docs/hub/model-cards. |
| LAB-FREE-10-08 | EU AI Act (2024/1689 + 2026/1744) Documentation Mapping | Expert | 70 min | Free ($0/mo) | Align Model Cards with Art. 50 transparency and Art. 53 GPAI technical dossiers Reader capability (10F): Design, verify, and deploy reproducible 'EU AI Act (2024/1689 + 2026/1744) Documentation Mapping' workflows grounded in https://huggingface.co/learn/llm-course/chapter11/1 and https://huggingface.co/docs/hub/model-cards. |
| LAB-FREE-10-09 | Release Manifest Signing & Tamper-Evident Checksums | Expert | 75 min | Free ($0/mo) | Generate SHA-256 provenance ledgers covering code, data, and prompts Reader capability (10F): Design, verify, and deploy reproducible 'Release Manifest Signing & Tamper-Evident Checksums' workflows grounded in https://huggingface.co/learn/llm-course/chapter11/1 and https://huggingface.co/docs/hub/model-cards. |
| LAB-FREE-10-10 | Capstone: Full Accountable AI Verification Pack & Official URLs | Capstone & Resources (10%) | 45 min | Free ($0/mo) | Publish end-to-end audit templates, bootstrap scripts, and HF Docs governance links Reader capability (10F): Design, verify, and deploy reproducible 'Capstone: Full Accountable AI Verification Pack & Official URLs' workflows grounded in https://huggingface.co/learn/llm-course/chapter11/1 and https://huggingface.co/docs/hub/model-cards. |
Debian 12/13 Commented Idempotent Setup & Domain Python Runner (10C)
setup.sh (Debian 12/13 Bash)
#!/usr/bin/env bash
# ==============================================================================
# SolarisK Lab Series Setup — LAB-FREE-10 (series_10_evaluation-security-governance)
# Target OS: Latest stable Debian Linux (Debian 12 Bookworm / 13 Trixie)
# Idempotent setup with inline comments & explicit destructive-reset warning.
# ==============================================================================
set -euo pipefail
# Isolated virtual environment path so Debian system Python stays untouched
LAB_VENV="${HOME}/.venvs/solarisk-lab-free-10"
# Warn explicitly before destructive environment reset (--reset)
if [[ "${1:-}" == "--reset" ]]; then
echo "[WARNING] Destructive reset: deleting ${LAB_VENV} in 5s (Ctrl+C to cancel)..."
sleep 5
rm -rf "${LAB_VENV}"
fi
# Confirm Debian python3 & venv tooling exist before creating environment
if ! command -v python3 >/dev/null 2>&1; then
echo "[ERROR] Missing python3. Install on Debian: sudo apt-get update && sudo apt-get install -y python3 python3-venv python3-pip"
exit 1
fi
# CPU-only lab: explicitly skip CUDA/ROCm checks and cap CPU threads for predictable memory
export OMP_NUM_THREADS="${OMP_NUM_THREADS:-4}"
echo "[INFO] CPU-only Debian mode active (OMP_NUM_THREADS=${OMP_NUM_THREADS}; zero CUDA/GPU required)."
# Idempotently create virtual environment
if [[ ! -d "${LAB_VENV}" ]]; then
echo "[SETUP] Creating Debian virtual environment at ${LAB_VENV}..."
python3 -m venv "${LAB_VENV}"
fi
# Install series-specific packages cleanly inside the isolated virtualenv
"${LAB_VENV}/bin/pip" install --quiet --upgrade pip
"${LAB_VENV}/bin/pip" install --quiet huggingface_hub pydantic numpy
echo "[READY] Activate: source ${LAB_VENV}/bin/activate"
echo "[READY] Run self-test: ${LAB_VENV}/bin/python3 run_lab.py --check"
run_lab.py (Executable Series-Specific Python Kernel)
#!/usr/bin/env python3
"""
SolarisK Executable Lab Runner — LAB-FREE-10: Free Lab Series 10: Proving What Works — Paired Evaluation, Security Sandboxes & Model Cards
Hugging Face Learn: https://huggingface.co/learn/llm-course/chapter11/1
Hugging Face Docs: https://huggingface.co/docs/hub/model-cards
"""
import argparse, json, os, platform
from datetime import datetime, timezone
def run_domain_demo() -> dict:
"""Series-specific reproducible verification kernel (runs offline or online)."""
out = {"series_id": "LAB-FREE-10", "tier": "FREE", "uses_gpu": False}
try:
# Domain kernel preview (safe offline fallback if optional weights/packages not yet pulled)
exec_ns = {}
code = "import numpy as np\nrng = np.random.default_rng(42)\na = np.array([1,0,1,1,0,1,1,1,0,1])\nb = np.array([1,1,1,1,1,1,1,1,0,1])\ndiffs = [np.mean(b[idx] - a[idx]) for idx in [rng.integers(0, len(a), len(a)) for _ in range(1000)]]\nprint({'observed_delta': float(np.mean(b - a)), 'ci95_low': round(float(np.percentile(diffs, 2.5)), 3), 'ci95_high': round(float(np.percentile(diffs, 97.5)), 3)})"
exec(compile(code, "<LAB-FREE-10>", "exec"), exec_ns)
out["kernel_status"] = "EXECUTED"
except Exception as exc:
out["kernel_status"] = "DEFERRED_INSTALL"
out["hint"] = f"Run ./setup.sh first to install [huggingface_hub pydantic numpy]: {exc}"
return out
def main() -> None:
parser = argparse.ArgumentParser(description="SolarisK LAB-FREE-10 Reproducible Runner")
parser.add_argument("--check", action="store_true", help="Verify Debian/OCI runtime & run domain kernel")
args = parser.parse_args()
report = {
"series_id": "LAB-FREE-10",
"timestamp_utc": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
"python": platform.python_version(),
"os": platform.platform(),
"hf_token_present": bool(os.environ.get("HF_TOKEN")),
"hf_learn": "https://huggingface.co/learn/llm-course/chapter11/1",
"hf_docs": "https://huggingface.co/docs/hub/model-cards",
"domain_check": run_domain_demo(),
}
print(json.dumps(report, indent=2, ensure_ascii=False))
if __name__ == "__main__":
main()
OCI Multi-Stage Non-Root Container & Docker / containerd / CRI-O Runbook (10D)
Containerfile (opencontainers.org)
# syntax=docker/dockerfile:1
# OCI-compliant multi-stage non-root Containerfile for LAB-FREE-10 (opencontainers.org)
FROM python:3.11-slim-bookworm AS builder
WORKDIR /build
RUN python3 -m venv /opt/venv && /opt/venv/bin/pip install --no-cache-dir --upgrade pip huggingface_hub pydantic numpy
FROM python:3.11-slim-bookworm AS runtime
LABEL org.opencontainers.image.title="SolarisK LAB-FREE-10" \
org.opencontainers.image.source="https://github.com/ximad/solarisk/tree/main/lab/v116.0/free/series_10_evaluation-security-governance" \
org.opencontainers.image.authors="Imad Soltani <bsdimad@gmail.com>"
# CPU-only OCI image: zero CUDA/NVIDIA driver dependency
RUN groupadd -g 10001 solarisk && useradd -u 10001 -g 10001 -m -s /usr/sbin/nologin solarisk
COPY --from=builder /opt/venv /opt/venv
WORKDIR /app
COPY --chown=10001:10001 run_lab.py /app/run_lab.py
ENV PATH="/opt/venv/bin:$PATH" HF_HOME="/tmp/hf_cache" PYTHONDONTWRITEBYTECODE=1
USER 10001:10001
ENTRYPOINT ["python3", "/app/run_lab.py"]
CMD ["--check"]
Docker, containerd (nerdctl), and CRI-O Commands
# CPU-only lab: NO CUDA, ROCm, or NVIDIA Container Toolkit required.
# 1. Docker (OCI-compliant multi-stage non-root image)
docker build -f Containerfile -t solarisk/lab-free-10:latest .
docker run --rm --read-only --tmpfs /tmp -e HF_TOKEN="$HF_TOKEN" solarisk/lab-free-10:latest
# 2. containerd via nerdctl (rootless OCI workflow)
nerdctl build -f Containerfile -t solarisk/lab-free-10:latest .
nerdctl run --rm --read-only --tmpfs /tmp -e HF_TOKEN="$HF_TOKEN" solarisk/lab-free-10:latest
# 3. CRI-O / Podman (Kubernetes CRI-O node verification via crictl / podman)
podman build -f Containerfile -t localhost/solarisk/lab-free-10:latest .
podman run --rm --userns=keep-id -e HF_TOKEN="$HF_TOKEN" localhost/solarisk/lab-free-10:latest
# On CRI-O cluster nodes, pull the OCI image and inspect pod sandbox via: crictl images | grep lab-free-10Troubleshooting: Two Most Common Errors & Deterministic Fixes (10E)
Cap `OMP_NUM_THREADS=4`, keep `HF_HOME` mounted on persistent disk, and prefer compact SafeTensors checkpoints—zero CUDA or GPU driver configuration is needed.
Never run global `pip install` on Debian 12/13; execute strictly inside `.venv` (`./setup.sh`) or the non-root OCI container and export a free read-only `HF_TOKEN`.
Living Semantics Chapter — Human Glossary & Machine-Readable RAG Index (12A–12D)
| Term / Concept (12A–12C) | Category | Explanation & Operational Boundary |
|---|---|---|
| Paired Bootstrap Test | Statistics | Non-parametric resampling over identical evaluation items to compute confidence intervals on model-vs-model deltas. |
| Promptware Kill Chain | Security | Multi-stage exploitation model tracing initial prompt injection through privilege escalation, persistence, and data exfiltration. |
| Model Card Provenance | Governance | Structured YAML+Markdown metadata declaring training data, evaluation scope, limitations, and license obligations. |
| Hugging Face Hub Token (`HF_TOKEN`) | Security | Fine-grained bearer token authorizing read/write access to gated weights, private datasets, and Inference Providers without hardcoding secrets. |
| OCI Multi-Stage Non-Root Image | Infrastructure | Open Container Initiative (`opencontainers.org`) image discarding build compilers and running strictly under unprivileged UID `10001`. |
| 30 / 30 / 30 / 10 Mastery Split | Pedagogy | Curriculum pacing allocating 30% Beginner, 30% Practitioner, 30% Expert labs, plus 10% Capstone synthesis and verified HF Learn/Docs URLs. |
| Idempotent Debian Setup | Reproducibility | Setup discipline allowing `setup.sh` to re-run safely on Debian 12/13 with explicit destructive warnings (`--reset`) and isolated `.venv`. |
No comments:
Post a Comment