24 lines
1.9 KiB
Markdown
24 lines
1.9 KiB
Markdown
|
|
### Ist das start- stop- change-Skript etc auch dabei ?
|
||
|
|
|
||
|
|
Ja — aber als ein einziges vereinheitlichtes CLI-Tool statt separater Shell-Skripte. Das war ja genau der Punkt der Neuentwicklung: `llamacppctl` ersetzt die einzelnen Skripte (`start-llm-server.sh`, `status-llm-server.sh`, `switch-llm.sh`, …) durch **eine** Python-Anwendung mit Unterbefehlen (Actions).
|
||
|
|
|
||
|
|
Alle Funktionen sind im Archiv enthalten, als Actions von `llamacppctl`:
|
||
|
|
|
||
|
|
| Alte Skript-Idee | Neuer Aufruf |
|
||
|
|
|---|---|
|
||
|
|
| `start-llm-server.sh` | `llamacppctl --start --config llama.cpp.config --profile <name>` |
|
||
|
|
| `status-llm-server.sh` | `llamacppctl --check --config llama.cpp.config --profile <name>` |
|
||
|
|
| Stop-Skript | `llamacppctl --stop --config llama.cpp.config --profile <name>` |
|
||
|
|
| `switch-llm.sh` (Modellwechsel) | `llamacppctl --change --config llama.cpp.config --profile <name>` |
|
||
|
|
| (neu) direkter Chat-Test | `llamacppctl --chat --config llama.cpp.config --profile <name> -p "..."` |
|
||
|
|
|
||
|
|
Die Logik dahinter liegt in `src/llamacppctl/actions.py` (`do_start`, `do_check`, `do_stop`, `do_change`, `do_chat`) und `src/llamacppctl/docker_ops.py` (baut den `docker run`-Befehl, startet/stoppt/entfernt Container, liest Logs).
|
||
|
|
|
||
|
|
Besonderheiten gegenüber den ursprünglichen Shell-Skripten:
|
||
|
|
|
||
|
|
- `--change` nutzt eine exklusive Dateisperre (`/tmp/llamacppctl.<container_name>.lock`), damit zwei gleichzeitige Modellwechsel für denselben Container sich nicht in die Quere kommen.
|
||
|
|
- Die Start-Bereitschaftsprüfung (`--start`/`--change`) wartet auf eine echte Chat-Completion-Antwort, nicht nur auf einen offenen Port — das ist zuverlässiger als ein reiner Port-Check.
|
||
|
|
- `--dry-run` zeigt dir den vollständigen `docker run`-Befehl an, ohne ihn auszuführen — praktisch, um vor einer echten Änderung zu prüfen, was passieren würde.
|
||
|
|
|
||
|
|
Die vollständige Referenz zu allen Optionen steht in der Manpage (`man/llamacppctl.1`) und in `README.md`/`docs/SECURITY_AND_OPERATIONS.md` im Archiv.
|
||
|
|
|