[Unit]
Description=RSS2 Embeddings Worker (Python)
After=network.target postgresql.service
Requires=postgresql.service

[Service]
Type=simple
User=rss2
Group=rss2
WorkingDirectory=/opt/rss2/src
EnvironmentFile=/opt/rss2/.env
Environment=EMB_MODEL=sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
Environment=EMB_BATCH=64
Environment=EMB_SLEEP_IDLE=5
Environment=EMB_LANGS=es
Environment=EMB_LIMIT=1000
Environment=DEVICE=cpu
Environment=HF_HOME=/opt/rss2/hf_cache
ExecStart=/opt/rss2/venv/bin/python -m workers.embeddings_worker
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
SyslogIdentifier=rss2-embeddings

MemoryMax=3G
CPUQuota=200%

[Install]
WantedBy=multi-user.target
