Commit graph

11 commits

Author SHA1 Message Date
3e3dd1c150 fix(cli): stop --print-effective-config from starting a container
argparse requires exactly one action, so the documented diagnostic form
`--print-effective-config --config … --start` never took the early-return
branch in main.run(): it printed the resolved config and then executed a
real do_start(), silently replacing a running container with the [default]
model. README, installation guide and manual all recommended that form.

Make it an action in the mutually exclusive group. It can no longer be
combined with --start/--check/--stop/--change/--chat (argparse error,
exit 2), and it skips the docker_available() check, so it now really is
the offline config check the docs promise. --dry-run remains a modifier
and still requires a reachable daemon.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 16:25:07 +02:00
d41a65d58e docs: tidy README license section (blank line, umlaut in name)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 11:30:34 +02:00
b8680cc049 docs: move BEDIENUNGSANLEITUNG and INSTALL_FROM_ARCHIVE into docs/
Keep only README, LICENSE, and CHANGELOG as prose at the repo root
(tooling/convention) and move the remaining manuals under docs/ next to
SECURITY_AND_OPERATIONS.md.

- git mv the two files into docs/ (history preserved).
- Update all cross-references: README doc-index links, the internal
  SECURITY_AND_OPERATIONS link and the §12 pointer list in
  BEDIENUNGSANLEITUNG, and the repo inventory in SECURITY_AND_OPERATIONS §1.
- build_archive.py: point REQUIRED_FILES at docs/ and drop the now-redundant
  INCLUDE_FILES entries (the docs/ dir is included wholesale).
- build_archive.py: drop the obsolete requirements.txt<->pyproject dependency
  mirror check, which broke once requirements.txt was reduced to `.`
  (pyproject is the single source of truth). Verified by building and
  re-opening the archive.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 11:17:41 +02:00
0dc08b003d docs: add a documentation index and repo inventory
Improve orientation across the doc set without duplicating content:

- README: add a "Dokumentation" table mapping each doc (README,
  BEDIENUNGSANLEITUNG, INSTALL_FROM_ARCHIVE, SECURITY_AND_OPERATIONS, man
  page, CHANGELOG) to who it is for and what it covers.
- SECURITY_AND_OPERATIONS §1: extend the module map with a repo-level
  inventory (tests, config template, packaging, build/CI/hook scripts,
  docs) so "which file does what" is answered beyond the src/ modules.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 11:08:33 +02:00
4a5c2e27e1 docs: remove redundant docs, fold migration table into README
Clean up documentation redundancy:

- Delete docs/Archiv_fertig_-_Check_und_Installation.md: an AI hand-off
  transcript (first-person, stale test count, malformed markdown) whose
  useful content is already in INSTALL_FROM_ARCHIVE.md.
- Delete docs/How_to_use.md after moving its one unique asset -- the
  old-script -> new-command migration table -- into the README; drop it
  from the build_archive manifest.
- Fix INSTALL_FROM_ARCHIVE.md drift: list LICENSE/CHANGELOG.md in the
  archive allowlist and use `python -m pytest`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 10:56:20 +02:00
b6e99eed41 ci: add local pre-push gate (ruff + mypy + pytest)
Forgejo Actions is not enabled on the instance, so run the same checks
locally before pushing:

- scripts/check.sh runs ruff, mypy, and pytest (mirrors the CI workflow).
- .githooks/pre-push invokes it; enable per clone with
  `git config core.hooksPath .githooks`. Bypass with `git push --no-verify`.
- Fix the pytest invocation in the CI workflow (and document it): use
  `python -m pytest` so the repo root is on sys.path, otherwise the test
  modules fail to `import tests.*`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 10:48:57 +02:00
49a7756a01 docs: add CHANGELOG and ship LICENSE/CHANGELOG in the archive
- Add CHANGELOG.md (Keep a Changelog format) with a 0.1.0 entry summarizing
  the initial release plus the recent healthcheck fix, image pin, and
  profile-naming changes.
- Add LICENSE and CHANGELOG.md to the build_archive.py manifest so the
  distributable tarball actually contains the license and history.
- Expand the README license section to the full MIT + copyright line.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 10:36:14 +02:00
d5a69e8bf8 docs(config): clarify profile names and make examples copy-paste safe
Rename the size-numbered profiles so the digits read as parameter count,
not Qwen version: qwen35 -> qwen35b (llama.cpp.config.example, build_archive
smoke test, SECURITY_AND_OPERATIONS.md) and qwen27 -> qwen27b
(llama.cpp.config).

Drop the misleading `--profile qwen35` from the README/man/install examples:
that profile only exists in the .example file, so pasted commands failed
against the real config. Primary examples now omit --profile (using the
[default] section, which always resolves), with one example plus a note
showing how to select a real [model.<name>] profile.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 09:53:43 +02:00
f83f36fdfb test: close coverage gaps + opt-in integration smoke
Unit-Tests (kein Docker nötig), 130 Tests gesamt:
- config: ${ENV}- und ~-Expansion in hf_home
- prompt_io: _pin_dns (DNS-Rebinding wird abgewiesen, andere Hosts unberührt,
  Resolver wird wiederhergestellt)
- actions: do_check (running/healthy, missing), do_start non-dry-run
  (Happy-Path + Readiness-Fehler mit --logs), _container_lock Force-Bypass
- cli: --max-tokens <= 0 abgelehnt, --expose/--no-expose

scripts/smoke.sh: opt-in End-to-End-Test gegen echten Docker + llama.cpp-Server
(--api-key-Round-Trip inkl. 401/200, start/check/chat/stream/stop, eigener
Container/Port, Cleanup-Trap).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 17:08:10 +02:00
24202feee6 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>
2026-07-06 16:57:47 +02:00
3158d16f9b Initial commit: llamacppctl – llama.cpp Docker server control CLI
Steuert einen llama.cpp-Server als Docker-Container: --start/--check/--stop/
--change/--chat, INI-Konfiguration (builtin defaults -> [default] ->
[model.<profile>] -> CLI), SSRF-gehärtete Prompt-Eingabe (Datei/HTTPS-URL),
File-Locking für --start/--change und ein OpenAI-kompatibler HTTP-Layer.

Enthält u. a.:
- Env-Var-Expansion in hf_home (hf_home = ${HF_HOME})
- konfigurierbares Chat-Antwortbudget (max_tokens/chat_temperature,
  CLI: --max-tokens/--chat-temp); temperature defer an Server-Default
- DNS-Pinning gegen DNS-Rebinding bei URL-Quellen
- dry-run als nebenwirkungsfreie Vorschau (kein Lock/Removal/Modell-Check)
- 98 Tests (pytest)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 16:36:27 +02:00