36 lines
1.2 KiB
Django/Jinja
36 lines
1.2 KiB
Django/Jinja
|
|
[Unit]
|
||
|
|
Description=LLM Inference Metrics Exporter (llama.cpp + Ollama)
|
||
|
|
After=network-online.target
|
||
|
|
Wants=network-online.target
|
||
|
|
|
||
|
|
[Service]
|
||
|
|
Type=simple
|
||
|
|
User={{ llama_server_exporter_user }}
|
||
|
|
Group={{ llama_server_exporter_user }}
|
||
|
|
WorkingDirectory={{ llama_server_exporter_install_dir }}
|
||
|
|
Environment="LLAMA_EXPORTER_PORT={{ llama_server_exporter_port }}"
|
||
|
|
Environment="LLAMA_EXPORTER_BIND=0.0.0.0"
|
||
|
|
Environment="LLAMA_EXPORTER_INTERVAL={{ llama_server_exporter_scrape_interval }}"
|
||
|
|
Environment="LLAMA_EXPORTER_TIMEOUT={{ llama_server_exporter_scrape_timeout }}"
|
||
|
|
{% if llama_server_exporter_targets and llama_server_exporter_targets != "" %}
|
||
|
|
Environment="LLAMA_TARGETS={{ llama_server_exporter_targets | to_json }}"
|
||
|
|
{% endif %}
|
||
|
|
Environment="PATH={{ llama_server_exporter_venv_bin }}:/usr/bin:/bin"
|
||
|
|
ExecStart={{ llama_server_exporter_venv_bin }}/python3 {{ llama_server_exporter_script_path }}
|
||
|
|
Restart=always
|
||
|
|
RestartSec=10
|
||
|
|
TimeoutStopSec=10
|
||
|
|
StandardOutput=journal
|
||
|
|
StandardError=journal
|
||
|
|
SyslogIdentifier=llama_exporter
|
||
|
|
|
||
|
|
# Security hardening
|
||
|
|
ProtectSystem=strict
|
||
|
|
ProtectHome=true
|
||
|
|
ReadWritePaths={{ llama_server_exporter_install_dir }} /var/log
|
||
|
|
NoNewPrivileges=true
|
||
|
|
PrivateTmp=true
|
||
|
|
|
||
|
|
[Install]
|
||
|
|
WantedBy=multi-user.target
|