Purge live-state claims that ~/.pi is our harness; keep general pi documentation in omp-docs/ and dated historical records. - README.md: single config source; Legacy Notes reworded - AGENTS.md: drop 'like ~/.pi did' framing - APPEND_SYSTEM.md: okf-spec -> omp-docs/references/okf-spec.md - dotfiles/zsh/.zshrc: systemprompt alias -> APPEND_SYSTEM.md - managed skill llm-fleet-model-swap + model_config_sync skill: single-source models.yml; validation script YAML-only - memories (MEMORY.md, memory_summary.md, learned.md): single source - omp-docs: .okf root -> ~/.omp/omp-docs; de-live pi-era claims in pi/index.md, pi-web-access.md, engineering/agents-files.md
3.9 KiB
3.9 KiB
name, description
| name | description |
|---|---|
| llm-fleet-model-swap | Swap the model/runtime behind frank-default-large/small on Dankclaw/Dankserver via the git flow, with pre-deploy live validation and the port-holder health-check trap check. |
LLM fleet model swap (frank-default-large / frank-default-small)
Use when switching model, quant, or llama.cpp/FreeToken runtime for a frank-default-* service in ~/Projects/serverAppConfigs.
0. Ground truth first
- Read the HF model card (runtime pin, hard constraints, recommended args) + repo files
scripts/frank-default-<size>.env,scripts/serve-frank-<size>.sh,scripts/frank-default-<size>.service, and the runbook underserverAppConfigs-docs/LLM/. - Check the host before downloading anything:
ls /home/dank/models/,df -h /home,du -sh— bench-era or prior-deployment files often already exist.
1. Artifact integrity
- List repo files:
curl -s https://huggingface.co/api/models/<repo>/tree/main?recursive=true→.lfs.oidholds the sha256. - On-host file: compare size AND
sha256sumagainst the LFS oid before trusting any existing copy (hash runs ~few min for >100 GiB; run it in background). - New download on Dankserver:
/home/dank/freetoken/.venv/bin/hf download <repo> --local-dir ....
2. Runtime (if the card pins a fork/build)
- Clone + build with the card's exact cmake line, plus
-DLLAMA_BUILD_WEBUI=OFF— WebUI asset provisioning (npm / HF llama-ui bucket) aborts llama.cpp link at 98% on these hosts; API server unaffected. - Verify every flag our serve script passes exists in the new binary before touching the service:
llama-server --help | grep -q -- "<flag>"for each; list MISSes.
3. Config via git only
- Edit
scripts/frank-default-<size>.env(LLAMA_BIN, MODEL_DIR, MODEL_FILE, MMPROJ_PATH) + serve script header/defaults;bash -nthe script;./tests/run.shmust pass; commit; push;git pull --ff-onlyon the target. - Do NOT edit configs on the remote. Renaming a model dir (
mv) is host state, allowed.
4. Live validation (no scratch ports — GPU/RAM can't host two big models)
- Ensure the old unit is truly gone:
systemctl is-activemay hang instop-sigtermbecause llama.cpp never preempts an in-flight generation; poll until the PID exits before launching. - Stop service, run the real serve script manually (
setsid nohup bash scripts/serve-frank-<size>.sh > /tmp/x.log 2>&1 &— plainssh 'nohup ... &'dies with its ssh when foregrounded; keep ssh under timeout or it gets killed mid-stop). - Verify: health 200; a real
/v1/chat/completions(FreeToken REQUIRES explicit"model"field; llama.cpp servers don't care); reasoning flows (reasoning_contentnon-empty; content may be empty with finish=length if the thinking eats the budget).
5. systemd handoff + THE TRAP
./scripts/deploy.sh <host> --service <svc>— but a leftover manual server holding :7770 makes the health check pass while the UNIT crash-loops on bind.- Always confirm ownership:
systemctl show <svc> -p MainPIDequals the singlepgrep -x llama-server(or the ft serve PID); only then trust "healthy after Ns". - If a real long-context task is queued/running, do the handoff anyway (client aborts are recoverable; drift is not) — or defer cosmetic-only redeploys.
6. Close-out (mandatory)
- Docs: active runbook updated (build recipe, profile, validation numbers incl. real-workload prefill/decode), superseded runbook gets RETIRED banner kept as rollback record,
LLM/index.mdmermaid + active list, AGENTS.md fleet table + Runtime section + history chain, work log entry inserverAppConfigs-docs/log.md. ~/.omp/agent/models.yml: contextWindow must equal the REAL per-slot context — llama.cpp logsn_ctx_slotper prompt; parallel N clampsn_ctx_train(e.g. 262144/2 = 131072/slot). Overselling causes silent client-side overflow.- Rollback = one env commit (paths + LLAMA_BIN); keep prior binary + payload on disk.