feat: harden and extend the CLI (security, UX, robustness, tests)
Sieben Verbesserungen; die Dateien überschneiden sich thematisch, daher ein Commit (jeder Commit bleibt grün: 115 Tests). - #1 --check ist scriptbar: Exit 0 wenn Container läuft und erreichbar, sonst 5 (check_exit_code / CheckResult). - #2 --force implementiert: Bypass eines belegten Locks mit Warnung (_container_lock) und stop_container(force=…) schluckt Inkonsistenzen. - #3 stille Trunkierung behoben: chat_completion_text liefert ChatReply (content + finish_reason); bei finish_reason=length Hinweis auf stderr, --chat gibt Exit 1 bei leerem Content zurück. - #4 keine vermeidbare Downtime: --change validiert den Modellpfad VOR dem Entfernen des laufenden Containers. - #5 Netzwerk dicht: Port-Publish standardmäßig nur auf 127.0.0.1 (--expose/expose für alle Interfaces), optionaler --api-key/api_key (Server --api-key + Bearer-Token auf allen Requests). - #6 --stream: Chat-Reply token-weise via SSE auf stdout (stream_chat). - #7 tests/test_actions.py: Orchestrierungs-Ebene (dry-run-Nebenwirkungen, Lock, validate-before-remove, chat/stream/exit-codes). Doku aktualisiert (Manpage, README, llama.cpp.config.example). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
3158d16f9b
commit
24202feee6
14 changed files with 485 additions and 32 deletions
|
|
@ -49,6 +49,12 @@ models_endpoint = /v1/models
|
|||
chat_endpoint = /v1/chat/completions
|
||||
timeout = 300
|
||||
poll_interval = 2
|
||||
# Port nur auf localhost veröffentlichen (Default). expose = true bindet auf
|
||||
# alle Interfaces (LAN) -> dann unbedingt api_key setzen.
|
||||
expose = false
|
||||
# api_key: leer = keine Authentifizierung. Gesetzt -> Server verlangt ihn und
|
||||
# das Tool sendet ihn als Bearer-Token.
|
||||
api_key =
|
||||
# Chat-Antwortbudget (wirkt auf --chat / --start-Antwort, nicht auf den Container).
|
||||
# Reasoning-Modelle brauchen viel Budget; für lange Texte hochsetzen.
|
||||
max_tokens = 2048
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue