Skip to content

local config support on top of #185 - #186

Merged
i386 merged 3 commits into
mainfrom
phase2-local-config
Apr 6, 2026
Merged

local config support on top of #185#186
i386 merged 3 commits into
mainfrom
phase2-local-config

Conversation

@i386

@i386 i386 commented Apr 5, 2026

Copy link
Copy Markdown
Collaborator

Refs #184.
Depends on #185.

Users can now put startup models in ~/.mesh-llm/config.toml and run mesh-llm serve without repeating model flags in every launch path.

What changed

  • mesh-llm serve now loads startup models from ~/.mesh-llm/config.toml
  • the same local config file now covers both [[models]] and [[plugin]]
  • startup models can be repeated and each model can set its own ctx_size
  • GGUF multimodal entries can carry an explicit mmproj
  • explicit CLI --model / --gguf still win over configured [[models]]
  • explicit CLI --context-size still wins over configured per-model ctx_size
  • service installs now run mesh-llm serve directly and expect startup models in config

Examples

Default config path:

version = 1

[gpu]
assignment = "auto"

[[models]]
model = "Qwen3-8B-Q4_K_M"

[[models]]
model = "bartowski/Qwen2.5-VL-7B-Instruct-GGUF/qwen2.5-vl-7b-instruct-q4_k_m.gguf"
mmproj = "bartowski/Qwen2.5-VL-7B-Instruct-GGUF/mmproj-f16.gguf"
ctx_size = 8192

[[plugin]]
name = "blackboard"
enabled = true

Start from config:

mesh-llm serve
mesh-llm serve --config /path/to/config.toml

Override config explicitly:

mesh-llm serve --model Qwen3-8B-Q4_K_M
mesh-llm serve --gguf ~/models/qwen2.5-vl.gguf --mmproj ~/models/mmproj.gguf
mesh-llm serve --model Qwen3-8B-Q4_K_M --context-size 4096

Bare mesh-llm serve with no configured [[models]] now warns, shows help, and exits cleanly:

⚠️ `mesh-llm serve` needs at least one startup model.
  Add `[[models]]` to ~/.mesh-llm/config.toml, or pass `--model` / `--gguf` explicitly.

Services

Background service installs now use mesh-llm serve as the service command:

  • macOS launchd loads ~/.config/mesh-llm/service.env and executes mesh-llm serve
  • Linux systemd --user writes mesh-llm serve into ExecStart=
  • startup models now come from ~/.mesh-llm/config.toml, not service.args or custom service argv

The service restart policy now matches the new clean-exit path so a missing config does not loop forever:

  • systemd: Restart=on-failure
  • launchd: restart only on unsuccessful exit

Scope

Included here:

  • unified local config.toml parsing for startup models plus plugins
  • config-backed startup model resolution in mesh-llm serve
  • per-model ctx_size
  • optional mmproj
  • service installer updates and docs

Still not in scope:

  • pinned gpu_id assignment
  • mesh-wide reconciliation/editor work

Validation

  • cargo test -p mesh-llm
  • bash -n install.sh

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds phase-2 local node startup configuration so mesh-llm serve can load startup models (and their per-model settings) from the unified local config file, and updates service installers/docs to rely on that config instead of custom service argv.

Changes:

  • Load and resolve startup models from ~/.mesh-llm/config.toml (with CLI models/context size overriding config).
  • Extend unified config parsing/validation to include version, [gpu], and [[models]] entries alongside existing [[plugin]].
  • Update install/service templates and documentation so background services run mesh-llm serve directly and don’t restart-loop on clean exit.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
README.md Documents startup config, precedence rules, and service behavior changes.
mesh-llm/src/runtime/mod.rs Implements startup-model planning/resolution from config + CLI precedence and “no models” clean-exit path.
mesh-llm/src/runtime/local.rs Adds optional mmproj override support when starting local llama-server.
mesh-llm/src/runtime/discovery.rs Adjusts “start new mesh” behavior to respect presence of configured startup models.
mesh-llm/src/plugin/mod.rs Re-exports new config types (MeshConfig/ModelConfigEntry) for use in runtime.
mesh-llm/src/plugin/config.rs Adds unified config schema for version/gpu/models and validates unsupported settings.
mesh-llm/src/cli/mod.rs Makes --config user-visible and updates CLI help text to mention config-backed serve.
mesh-llm/README.md Updates developer docs to describe unified local config (models + plugins).
mesh-llm/docs/TESTING.md Adds a startup-config smoke checklist for manual testing.
mesh-llm/docs/DESIGN.md Documents local-node config scope and CLI precedence rules.
install.sh Switches services to run mesh-llm serve, removes service-args workflow, and updates messaging.
docs/USAGE.md Documents config-backed serve and updated service install behavior.
dist/mesh-llm.service Changes restart policy to on-failure to avoid restart loops on clean exit.
dist/com.mesh-llm.mesh-llm.plist Restarts launchd job only on unsuccessful exit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mesh-llm/src/runtime/mod.rs Outdated
Comment thread README.md Outdated
Comment thread docs/USAGE.md Outdated
Comment thread mesh-llm/README.md Outdated
Comment thread mesh-llm/docs/DESIGN.md Outdated
CLI precedence is by concern:

- explicit `--model` or `--gguf` ignores configured `[[models]]`
- explicit `--context-size` overrides configured `ctx_size`

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Design doc references --context-size, but the CLI flag is --ctx-size and there is no --context-size alias. Align the docs with the current CLI surface, or add an alias so the documented command works.

Suggested change
- explicit `--context-size` overrides configured `ctx_size`
- explicit `--ctx-size` overrides configured `ctx_size`

Copilot uses AI. Check for mistakes.
Comment thread mesh-llm/docs/TESTING.md Outdated
Comment thread mesh-llm/src/runtime/mod.rs
Comment thread install.sh
@i386
i386 changed the base branch from phase1-serve-client-cli to main April 6, 2026 00:08
@i386
i386 force-pushed the phase2-local-config branch from b9d5913 to 16b916b Compare April 6, 2026 00:08
@i386

i386 commented Apr 6, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot apply changes based on the comments in this thread

@i386 i386 changed the title Draft phase 2 local config support on top of #185 local config support on top of #185 Apr 6, 2026
…ze docs, remove dead service-args code

Agent-Logs-Url: https://github.com/michaelneale/mesh-llm/sessions/2edc2366-a8ef-4876-b950-5c4074df8a67

Co-authored-by: i386 <50156+i386@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 6, 2026 00:18
@i386
i386 removed the request for review from Copilot April 6, 2026 00:18

Copilot AI commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

@copilot apply changes based on the comments in this thread

Applied all changes from the review thread in 100a649:

  • runtime/mod.rs: Warning now uses plugin::config_path() to show the actual effective config path (--config override, MESH_LLM_CONFIG env var, or default) instead of the hardcoded ~/.mesh-llm/config.toml
  • Docs (README.md, docs/USAGE.md, mesh-llm/README.md, mesh-llm/docs/DESIGN.md, mesh-llm/docs/TESTING.md): All references to --context-size updated to --ctx-size to match the actual CLI flag
  • install.sh: Removed dead service-args plumbing — write_service_args_file, serialize_shell_args, parse_service_args, read_existing_systemd_args, and resolve_systemd_service_args (including the SYSTEMD_ARGS_COMMENT_PREFIX reference)

@i386
i386 merged commit 1eeb11f into main Apr 6, 2026
7 checks passed
@i386
i386 deleted the phase2-local-config branch April 6, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants