diff --git a/README.md b/README.md index 05ad3b78b..68d69931e 100644 --- a/README.md +++ b/README.md @@ -234,7 +234,7 @@ mesh-llm serve --config /path/to/config.toml Precedence rules: - Explicit `--model` or `--gguf` ignores configured `[[models]]`. -- Explicit `--context-size` overrides configured `ctx_size` for the selected startup models. +- Explicit `--ctx-size` overrides configured `ctx_size` for the selected startup models. - Plugin entries still live in the same file. ### No-arg behavior diff --git a/docs/USAGE.md b/docs/USAGE.md index e6b8d78ba..dc1007897 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -183,7 +183,7 @@ mesh-llm serve --config /path/to/config.toml Config precedence: - Explicit `--model` or `--gguf` ignores configured `[[models]]`. -- Explicit `--context-size` overrides configured `ctx_size` for the selected startup models. +- Explicit `--ctx-size` overrides configured `ctx_size` for the selected startup models. - `mmproj` is optional and only used when that startup model needs a projector sidecar. - Plugin entries stay in the same file. diff --git a/install.sh b/install.sh index 04258dc02..f90f6d451 100644 --- a/install.sh +++ b/install.sh @@ -323,81 +323,6 @@ install_bundle() { done } -write_service_args_file() { - local path="$1" - local raw_args="$2" - - mkdir -p "$(dirname "$path")" - - if ! eval "set -- $raw_args"; then - echo "error: failed to parse service args: $raw_args" >&2 - exit 1 - fi - - { - echo "# One mesh-llm CLI argument per line." - echo "# Blank lines and lines beginning with # are ignored." - echo "# Examples:" - echo "# --auto" - echo "# --model" - echo "# Qwen2.5-3B" - local arg - for arg in "$@"; do - printf '%s\n' "$arg" - done - } > "$path" -} - -serialize_shell_args() { - local out="" - local escaped - local arg - for arg in "$@"; do - printf -v escaped '%q' "$arg" - out+="${out:+ }$escaped" - done - printf '%s' "$out" -} - -parse_service_args() { - local raw_args="$1" - - if ! eval "set -- $raw_args"; then - echo "error: failed to parse service args: $raw_args" >&2 - exit 1 - fi - - SERVICE_ARGS_VALUES=("$@") - SERVICE_ARGS_SERIALIZED="$(serialize_shell_args "$@")" -} - -read_existing_systemd_args() { - if [[ ! -f "$SYSTEMD_UNIT_PATH" ]]; then - return 1 - fi - - local existing - existing="$(sed -n "s/^${SYSTEMD_ARGS_COMMENT_PREFIX}//p" "$SYSTEMD_UNIT_PATH" | head -n 1)" - [[ -n "$existing" ]] || return 1 - printf '%s\n' "$existing" -} - -resolve_systemd_service_args() { - local existing - - if [[ -n "$INSTALL_SERVICE_ARGS" ]]; then - parse_service_args "$INSTALL_SERVICE_ARGS" - return - fi - - if existing="$(read_existing_systemd_args)"; then - parse_service_args "$existing" - return - fi - - parse_service_args "--auto" -} - systemd_escape_assignment_value() { local value="$1" value="${value//\\/\\\\}" diff --git a/mesh-llm/README.md b/mesh-llm/README.md index 4c7da2b3f..26a1fbf1f 100644 --- a/mesh-llm/README.md +++ b/mesh-llm/README.md @@ -101,7 +101,7 @@ args = ["--stdio"] ``` `mesh-llm serve` uses `~/.mesh-llm/config.toml` by default, or `--config /path/to/config.toml`. -Explicit `--model` or `--gguf` ignores configured `[[models]]`, and explicit `--context-size` +Explicit `--model` or `--gguf` ignores configured `[[models]]`, and explicit `--ctx-size` overrides configured `ctx_size` for the selected startup models. Bare `mesh-llm serve` warns, shows help, and exits if `[[models]]` is empty. diff --git a/mesh-llm/docs/DESIGN.md b/mesh-llm/docs/DESIGN.md index 222c82b9c..16257552d 100644 --- a/mesh-llm/docs/DESIGN.md +++ b/mesh-llm/docs/DESIGN.md @@ -122,7 +122,7 @@ Phase 2 keeps this config intentionally local-node only. There is no authored me CLI precedence is by concern: - explicit `--model` or `--gguf` ignores configured `[[models]]` -- explicit `--context-size` overrides configured `ctx_size` +- explicit `--ctx-size` overrides configured `ctx_size` - plugin config continues to load from the same file Bare `mesh-llm serve` is the config-owned path. If `[[models]]` is empty, it warns, diff --git a/mesh-llm/docs/TESTING.md b/mesh-llm/docs/TESTING.md index a58edc921..366be8f60 100644 --- a/mesh-llm/docs/TESTING.md +++ b/mesh-llm/docs/TESTING.md @@ -38,7 +38,7 @@ mesh-llm serve - Both configured startup models should be considered for launch - If `[[models]]` is empty, `mesh-llm serve` should print a `⚠️` warning, show help, and exit cleanly - Explicit `--model` or `--gguf` should ignore configured `[[models]]` -- Explicit `--context-size` should override configured `ctx_size` +- Explicit `--ctx-size` should override configured `ctx_size` ## Single-model permutations diff --git a/mesh-llm/src/runtime/mod.rs b/mesh-llm/src/runtime/mod.rs index 561c52ace..3a8409456 100644 --- a/mesh-llm/src/runtime/mod.rs +++ b/mesh-llm/src/runtime/mod.rs @@ -296,8 +296,15 @@ pub(crate) async fn run() -> Result<()> { } let startup_specs = build_startup_model_specs(&cli, &config)?; if should_show_serve_config_help(normalized_args.explicit_surface, &cli, &startup_specs) { + let config_path = plugin::config_path(cli.config.as_deref()).unwrap_or_else(|_| { + dirs::home_dir() + .unwrap_or_else(|| PathBuf::from("~")) + .join(".mesh-llm") + .join("config.toml") + }); eprintln!( - "⚠️ `mesh-llm serve` needs at least one startup model.\n Add `[[models]]` to ~/.mesh-llm/config.toml, or pass `--model` / `--gguf` explicitly." + "⚠️ `mesh-llm serve` needs at least one startup model.\n Add `[[models]]` to {}, or pass `--model` / `--gguf` explicitly.", + config_path.display() ); Cli::command().print_help().ok(); eprintln!();