
Operational Techniques for Automatically Starting vLLM, Flask, and cron with systemd Services in WSL2
WSL2 systemd Support To enable systemd in WSL2, configure /etc/wsl.conf. # Add to /etc/wsl.conf [ boot] systemd = true To apply the changes, restart WSL2. wsl --shutdown After configuration, you can check the list of services with systemctl --all . To automatically start user services when WSL2 launches, you need to run the loginctl enable-linger command. vLLM systemd Unit Files Startup Script #!/bin/bash set -e export CUDA_VISIBLE_DEVICES = 0 python3 -m vllm.entrypoints.openai.api_server \ --host 0.0.0.0 \ --port 8000 \ --model nvidia/NVIDIA-Nemotron-Nano-9B-v2-Japanese \ --max-model-len 32768 \ --gpu-memory-utilization 0.9 \ --trust-remote-code \ --tensor-parallel-size 1 systemd Unit File (~/.config/systemd/user/vllm.service) [ Unit] Description = vLLM Inference Server After = network.target [ Service] Type = simple WorkingDirectory = %h/vllm ExecStart = %h/vllm_server.sh Restart = always RestartSec = 5s [ Install] WantedBy = default.target Key points of the configuration are as foll
Continue reading on Dev.to Python
Opens in a new tab




