Add serve/client commands and local GPU inspection for #184 - #185
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces explicit local runtime entrypoints (mesh-llm serve, mesh-llm client) plus a new mesh-llm gpus inspection command, while keeping the legacy top-level flags working via argument normalization + migration warnings. It also expands hardware detection to surface stable-ish per-GPU identity and updates CI/scripts/docs to the new CLI surface.
Changes:
- Add
gpusCLI subcommand and expandHardwareSurveywith per-GPUGpuFacts(stable ID, backend device, cached bandwidth). - Normalize
serve/clientruntime surfaces at process start, emit migration warnings for legacy top-level usage, and update passive-mode readiness logs. - Update CI scripts + documentation/examples to use
mesh-llm serve ...,mesh-llm client ..., andmesh-llm gpus.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/ci-split-test.sh | Update multi-node CI split test to invoke serve/client surfaces. |
| scripts/ci-smoke-test.sh | Update smoke test args to use serve. |
| scripts/ci-compat-smoke.sh | Update compat smoke test args to use serve. |
| scripts/ci-client-auto-test.sh | Update client auto boot test to use client and new readiness log text. |
| scripts/benchmark-prefix-affinity.sh | Update benchmark orchestration to use serve/client surfaces. |
| README.md | Refresh top-level usage to serve/client and add gpus mention/examples. |
| mesh-llm/tests/test_blackboard.sh | Update blackboard test harness to use client surface. |
| mesh-llm/src/system/hardware.rs | Add GpuFacts, GPU name expansion + NVIDIA identity parsing, and hydrate per-GPU facts into surveys. |
| mesh-llm/src/runtime/mod.rs | Parse normalized runtime args, emit legacy warnings, and update passive readiness logging. |
| mesh-llm/src/runtime/discovery.rs | Update auto-spawned launcher behavior to start mesh-llm client --auto. |
| mesh-llm/src/cli/mod.rs | Add gpus command, update help text, and implement runtime-surface normalization + migration warning helpers. |
| mesh-llm/src/cli/commands/mod.rs | Wire gpus command into CLI dispatch. |
| mesh-llm/src/cli/commands/gpus.rs | New command implementation to print GPU facts and cached bandwidth. |
| mesh-llm/src/cli/commands/blackboard.rs | Update user guidance to reference mesh-llm client .... |
| mesh-llm/src/api/mod.rs | Update model “run” command hints to mesh-llm serve --model .... |
| mesh-llm/README.md | Update examples to serve/client and mention gpus. |
| mesh-llm/docs/TESTING.md | Update testing docs to serve/client and add gpus inspection section. |
| mesh-llm/docs/MoE_DEPLOY_DESIGN.md | Update command examples to mesh-llm serve .... |
| mesh-llm/docs/DESIGN.md | Update join example to mesh-llm serve --join. |
| docs/USAGE.md | Update usage docs to serve/client and add gpus section. |
| docs/index.html | Update website examples to mesh-llm client .... |
| docs/AGENTS.md | Update agent docs to mesh-llm client .... |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Some("serve") => { | ||
| let next_is_flag = original | ||
| .get(2) | ||
| .and_then(|arg| arg.to_str()) | ||
| .map(|arg| arg.starts_with('-')) | ||
| .unwrap_or(true); | ||
| if next_is_flag { | ||
| normalized.remove(1); | ||
| explicit_surface = Some(RuntimeSurface::Serve); | ||
| } | ||
| } |
There was a problem hiding this comment.
mesh-llm serve with no additional args gets normalized into a no-arg invocation because unwrap_or(true) makes next_is_flag true when arg[2] is missing. That bypasses the early args_os().len() == 1 help/exit path in runtime::run() and can lead to unexpected behavior (starting a node instead of showing help). Consider treating bare serve as a usage error or rewriting it to --help rather than removing the token when no further args are present.
| Some("serve") => { | |
| let next_is_flag = original | |
| .get(2) | |
| .and_then(|arg| arg.to_str()) | |
| .map(|arg| arg.starts_with('-')) | |
| .unwrap_or(true); | |
| if next_is_flag { | |
| normalized.remove(1); | |
| explicit_surface = Some(RuntimeSurface::Serve); | |
| } | |
| } | |
| Some("serve") => match original.get(2).and_then(|arg| arg.to_str()) { | |
| Some(arg) if arg.starts_with('-') => { | |
| normalized.remove(1); | |
| explicit_surface = Some(RuntimeSurface::Serve); | |
| } | |
| None => { | |
| normalized[1] = OsString::from("--help"); | |
| explicit_surface = Some(RuntimeSurface::Serve); | |
| } | |
| _ => {} | |
| }, |
|
@copilot apply changes based on the comments in this thread |
…nvidia-smi gating Agent-Logs-Url: https://github.com/michaelneale/mesh-llm/sessions/1347d058-9360-4262-ae1e-8644f2376b35 Co-authored-by: i386 <50156+i386@users.noreply.github.com>
Applied all 5 suggestions from the review thread in cb8076d:
|
local config support on top of #185
Implements the runtime-surface and GPU-inspection portion of #184.
Summary
This PR makes the local runtime entrypoints explicit and adds a local GPU inspection command.
Users can now run:
This keeps the local startup surface clearer without changing the later config work in #184.
mesh-llm serveis also necessary groundwork for the next config change. Once local config is introduced,mesh-llm servewill be the command that loads startup model configuration from~/.mesh-llm/config.toml. Splitting the runtime surface now gives that later config work a clear owner instead of continuing to hang model startup behavior off ambiguous top-level flags.New Commands
The new canonical runtime commands are:
mesh-llm gpusalso has agpualias:Deprecated Top-Level Forms
These older top-level runtime forms still work in this PR, but they are now migration shims:
They now warn and route to the new command surface.
Example:
Mixed legacy usage such as top-level
--clientplus serving flags is rejected.Example Output
Client startup now uses the new client-oriented ready output:
GPU inspection prints local GPU identity, backend device, VRAM, and cached bandwidth when available:
If no GPUs are detected:
Included In This PR
serveandclientas explicit local runtime entrypoints⚠️migration warningsmesh-llm gpusandmesh-llm gpuGpuFactssupport in local hardware surveymesh-llm gpusoutput when availableNot Included In This PR
~/.mesh-llm/config.tomlserve configgpu_idassignmentValidation
cargo test -p mesh-llm