Skip to main content

fl-style-transfer

Инструментарий переноса авторского стиля для LLM-агентов: строит профиль автора по его текстам (стилометрия, эмбеддинги, словарь функций абзацев) и поддерживает написание новых русских текстов в этом профиле — сборка промпта с авторскими примерами, детерминированная проверка содержания и формата, локальные правки.

Пакет не требует внешнего LLM API: генерация выполняется агентом, который использует пакет (своими субагентами); пакет делает тяжёлую обработку.

Установка

pip install fl-style-transfer
# или как инструмент без установки:
uvx fl-style-transfer --help

При первом запуске скачиваются модели (Stanza ru, эмбеддинги). Каталоги кэша/данных конфигурируемы:

Переменная Назначение По умолчанию
FL_STYLE_DATA_DIR профили, индексы ~/.local/share/fl-style-transfer
FL_STYLE_CACHE_DIR модели ~/.cache/fl-style-transfer
HF_HOME, STANZA_RESOURCES_DIR низкоуровневые кэши внутри FL_STYLE_CACHE_DIR

Если CUDA не нужна, уменьшите установку, поставив CPU-сборку torch заранее: uv pip install torch --index https://download.pytorch.org/whl/cpu.

Команды

Профиль автора

# построить профиль из корпуса текстов (txt/md/docx/odt/pdf)
fl-style-transfer profile build --input corpus/author1 --output profiles/author1 --config ru.yaml

# посмотреть профиль
fl-style-transfer profile inspect profiles/author1

Сравнение текста с профилем (диагностика)

fl-style-transfer compare --profile profiles/author1 --text draft.md [--reference original.md] [--json]

Skill-режим (автономный навык для агента)

# первый запуск: профиль + формат-норма + задание на разметку абзацев
fl-style-transfer skill setup --skill-dir ~/.agents/skills/ghostwriter \
    --corpus ~/.agents/skills/ghostwriter/corpus/author1 --author author1

# прогрев моделей в кэш навыка
fl-style-transfer skill warmup --skill-dir ~/.agents/skills/ghostwriter

# импорт разметки ролей абзацев, выполненной агентом (JSONL)
fl-style-transfer skill labels import --profile profiles/author1/ru-v1 --labels labels.jsonl

# сборка промпта генерации (авторские примеры + план) для субагента
fl-style-transfer skill retrieve --profile profiles/author1/ru-v1 \
    --brief-file brief.md --plan-file plan.md --out prompt.md

# детерминированная проверка кандидата: якоря, формат, шаблонные конструкции
fl-style-transfer skill check --text candidate.md --brief-file brief.md \
    --anchors anchors.json --profile profiles/author1/ru-v1

retrieve кладёт рядом с промптом prompt.json с рекомендованными параметрами для вызываемого субагента (temperature 0.7, thinking off, max_tokens 2200).

Эксперименты (research)

fl-style-transfer experiment run --profile profiles/author1 --output exp/001 --config ru.yaml
fl-style-transfer experiment evaluate exp/001
fl-style-transfer experiment judge exp/001 --config ru.yaml

Лицензия

MIT. Автор: Igor Beschastnov i.beschastnov@focuslabs.ru.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fl_style_transfer-0.2.1.tar.gz (85.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fl_style_transfer-0.2.1-py3-none-any.whl (115.8 kB view details)

Uploaded Python 3

File details

Details for the file fl_style_transfer-0.2.1.tar.gz.

File metadata

  • Download URL: fl_style_transfer-0.2.1.tar.gz
  • Upload date:
  • Size: 85.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fl_style_transfer-0.2.1.tar.gz
Algorithm Hash digest
SHA256 860ee456f0e1fd1a28b3afeee30f6772067fdd9f324c81196700512447813d21
MD5 3bf599d90e8b1dd413f0ad8152053d0c
BLAKE2b-256 b847f5124df72b86985b226215e1f56a0ac082e3f903a5e33fad4b1f3918be9b

See more details on using hashes here.

File details

Details for the file fl_style_transfer-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: fl_style_transfer-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 115.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fl_style_transfer-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fcb6ccf8e092ac33b807b0075f745e0efebe9aa0ac269e16f23f7a0582726982
MD5 709d417e7f24cfd47f00adabd760fee6
BLAKE2b-256 b80969b51fa33485e9caa5585c954333f3f2feacd0f83a2c6eab61b254ff3f88

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page