A 1.7B model copied the example I put in the prompt
I'm running Securo, a self-hosted fork of an AGPL personal finance app, on my own machines. The API lives on an M3 Max MacBook Pro with 128 GB, under Podman. The model lives on a MacBook Pro with M1 Pro and 32 GB, and the two talk over Tailscale. Transaction data stays on the local network. It does not go to a cloud LLM.
The model is LFM3 1.7B (locals/lfm3-1.7b-mlx-bf16) behind a Locals proxy. Thinking is off. Temperature is 0.1.
Categorize is one call. The system prompt holds the rules. The user message is JSON: my categories, the uncategorized transactions, the last 40 approvals, and the last 20 rejections. Transactions and categories go out as short aliases (t1, c1) so the model doesn't have to write long names back. The call has 90 seconds to finish.
On November 20, 2026, that path still wasn't usable. The change log at the end lists every attempt, including the ones that failed.
json_schema. The system prompt has no copyable JSON example.
json_object, and json_schema with the example still in the prompt have no measured latency. The 10-transaction row is usable on the reported Fred Meyer check only; I did not record per-transaction accuracy for all 10. Earlier measurements of this model family are in A 1 GB Model With a Python Sandbox.It was thinking, so it blew the timeout
The first failure was a timeout. The request wasn't sending enable_thinking=false, and max_tokens was 8000, so the model ran a thinking step and went past the limit.
PR #44 fixed that. It merged as 5c86f76 and went live as 0.18.28 on November 20, 2026 at 10:13 AM PT. max_tokens is now 2000. The call comes back in about 47 seconds.
The timeout is gone. The categories still weren't usable.
Then it rambled, and it copied the example
Of two live runs after the timeout fix, one returned prose instead of JSON. The app showed a 503. The other copied the example from the system prompt, including the reason field "short explanation" and the aliases t1 and c1, and filed Fred Meyer under Housing. I threw that result out.
The system prompt had a literal JSON example in it. A 1.7B model treats that as a template.
Three attempts at forcing JSON
An assistant prefill was supposed to make the model continue from an already-open {. That does not force JSON on this server. Failed.
A loose response_format of json_object does return JSON, but it stringifies the candidates field and still echoes "short explanation". I rejected it.
json_schema with the old t1/c1 example still in the prompt only echoed the example. Failed.
I did not record latency for those three attempts.
A schema, and no example to copy
Then I kept json_schema and took the copyable example out of the prompt. The schema is described in words. The server enforces the shape.
On 10 synthetic transactions it came back valid in 9.02 seconds, and put Fred Meyer under Groceries at confidence 0.95. I did not record a per-transaction score for the other nine, so I'm not going to claim a score for all 10.
The same schema with a 30-transaction batch came back as valid JSON in 52.17 seconds, but the judgment fell apart: Fred Meyer went under Salary at 0.9. The schema guarantees shape, not judgment.
So "Analyze next 30" will still be one button. Behind it, the app will send the model about 10 transactions at a time.
Three live Analyze runs
The format work went live as PR #49, merged as 60b9f7b, and deployed as 0.18.30 on November 20, 2026 at 12:24 PM PT. The gate check-categorize suite was 26 of 26. pytest was 3600 passed and 48 skipped.
I then ran Analyze three times on live uncategorized transactions. All three came back HTTP 200. None of them returned a 503. None of them copied the old example reason "short explanation". Earlier, one of the two live runs after the timeout fix had copied that string, and I threw it out. This time the count is 0 of 3.
The categories are still messy in places. Playstation went under Transport. A 76 gas charge went under Rent. Helzberg Diamonds went under Loans & Advances at 0.95, which is high enough that it would have been auto-applied. Whole Foods went under Groceries at 0.95, and Jetty Insurance went under Insurance at 0.90, which are right. I'm doing a follow-up on the judgment.
What I'd tell you
A schema beats an example. The server can enforce a shape. A sentence in the prompt cannot.
An example is a template to a small model. If you put "reason": "short explanation" in the prompt, you may get that string back.
Batch size is a quality knob. Ten transactions held together on the Fred Meyer check I have. Thirty were valid JSON and the wrong category. I would have missed that if I had stopped at "the JSON parsed."
On live traffic the schema still guaranteed the shape. Three Analyze runs, 78 suggestions, no 503s, and no copied "short explanation". It did not guarantee the category. Playstation under Transport is valid JSON and a bad answer. That is the follow-up.
Change log
- Hardware: Securo API on an M3 Max MacBook Pro with 128 GB (Podman). Model served on a MacBook Pro with M1 Pro and 32 GB over Tailscale, through a Locals proxy.
- Model: LFM3 1.7B,
locals/lfm3-1.7b-mlx-bf16. - Prompts: one categorize call. The system prompt holds the rules. The user message is JSON with the categories, the uncategorized transactions, the last 40 approvals, and the last 20 rejections, using short aliases (
t1,c1). Early prompts included a literal JSON example whose reason field said "short explanation." Later prompts describe the schema in words and have no copyable example. - Settings: temperature 0.1, 90 s timeout. Thinking was left on until PR #44, then off.
max_tokenswas 8000 until PR #44, then 2000.
Problem: Categorize timed out
Change: Send enable_thinking=false and cut max_tokens from 8000 to 2000 (PR #44)
- Status: kept
- Rationale: The request wasn't sending
enable_thinking=false, so the model ran a thinking step and blew the 90 s timeout.max_tokenswas 8000. - Predicted: The call would finish inside the timeout once thinking was actually off and the output cap was smaller.
- Observed: Merged as
5c86f76, deployed as 0.18.28 on November 20, 2026 at 10:13 AM PT. Latency is about 47 s, inside the 90 s limit. The timeout is gone. Quality was still not usable: of 2 live runs, 1 returned prose instead of JSON (503 to the user) and 1 echoed the prompt example (reason "short explanation",t1/c1) and put Fred Meyer under Housing. That second result was thrown out. 0 of 2 live runs were usable.
Problem: After the timeout fix, categorize still returned unusable output
Change: Assistant prefill to force a JSON start
- Status: failed
- Rationale: If the assistant turn already starts with
{, the model should continue as JSON. - Predicted: Every reply would start as JSON.
- Observed: Prefill does not force JSON on this server. 0 effect on format. Latency not measured.
Change: Loose response_format json_object
- Status: failed
- Rationale: Ask the server for a JSON object without a full schema.
- Predicted: Parseable JSON with a
candidatesarray and real reasons. - Observed: It returns JSON, with 2 defects: the
candidatesfield is a string, and the reason still echoes "short explanation". Rejected. Latency not measured.
Change: json_schema with the old t1/c1 example still in the prompt
- Status: failed
- Rationale: A schema should constrain the shape even if the prompt still has an example.
- Predicted: Valid structured output, with real category judgments instead of a copy of the example.
- Observed: It only echoed the example. 0 new category judgments. Latency not measured.
Change: json_schema with no copyable example, 10 synthetic transactions
- Status: kept
- Rationale: A 1.7B model treats a literal JSON example as a template. Remove the example, describe the schema in words, and let the server enforce the schema.
- Predicted: Valid JSON with real category judgments, not a copy of the example, inside the 90 s timeout.
- Observed: Valid JSON in 9.02 s on 10 synthetic transactions. Fred Meyer → Groceries at confidence 0.95. Per-transaction accuracy for all 10 was not recorded.
Change: The same schema with a 30-transaction batch
- Status: failed
- Rationale: Keep a single "Analyze next 30" button, and try sending all 30 in one call.
- Predicted: The same schema quality at a larger batch, still inside the 90 s timeout.
- Observed: Valid JSON in 52.17 s, inside the timeout, but quality collapsed: Fred Meyer → Salary at 0.9. The schema guarantees shape, not judgment. Decision: batches of about 10, still behind one "Analyze next 30" button.
Problem: Live categorize still had to prove the format fix
Change: Deploy the schema, batches of about 10, and the format work as 0.18.30 (PR #49), then run three live Analyze passes
- Status: kept
- Rationale: The 10-transaction synthetic run looked good, but the bar I set was three consecutive live Analyze runs with no timeouts, no 503s, and no copied "short explanation" reasons.
- Predicted: Three live runs would return usable JSON, finish inside the 90 s timeout, and stop echoing the example.
- Observed: Merged as
60b9f7b, deployed as 0.18.30 on November 20, 2026 at 12:24 PM PT. Gate check-categorize was 26 of 26. pytest was 3600 passed and 48 skipped. Three live Analyze runs, all HTTP 200. 0 of 3 returned a 503. 0 example-reason echoes. Latencies were 73.58 s, 59.15 s, and 33.14 s, all inside the 90 s timeout. Suggestions were 30, 27, and 21: 30 + 27 + 21 = 78. Of those 78, 75 were at confidence 0.80 or higher and would have been auto-applied, and 3 were for review (75 + 3 = 78). Judgment is still uneven: Playstation → Transport, a 76 gas charge → Rent, Helzberg Diamonds → Loans & Advances at 0.95, while Whole Foods → Groceries at 0.95 and Jetty Insurance → Insurance at 0.90 were right. A follow-up on judgment is underway.
Related posts
These are the closest posts on other projects.
- A 1 GB Model With a Python Sandbox: Measuring Tool Use for LFM3-1.7B on an M1 Mac and the October 30 follow-up. Same model family, different machine (those runs were on an M1 Max) and a different task.
- Flint on an M3 Max: what I measured. Locals, which is the serve path in front of this model.
- One Mac hub for routing, memory, and local inference. The broader local-serve setup.
- My rules start as sentences. The ones I trust end up as code. Same instinct as putting the format in a server-enforced schema instead of a prompt example.
Project: Securo · Tags: Local inference Evaluation MLX macOS Structured output