OpenFlowLM-Next icon indicating copy to clipboard operation
OpenFlowLM-Next copied to clipboard

Serve-only options are accepted and ignored by bench, list, version, port and validate

Open vegah opened this issue 2 months ago • 0 comments

--port, --cors, --socket, --q-len and --host are guarded for non-serve commands — but the guard sits below the early-exit block in parse_options(), and version, port, list, bench and validate all return true before reaching it.

A flag that is accepted and ignored reads to a user exactly like one that took effect.

Measured

v0.1.0 dev, commit 743bc39:

  list      --port 9999      NOT guarded
  list      --cors 0         NOT guarded
  list      --host 1.2.3.4   NOT guarded
  version   (same three)     NOT guarded
  port      (same three)     NOT guarded
  validate  (same three)     NOT guarded
  bench     --port 9999      NOT guarded
  bench     --host 1.2.3.4   NOT guarded

The bench rows were re-run with a tag that exists (llama3.2:1b), because a first attempt with a nonexistent tag reported "refused" on Model not found rather than on the flag — a false pass.

The trap: this is not fixed by hoisting the guard

oflm port --port 8123 prints Server Port: 8123. The port command genuinely consumes --port — it exists to answer what would this resolve to. Moving the serve-only guard above the early exits would break it.

So the check has to stay per-command, with port exempted for --port. --host, --cors, --socket and --q-len have no such exemption as far as I can tell: host is read in exactly one place, create_lm_server().

For contrast, --max-batch and --prompt-name are checked above the early exits and so do cover every other command, bench included.

vegah avatar Sep 12 '26 16:09 vegah