webai-at-home
v0.1.8
Published
Run one participant of the WebAI@Home cluster: the central gateway, the OpenAI-compatible server, the native worker, or the command line client, without cloning the repository.
Readme
webai-at-home
The single command line program published to the npm registry as webai-at-home, so a user runs npx webai-at-home <command> to run one participant of the WebAI@Home cluster without cloning this repository. It dispatches to the other command line programs in this repository — @webai/gateway, @webai/consumer-openai, @webai/worker-openai, @webai/consumer-cli, and @webai/openai-test — rather than reimplementing any of them. See issue #170.
Run with npx
npx webai-at-home gateway
npx webai-at-home worker_openai --openai-model llama-3.2-1b-instruct --stage-names stage_llm_llama3_2_1b_full
npx webai-at-home consumer_cli submit --task_type llm_llama3_2_1b_full "What is the capital of France?"The worker above expects an OpenAI-compatible server, such as LM Studio, already running on http://localhost:1234/v1, which is that address's default and so needs no --openai-base-url. LM Studio loads the named model on demand, so it does not have to be loaded first. Run npx webai-at-home <command> --help for a command's own options — every option a command line program in this repository already has, --port, --gateway-url, --config_dir, and the rest, works the same way through npx webai-at-home.
Which program runs
The first word of the command line decides:
| First word | Runs |
| --- | --- |
| gateway | @webai/gateway, the central gateway |
| consumer_openai | @webai/consumer-openai, the OpenAI-compatible server |
| worker_openai | @webai/worker-openai, the native worker |
| consumer_cli | @webai/consumer-cli, the command line client |
| openai_test | @webai/openai-test, which tests, measures, and talks to an OpenAI-compatible server |
Anything else is reported as an unknown command. Each of the words above runs one program on whatever follows it, unchanged, and no program runs under any other name.
Every consumer_cli command — submit, status, capacity, log_statistics, and the account commands — runs behind the consumer_cli word, as npx webai-at-home consumer_cli submit .... A global option such as --gateway-url belongs after that word too, exactly as the gateway's --port belongs after gateway, because consumer_cli is what reads it. Run npx webai-at-home consumer_cli --help for the list of those commands. See each program's own README, linked above, for its own options.
--version
npx webai-at-home --versionnpx fetches whichever version of this package the npm registry currently holds, and prints nothing about which one that was, so this is what a bug report should quote.
Build
npm run build --workspace webai-at-homeBuilding this package on its own does not build the programs it wraps: npm run build:dependencies --workspace webai-at-home builds every one of them first, and prepack runs both before npm pack or npm publish packs anything, so packing never depends on having built by hand first.
For local checks, also run:
npm run typecheck --workspace webai-at-home
npm run test --workspace webai-at-homeHow a real install gets every program from one published package
None of @webai/gateway, @webai/consumer-openai, @webai/worker-openai, @webai/consumer-cli, or @webai/protocol is published to the npm registry on its own — webai-at-home is the only package this repository publishes. scripts/vendor_wrapped_programs.ts copies each wrapped program's own built output, plus a copy of @webai/protocol and, where needed, @webai/consumer-cli, into this package's own dist/vendor as part of prepack, and rewrites dist/cli.js to import each one from its vendored copy instead of by package name. See CONTEXT.md for why a plain copy replaced npm's own bundledDependencies mechanism, and what scripts/vendor_wrapped_programs.ts copies where.
