2.1 KiB
prmcp
One endpoint for a prain-served model: MCP tools picked by model name (gemma4+terminal,web).
The proxy itself is not written yet; this repo holds the stack around it so far.
The prain stack: prain up
scripts/prain is a front door for the prain command. up, down, restart, status
and logs drive the stack's OpenRC user services. Every other subcommand (serve, web,
tui, check, ...) goes to prain's own CLI in PRAIN_ROOT/.venv, with scripts/env.sh
sourced first, so you no longer need to source it yourself. (In a shell where you did, the
venv's prain comes first on PATH and prain up is unknown there.)
prain up [NAME...] start the services (all by default), waiting until each is ready
prain down [NAME...] stop them, in reverse order
prain restart [NAME...]
prain status [NAME...]
prain logs [NAME...] tail -F their logs (~/.local/state/prain/NAME.log)
Services live in ~/.config/prain/prain.conf (PRAIN_CONF overrides): PRAIN_SERVICES
lists them, and per service cmd_NAME (the command, run in PRAIN_ROOT with env.sh
sourced), ready_NAME (a URL prain up waits for) and need_NAME (dependencies). See
scripts/prain.conf.example.
One OpenRC script, openrc/init.d/prain, serves them all through links named prain.NAME.
OpenRC's supervise-daemon restarts a crashed service. It gives up after more than
respawn_max (3) crashes within respawn_period seconds (600; 1800 for vLLM in
openrc/conf.d/prain.vllm), so crashes further apart are restarted forever.
Install
ln -s "$PWD/scripts/prain" ~/.local/bin/prain
mkdir -p ~/.config/prain ~/.config/rc/init.d ~/.config/rc/conf.d
cp scripts/prain.conf.example ~/.config/prain/prain.conf
ln -s "$PWD/openrc/init.d/prain" ~/.config/rc/init.d/prain
for n in vllm web; do ln -s prain ~/.config/rc/init.d/prain.$n; done
cp openrc/conf.d/prain.vllm ~/.config/rc/conf.d/
rc-update --user add prain.web default # optional: start with the session (pulls in vllm)
A new service is a cmd_NAME line, its name in PRAIN_SERVICES and one more prain.NAME
link.
Test
bash scripts/test_prain.sh