Step 1 of 13Method

Tune it on the server card

On a 16 GB RTX 5060 Ti, latency followed the tokens the model wrote. Shrinking the answer took a 7B from 1,683 ms to 353 ms, and Gemma-4 E4B got 96% of 25 commands right at 233 ms.

Qwen2.5-7B, median per command
1,683 → 353 ms
Gemma-4 E4B
96% at 233 ms
25 commands written for a one-TV house
Saved by cutting 11,378 prompt tokens
162 ms
against ~1,070 ms for 55 output tokens

Problem

The first time the command step ran against a real model, a Qwen2.5-7B served by vLLM on the homelab's RTX 5060 Ti, it took 1,683 ms at the median and got 24 of 25 test commands right. The prompt was 12,416 tokens, and 91.6% of it was the JSON schema the answer had to match.

Result

Removing the schema from the prompt, 11,378 tokens, saved 162 ms. Removing 55 of the 76 output tokens saved about 1,070 ms. Reading a prompt is parallel and cheap; writing an answer is one token at a time, each one streaming the model's weights out of memory. So latency is roughly output tokens × model size ÷ memory bandwidth, and about 40 of those 76 tokens were fields the caller filled in anyway.

The changes that followed shrank the answer: stop decoding the constant envelope, scope the schema to the devices the house has, and drop the device field in a house with one TV. On 25 commands rewritten for that house:

ModelRightMedian
Gemma-4 E4B96%233 ms
Qwen2.5-7B96%353 ms
Qwen3.5 4B100%725 ms, run without CUDA graphs, so not comparable
Gemma-4 E2B72%252 ms
Phi-4-mini36%778 ms

Decision

Gemma-4 E4B became the choice for the house. Only its configuration was committed; it was never served to the live assistant, and the next step is why.