[Unit]
Description=RSS2 Translator Worker NLLB-200 (Python)
After=network.target postgresql.service rss2-translation-scheduler.service
Requires=postgresql.service

[Service]
Type=simple
User=rss2
Group=rss2
WorkingDirectory=/opt/rss2/src
EnvironmentFile=/opt/rss2/.env
Environment=TARGET_LANGS=es
Environment=TRANSLATOR_BATCH=32
Environment=CT2_MODEL_PATH=/opt/rss2/models/nllb-ct2
Environment=CT2_DEVICE=cpu
Environment=CT2_COMPUTE_TYPE=int8
Environment=UNIVERSAL_MODEL=facebook/nllb-200-distilled-600M
Environment=HF_HOME=/opt/rss2/hf_cache
ExecStart=/opt/rss2/venv/bin/python -m workers.ctranslator_worker
Restart=always
RestartSec=15
StandardOutput=journal
StandardError=journal
SyslogIdentifier=rss2-translator

# El modelo NLLB-200 consume bastante RAM en CPU
MemoryMax=4G
CPUQuota=200%

[Install]
WantedBy=multi-user.target
