onwAMD / start.sh
ryugyosoft's picture
onw AMD 0.1.0: LLMs on the AMD Ryzen AI NPU through FastFlowLM
d0bf6e2 verified
Raw History Blame Contribute Delete
1.34 kB
#!/usr/bin/env bash
# onw AMD - Ore no NPU ga konna ni ugoku wake nai: one-command start (Linux, FastFlowLM on the AMD NPU).
# ./start.sh qwen3-it-4b-FLM (default)
# ./start.sh llama3.2-3b-FLM any model name from "onw list"
# ./start.sh MODEL --port 8080 --host 0.0.0.0 further options go to "onw serve"
# First run: creates .venv, downloads FastFlowLM and the model.
# Afterwards: source .venv/bin/activate, then onw serve / onw list / onw npu.
set -e
cd "$(dirname "$0")"
export PYTHONUTF8=1
MODEL="qwen3-it-4b-FLM"
if [ $# -gt 0 ] && [ "${1#-}" = "$1" ]; then MODEL="$1"; shift; fi
if ! python3 -c "import sys; sys.exit(0 if sys.version_info >= (3, 10) else 1)" 2>/dev/null; then
echo "Python 3.10 or newer is needed (Ubuntu 22.04 and later ship it): sudo apt install python3"
exit 1
fi
if [ ! -f .venv/installed.txt ]; then
echo "[setup] creating Python environment in .venv ..."
if ! python3 -m venv .venv; then
echo "python3-venv is missing: sudo apt install python3-venv"
exit 1
fi
.venv/bin/python -m pip install -U pip
.venv/bin/python -m pip install -e .
echo ok > .venv/installed.txt
fi
echo "[start] $MODEL (first time: NPU engine + model download, please wait) ..."
exec .venv/bin/onw serve "$MODEL" --open "$@"