# Hermes llama-swap migration cleanup

Use this after Hermes has already been pointed at llama-swap and basic requests work.

## Goal

Leave exactly one live local-model control plane:
- `llama-swap.service` enabled/running
- Hermes `custom:local` pointing at `http://127.0.0.1:9292/v1`

Everything from the old per-port/per-service switch stack should be disabled or archived so it cannot be reactivated by accident.

## Archive instead of delete

Preferred pattern:
- user files → `~/.hermes/legacy-model-switch-archive/<timestamp>/`
- systemd units → `/etc/systemd/system/legacy-llm-archive-<timestamp>/`

This preserves recovery options without leaving old files in their live locations.

## User-space artifacts to archive

Typical old stack:
- `~/.hermes/scripts/auto-model-switch.py`
- `~/.hermes/scripts/model-switcher`
- `~/.hermes/scripts/quick-start-model.py`
- `~/.hermes/.last-model-state`
- `~/.hermes/.model-switch-notify`
- `~/.hermes/.model-switch.lock`
- `~/.hermes/logs/model-switch.log`

## Systemd artifacts to archive

Typical old stack:
- `hermes-config.path`
- `hermes-config.service`
- per-model `llama-server*.service`
- any old `llama-local.service`
- stray top-level `llama-server*.bak*` files

After moving them:
```bash
sudo systemctl daemon-reload
sudo systemctl list-unit-files 'llama*' 'hermes-config*' --no-pager
```
Expected final result: only `llama-swap.service` remains live at the top level.

## Files to keep

Do **not** blindly remove `~/.hermes/scripts/models.py` during cleanup.
Hermes may still read it for local model metadata / friendly picker behavior even after llama-swap cutover.

A repurposed watchdog script can stay if it now checks llama-swap health instead of individual llama-server units.

## Verification sequence

1. `systemctl status llama-swap --no-pager`
2. `curl -sS http://127.0.0.1:9292/v1/models`
3. Direct local completion through proxy:
   ```bash
   curl -sS http://127.0.0.1:9292/v1/chat/completions \
     -H 'Content-Type: application/json' \
     -d '{"model":"<friendly-or-aliased-model>","messages":[{"role":"user","content":"Reply with exactly OK"}],"max_tokens":4,"temperature":0}'
   ```
4. Real Hermes smoke test:
   ```bash
   hermes chat -Q --provider custom:local --model '<friendly-name>' -q 'Reply with exactly OK'
   ```

If step 4 passes, the cleanup did not break actual Hermes routing.

## Durable lesson

The migration is not complete when requests merely work once. It is complete when the old watcher/unit stack is no longer in any live path that future sessions can accidentally trigger.