Commit Graph
3 Commits
Author SHA1 Message Date
LeoVasanko 911e28efbe scripts: uv-run shebang + executable; autodetect LLM api shape and language capabilities
Both new scripts carry the '#!/usr/bin/env -S uv run' shebang like
devserver.py and run directly (scripts/llm_translator.py ws://...).

llm_translator figures out the LLM-side details itself: the endpoint
shape is probed at startup (an ollama server answers /api/version and
gets its native /api/chat; anything else gets /v1/chat/completions) and
the announced languages follow the model family — qwen models announce
the full 39-language table, unknown models a conservative 12-language
set — with --langs/config as user overrides. The --api flag is gone;
CLI options stay high-level (url, --model, --base-url, --langs, --modes,
--api-key, --config for the sampling/cap details).

Verified live: detection logged 'ollama api', all 39 languages
announced, title + article jobs completed as before.
2026-09-21 03:51:56 +00:00
LeoVasanko 42609a54c1 import_translation: read the input file outside the event loop (ruff ASYNC230/SIM115) 2026-09-20 23:47:28 +00:00
LeoVasanko 277a75ae23 scripts/import_translation.py: import human-made whole-article translations
Decomposes a pasted full translation with the same align_article
validation as article-mode LLM results and stores proper Data.trans
fragments, instead of the translation editor's one monolithic patch that
silently goes stale hunk by hunk. Runs against the kanta database
directly, with the server stopped. Verified on a scratch copy of the
localhost db: swe/app fi (qwen3.8 trial output) imports 43/43 blocks and
serves through the hybrid; the degenerate qwen3-next output is rejected
on anchor validation.
2026-09-20 23:23:37 +00:00