anonymousnomad/covert-coder/aid-cipher-4b-fine-tune-pipeline
Claude Code and agent skill by anonymousnomad/covert-coder
- community
Checking that the SKILL.md file is still in the repository.
End-to-end recipe for fine-tuning the AIDE in-house cipher-4b model: fix the broken venv, install the ML stack, generate SFT pairs (Node.js, no Python), run QLoRA training, convert LoRA to GGUF adapter, evaluate against the capability battery, promote/archive/rollback. Per the cipher-qlora-finetune skill, the AIDE baseline is 0.683 composite across 23 AIDE-world tasks; the v2 adapter must hit >= 0.02 delta with no category regression > 0.1 to promote. Use whenever the user wants to improve the in-house model, when the SFT corpus needs refreshing, or when a new v2 adapter is needed.
Install
npx vskill@latest install anonymousnomad/covert-coder/aid-cipher-4b-fine-tune-pipelineSKILL.md
The same SKILL.md was published earlier as anonymousnomad/covert-coder/aid-cipher-4b-fine-tune-pipeline.
AIDE cipher-4b Fine-Tune Pipeline — End-to-End Wire-In
Status: BLOCKED (2026-09-03)
- SFT corpus: EXISTS at
E:\felon_workspace\cipher_v2\sft_train.jsonl(4741 rows from prior session). - Capability battery: EXISTS at
E:\pip_temp\opencode\capability_audit_cipher_4b.mjs(23 tasks, baseline 0.683). - LoRA → GGUF converter: EXISTS at
E:\llama-cpp\convert_lora_to_gguf.py(or similar). - Engine: EXISTS at
E:\llama-cpp\llama-server.exe(CPU build, loads LoRA via--lora). - BLOCKER: Python venv is broken.
E:\felon_workspace\venv_cipher\pyvenv.cfghashome = E:\Python310which is itself a Python install — the venv can't initialize. System PythonE:\Python310\python.exedoes NOT have torch/transformers/peft installed.
This skill encodes the exact venv-install path so the next agent can unblock the lane and run the full pipeline.
The exact venv-install sequence (the blocker)
The aid-venv-care + failure-pythonpath-hijack skills document the failure mode. The fix:
If E:\Python311 doesn't exist, use E:\Python310\python.exe -m venv --system-site-packages E:\felon_workspace\venv_cipher_v2 (allows access to system packages, avoids the home trap). Per aid-venv-care, the --system-site-packages flag bypasses the venv isolation but also bypasses the home = E:\Python310 trap.
The full pipeline (once venv is unblocked)
Step 1: Verify SFT corpus
Step 2: Verify capability battery
Step 3: Write the training script
E:\felon_workspace\train_cipher_v2.py (QLoRA on the 4B, BF16 base):
Step 4: Convert LoRA → GGUF adapter
Step 5: Smoke-test the new adapter
Step 6: Run the capability battery
Step 7: Apply the gate
| Composite delta | Action | |
|---|---|---|
| ≥ +0.02 AND no category regressed > 0.1 | PROMOTE: rename frontier-lora.gguf → frontier-lora.v1.gguf (backup), rename cipher_v2_lora.gguf → frontier-lora.gguf | |
| ∈ [-0.02, +0.02] | ARCHIVE: keep v1 as production, save v2 as cipher_v2_lora.archived.gguf | |
| < -0.02 | ROLLBACK: delete v2, v1 stays |
Step 8: Journal
Append to AGENT_NOTES.md:
Dependencies
- Working venv with torch 2.7.1+cu118, transformers 5.16.1, peft 0.13.0, trl 0.11.4, bitsandbytes 0.45.0
- HF-format base model at
E:/felon_workspace/cipher_hf/(convert from GGUF if needed) - llama.cpp convert_lora_to_gguf.py at
E:/llama-cpp/ - llama-server.exe at
E:/llama-cpp/ - SFT corpus at
E:/felon_workspace/cipher_v2/sft_train.jsonl(exists) - Capability battery at
E:/pip_temp/opencode/capability_audit_cipher_4b.mjs(exists) - 6+ GB free VRAM (GTX 1060 6GB is at the spill threshold per model-scaling)
Research base (verified 2026-09-03)
cipher-qlora-finetuneskill: the master fine-tune SOP, 5-step procedure, gate, threat matrix.aid-venv-careskill: the venv trap on this machine (home = E:\Python310is itself a Python install).failure-pythonpath-hijackskill: documents the same failure mode.device-training-1060skill: hard rule #1 = FP32 only on Pascal. QLoRA (4-bit) is the only viable in-card option.model-scalingskill: 5GB VRAM spill threshold, GQA divisibility.training-sopskill: AdamW(0.9, 0.95), wd 0.1, cosine, ONE epoch, replay 30%.aide-cipher-house-modelskill: the in-house model lifecycle.- Baseline: 0.683 composite, 11 PASS / 11 PARTIAL / 1 FAIL across 23 tasks (2026-08-28 audit).
Pitfalls (each cost a cycle in prior sessions)
- Broken venv — the
home = E:\Python310trap. Use--system-site-packagesorE:\Python311. - Loading from GGUF directly — peft needs HF safetensors. Convert first.
- OOM on 6GB — QLoRA is the only option. If it OOMs, shrink batch to 1, enable gradient checkpointing.
- Overfitting the SFT pairs — ONE epoch, replay buffer 30%, monitor per-category not just composite.
- Promoting without evaluation — NEVER. The gate exists for a reason.
- Touching the manifest before the battery passes — UI reads the manifest, premature promotion confuses users.
- Public-facing copy violation — don't claim "v2 is better" in README until the battery gate passes.
- Forgetting the engine restart — the new adapter doesn't load until llama-server restarts.
What NOT to do
- Do NOT run the training in a venv with `home = E:\Python310` — it will crash with
init_fs_encodingerror. - Do NOT touch the manifest (`models/manifest.json`) until the battery gate passes — UI shows the wrong adapter.
- Do NOT promote v2 without running the full capability battery — composite alone is not enough; per-category must not regress.
- Do NOT skip the backup step —
frontier-lora.v1.ggufmust exist before promotion. - Do NOT claim "SOTA" or "beats Cursor" in public copy — this is a sovereign open-source project, not a commercial product.
- Do NOT run the training with the AIDE engine serving — GPU contention. AIDE off during training.
Verification (the gate)
The fine-tune stage is complete when:
- The venv is fixed and
python -c "import torch, transformers, peft, trl, bitsandbytes; print('OK')"exits 0. - The SFT corpus has ≥ 1000 high-quality pairs (currently 4741).
- The training script runs to completion without OOM.
- The LoRA → GGUF conversion succeeds and the new adapter file is non-empty.
- The capability battery runs and produces a composite score.
- The gate is applied: PROMOTE / ARCHIVE / ROLLBACK.
- The journal entry names the verdict, the delta, and the files changed.
Verification record (per agent-notes)
After the fine-tune, append to AGENT_NOTES.md:
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/packs/aid-cipher-4b-fine-tune-pipeline/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Grok Build (Cursor)
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/anonymousnomad/covert-coder/aid-cipher-4b-fine-tune-pipeline)