Skip to content

larql run --engine is silently ignored for local models #199

Description

@chrishayuk

larql run --engine <spec> is silently ignored for local models.

Reproduction

$ larql run ~/larql-vindex/qwen3-0.6b-q4k.vindex "hi" -n 2 --engine not-an-engine
<think>

A deliberately invalid engine name is accepted and generation proceeds on the
default path. The same holds for valid-but-unused specs:

$ larql run <vindex> "The capital of France is" -n 4 --engine apollo:layer=1,coef=8.0,top_k=4
Paris.

apollo with no store attached must fail with RetrievalMiss, so an
ApolloEngine was never constructed.

Where

EngineKind::from_name is only consulted inside the remote-MoE branch of
commands/primary/run_cmd.rs (the --moe-shards gate, which rejects engines
that cannot hook remote experts). The local-model path never reads
engine_spec, so the flag has no effect and no error.

larql bench --engine is unaffected — it honours the spec, which is verifiable
from the distinct per-engine timings and labels it prints.

Why it matters beyond the flag

The same class as the strict-refusal work just merged: an interface that
accepts an instruction, ignores it, and returns an apparently valid result.
Anyone A/B-ing engines through larql run would compare the default path
against itself and conclude the engines are identical.

Suggested fix

Parse --engine unconditionally so an unknown spec is a hard error, and thread
the resolved EngineKind into the local path — or, if the local path genuinely
cannot honour it yet, reject the flag explicitly with that reason rather than
dropping it.

Found while running the engine sweep for PR #197's follow-on; pre-existing and
unrelated to those changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions