feat: implement localpi runtime launcher#5
Conversation
|
Implemented the localpi runtime launcher end to end and pushed the final fixes through 0fe0727.\n\nValidation:\n- npm run check passes locally: format, lint, typecheck, 25 tests, build.\n- CI test job passes: https://github.com/dutifuldev/localpi/actions/runs/27062904972/job/79878669417\n- Smoke tested the built CLI against the already-running llama-server on 18194: node dist/src/cli/main.js --model auto -p 'Reply with exactly: ok' returned ok.\n- Confirmed LM Studio has no loaded models with lms ps before the smoke.\n- Confirmed removed schema mode fails cleanly: --final-schema exits with localpi's migration error.\n\nReview loop:\n- codex review found no P0/P1 issues.\n- Follow-up P2 findings around managed llama-server reuse, process ownership, model-id resolution, and LM Studio port warnings were fixed and covered by tests. |
Opened on behalf of Onur Solmaz (
osolmaz).Summary
Localpi was still mostly the old localagent wrapper.
This changes it into the local Pi launcher we wanted:
llama-serverby default, LM Studio as an explicit alternate runtime, default Pi tools, tool approval, token status, and no final-schema machinery.It also installs the renamed
localpibinary and keeps schema-constrained classifier output in caller tools such aslocalpager-agent.What Changed
The public CLI now matches the renamed project.
The runtime layer now decides whether to manage
llama-server, talk to LM Studio, or use a custom OpenAI-compatible endpoint.localagenttolocalpi.--final-schema,--schema, the generatedfinal_jsonextension, structured-output tests, and the example schema.LOCALPI_MODELS_FILEoverrides.llama-serverstart/reuse/status/stop support with pid and metadata under localpi state.lmstudioandopenai-compatibleruntimes.read,bash,edit,write,grep,find,ls.Testing
I tested both the normal project checks and the actual local runtime path.
The smoke prompt reused the already-running Gemma 12B
llama-serveron port18194; LM Studio reported no loaded models.npm run checknode dist/src/cli/main.js --helpnode dist/src/cli/main.js --listnode dist/src/cli/main.js --statusnode dist/src/cli/main.js --model gemma-12b -p "Reply with exactly: ok"node dist/src/cli/main.js --final-schema schema.jsonnpm linklocalpi --listlocalpi --model gemma-12b -p "Reply with exactly: ok"Risks
The main behavior change is intentional:
localagentis no longer shipped by this package, and schema output is no longer part of localpi.Older external workspace wrappers that still call
localagent --final-schemaneed to move tolocalpager-agentif they are still used.localpi --stoponly stops localpi-ownedllama-serverprocesses. It will not kill an unrelated server already running on the same port.