# grace-scripts Grace AI helper scripts — token-efficient homelab automation. These scripts replace inline shell construction in AI sessions, reducing token usage and making repeated tasks reproducible and auditable. ## Scripts | Script | Purpose | |--------|---------| | `convert-training-data.py` | Convert raw session exports to unsloth/axolotl-ready JSONL | | `export-training-data.py` | Export training data from OpenClaw sessions | | `export-transcripts.py` | Export session transcripts incrementally | | `extract-sessions.py` | Extract and parse session data | | `finetune-lora.py` | Run LoRA fine-tuning on local Qwen3-8B | | `infra-audit.py` | Audit homelab infra state and sync to MongoDB | | `infra-gitea-link.py` | Link infra components to Gitea issues/repos | | `load-transcripts-to-db.py` | Sync transcripts to PostgreSQL on DB VM | | `overnight-qwen3.py` | Overnight batch inference job | | `overnight-research.sh` | Overnight research and summarization | | `rag-ingest.py` | Ingest documents into Qdrant for RAG | | `rag-query.py` | Query Qdrant RAG index | | `install-unsloth.sh` | Install unsloth fine-tuning framework | ## Credential Protocol All scripts pull credentials from Infisical. Never hardcode secrets. IPs and service URLs reference TOOLS.md / BOOTSTRAP.md in the Grace workspace. ## Token Reduction Strategy Each script replaces multi-step inline shell that Grace would otherwise construct token-by-token in every session. One `exec` call to a script = ~10-50x fewer tokens than building the equivalent inline. ## Issues & Improvements Use Gitea issues on this repo to track bugs, improvements, and new script requests.