← All posts

Serving a 14B parameter LLM on my laptop to get my girlfriend clients

Two production systems of mine run on a language model on my own laptop: LeadScout, which finds people looking to hire my girlfriend's hair and makeup business, and the news sentinel in TradeFlow, which screens trades for hacks and delistings. Both run on one copy of Qwen3 14B, served by LLMGateway on an Apple M4 Pro with 48 GB of unified memory. That memory is also what the GPU, my editor, a trading engine and everything else share. A dedicated server or a hosted API would have been simpler. I used the laptop partly because it was free, and partly for the challenge of serving a real model from one. So most of this post is about fitting a useful model into a budget, and then checking that it does the job.

A Discord alert from LeadScoutBot: Lead score 95, a bride needs a makeup and hair stylist for her wedding on January 7 in Draper. It shows the place, the date, the original post text and a suggested reply from Kissed by Kenzie. A shared-post name and the post link are blurred.
What LeadScout produces: a scored lead, the extracted place and date, and a drafted reply for a person to send.

Why LeadScout exists

LeadScout started because my girlfriend, a hair and makeup artist who runs Kissed by Kenzie, was having trouble finding clients. The demand was out there: people regularly ask in local Facebook groups for someone to do their wedding, prom or photo shoot makeup. But those posts are scattered across dozens of groups and buried among everything else, so they're easy to miss. LeadScout makes sure she sees them, with a reply already drafted.

The LeadScout pipeline

LeadScout watches the groups and feeds a business picks, decides whether each new post is someone looking to hire, scores it from 0 to 100, drafts a reply, and alerts on Discord when a strong one shows up. A person reviews it and posts the reply themselves.

  1. On a schedule Sources New posts from local groups, Reddit and job listings.
  2. Instant Keyword filter Drops posts that don't mention the business's services.
  3. 10–20 s a post Local model Answers factual questions about the post and drafts a reply.
  4. Instant Score & alert Code computes the score; strong leads go to Discord.
LeadScout over the 30 days to Nov 23, 2026
  1. Posts fetched 40,965
  2. Matched a keyword 21,247
  3. Analyzed by the model 3,119
  4. Leads alerted 83
Posts at each stage. Of about 41,000 posts, 83 were people looking to hire: roughly three a day.

Leads are 0.2% of posts, so the expensive step has to see as few as possible. A keyword filter removes half the stream for free; dedup, a 14-day age limit, a per-source cap and scanning low-yield groups less often keep the model to about 100 posts a day.

The memory budget

Ollama runs the model through llama.cpp on the GPU via Metal. On Apple silicon the GPU uses the same RAM as everything else, so the model's footprint comes straight out of the machine's working memory, and what matters is weights plus KV cache.

ComponentSizeWhy
Weights, 16-bit~30 GB14.8B parameters × 2 bytes: doesn't fit alongside everything else
Weights, Q4_K_M9.3 GBabout 5 bits per weight, the 4-bit “K-quant” mix
KV cache, 2 × 16k tokens, f165.0 GiB160 KiB per token (below)
Resident total14 GBas reported by ollama ps, 100% on GPU

The KV cache stores each layer's keys and values for every token in context. Qwen3 14B uses grouped-query attention: 40 query heads share 8 key/value heads, each 128 wide, across 40 layers. Per token:

2 (K, V) × 40 layers × 8 KV heads
  × 128 dims × 2 bytes
= 163,840 bytes = 160 KiB per token

32,768 tokens × 160 KiB = 5,120 MiB

llama.cpp's own log reports exactly that: a 5,120 MiB KV buffer, 2,560 MiB each for K and V. Grouped-query attention is doing a lot of work here; with a key/value head for every query head the cache would be five times larger, 25 GiB.

Horizontal stacked bars of weights plus KV cache in gigabytes. 16-bit weights: 29.6 plus 5.4, 35.0 GB. 4-bit weights without grouped-query attention: 9.3 plus 26.8, 36.1 GB. 4-bit weights as run today: 9.3 plus 5.4, 14.7 GB. 4-bit weights with an 8-bit KV cache: 9.3 plus 2.7, 12.0 GB. A line marks the 48 GB of total memory. 0 GB 10 GB 20 GB 30 GB 40 GB 50 GB 48 GB total memory 16-bit weights 16-bit weights: weights 29.6 GB 16-bit weights: KV cache 5.4 GB 35.0 GB 4-bit weights, no GQA 4-bit weights, no GQA: weights 9.3 GB 4-bit weights, no GQA: KV cache 26.8 GB 36.1 GB 4-bit weights (today) 4-bit weights (today): weights 9.3 GB 4-bit weights (today): KV cache 5.4 GB 14.7 GB 4-bit + 8-bit KV (next) 4-bit + 8-bit KV (next): weights 9.3 GB 4-bit + 8-bit KV (next): KV cache 2.7 GB 12.0 GB
  • Weights
  • KV cache
Weights plus KV cache for two 16k-token slots. Quantizing the weights and grouped-query attention each save about 20 GB; an 8-bit KV cache would save 2.7 GB more.

Context length is the knob that sets this. Ollama's default here was one 32k-token slot, but the sentinel's prompts are 2 to 3 thousand tokens and LeadScout's about 1,000. The real problem was concurrency: with one slot, a sentinel check queued behind LeadScout's batch work and hit its 180-second timeout. Two slots of 16k tokens cost the same 5 GiB as one of 32k, and they fixed the timeouts. The model is also pinned in memory (keep_alive = -1), because unloading and reloading 9 GB costs seconds on every cold request.

The next lever is quantizing the KV cache itself. Storing K and V at 8 bits (q8_0) would halve it to 2.5 GiB with little loss, and flash attention, which llama.cpp needs for that, is already on. I haven't needed it yet; I'd rather spend the memory on a third slot when a third app needs one.

Where the time goes

On the M4 Pro the model reads prompts at about 200 tokens a second and generates at about 24. A typical request reads about 1,000 tokens and writes about 460, so prefill takes about a second and generation about 20. Nearly all the latency is decode, which is bound by memory bandwidth: every generated token reads the whole 9 GB of weights.

Scatter plot of 95 recent requests to the shared model server: total time in seconds against tokens generated, up to 1,000 tokens and 45 seconds. Most points fall close to a line at 24.5 tokens per second, with a few short replies taking 15 to 40 seconds; prefill adds about a second. 0 s 10 s 20 s 30 s 40 s 0 200 400 600 800 1000 tokens generated 24.5 tokens/s 632 tokens: 5.9 s prefill + 25.1 s decode 232 tokens: 7.2 s prefill + 9.2 s decode 396 tokens: 0.8 s prefill + 16.4 s decode 46 tokens: 4.2 s prefill + 1.8 s decode 74 tokens: 5.1 s prefill + 26.5 s decode 46 tokens: 0.4 s prefill + 16.2 s decode 40 tokens: 1.7 s prefill + 20.3 s decode 6 tokens: 0.6 s prefill + 1.8 s decode 74 tokens: 4.1 s prefill + 30.8 s decode 88 tokens: 30.9 s prefill + 8.8 s decode 738 tokens: 6.3 s prefill + 30.1 s decode 606 tokens: 2.2 s prefill + 24.3 s decode 739 tokens: 0.7 s prefill + 29.5 s decode 453 tokens: 0.7 s prefill + 18.1 s decode 397 tokens: 0.9 s prefill + 15.8 s decode 467 tokens: 2.8 s prefill + 19.2 s decode 606 tokens: 2.2 s prefill + 24.8 s decode 799 tokens: 0.7 s prefill + 32.8 s decode 406 tokens: 0.7 s prefill + 16.6 s decode 397 tokens: 0.8 s prefill + 16.2 s decode 71 tokens: 3.6 s prefill + 2.7 s decode 466 tokens: 2.8 s prefill + 18.4 s decode 837 tokens: 0.7 s prefill + 33.2 s decode 458 tokens: 0.7 s prefill + 18.2 s decode 506 tokens: 1.3 s prefill + 20.4 s decode 397 tokens: 0.7 s prefill + 15.9 s decode 425 tokens: 0.7 s prefill + 18.7 s decode 581 tokens: 1.3 s prefill + 23.0 s decode 397 tokens: 0.7 s prefill + 15.5 s decode 74 tokens: 1.2 s prefill + 2.8 s decode 71 tokens: 1.2 s prefill + 2.7 s decode 496 tokens: 2.8 s prefill + 20.5 s decode 606 tokens: 2.2 s prefill + 28.0 s decode 396 tokens: 0.7 s prefill + 31.4 s decode 456 tokens: 1.0 s prefill + 26.5 s decode 397 tokens: 0.7 s prefill + 15.7 s decode 486 tokens: 2.8 s prefill + 20.7 s decode 613 tokens: 2.2 s prefill + 24.3 s decode 739 tokens: 0.7 s prefill + 29.2 s decode 458 tokens: 0.7 s prefill + 18.2 s decode 435 tokens: 0.7 s prefill + 17.2 s decode 651 tokens: 1.7 s prefill + 26.2 s decode 397 tokens: 0.7 s prefill + 15.8 s decode 486 tokens: 2.9 s prefill + 19.4 s decode 890 tokens: 2.2 s prefill + 35.5 s decode 597 tokens: 0.7 s prefill + 23.6 s decode 593 tokens: 0.7 s prefill + 23.4 s decode 456 tokens: 0.7 s prefill + 18.1 s decode 727 tokens: 1.7 s prefill + 29.0 s decode 397 tokens: 0.7 s prefill + 15.7 s decode 482 tokens: 2.9 s prefill + 21.5 s decode 795 tokens: 2.2 s prefill + 32.4 s decode 739 tokens: 0.7 s prefill + 29.9 s decode 458 tokens: 0.7 s prefill + 18.6 s decode 456 tokens: 0.7 s prefill + 19.1 s decode 730 tokens: 1.8 s prefill + 30.2 s decode 397 tokens: 0.7 s prefill + 15.9 s decode 74 tokens: 1.3 s prefill + 2.9 s decode 74 tokens: 1.2 s prefill + 2.9 s decode 507 tokens: 2.8 s prefill + 20.7 s decode 494 tokens: 2.2 s prefill + 19.9 s decode 693 tokens: 0.7 s prefill + 28.9 s decode 453 tokens: 0.7 s prefill + 18.3 s decode 463 tokens: 0.7 s prefill + 18.7 s decode 539 tokens: 1.7 s prefill + 21.8 s decode 397 tokens: 0.7 s prefill + 16.0 s decode 533 tokens: 2.8 s prefill + 21.6 s decode 771 tokens: 2.3 s prefill + 32.5 s decode 597 tokens: 0.8 s prefill + 24.8 s decode 396 tokens: 0.7 s prefill + 16.6 s decode 458 tokens: 0.7 s prefill + 20.5 s decode 702 tokens: 1.7 s prefill + 29.3 s decode 397 tokens: 0.7 s prefill + 18.1 s decode 584 tokens: 3.4 s prefill + 29.4 s decode 787 tokens: 2.3 s prefill + 32.8 s decode 707 tokens: 0.7 s prefill + 29.3 s decode 453 tokens: 0.7 s prefill + 31.1 s decode 462 tokens: 0.7 s prefill + 22.0 s decode 397 tokens: 0.7 s prefill + 21.2 s decode 69 tokens: 1.2 s prefill + 2.7 s decode 68 tokens: 1.2 s prefill + 2.7 s decode
95 recent requests to the shared server. Most sit on the 24.5 tokens/s line, and reading the prompt is about 4% of the time. The slow short replies above the line most likely ran while the other slot was busy.

So the optimizations go after output tokens:

  • Qwen3 reasons at length before answering by default, which took a post from seconds to minutes. A short classification doesn't need that, so requests turn thinking off with reasoning_effort: "none", because the /no_think prompt switch is ignored through Ollama's OpenAI-compatible API.
  • The output schema is compact: short factual fields instead of free-form explanation.

Prefill is cheap partly because of llama.cpp's prompt cache. Every LeadScout request starts with the same system prompt, the business's services, rules and service area, and only the post at the end changes. llama.cpp keeps the KV state for prompts it has seen and reuses the longest matching prefix, so across recent requests a median 71% of each prompt came straight from cache and only about 280 new tokens needed processing. That shapes how prompts are written: stable instructions first, the variable part last, and rule changes made rarely, since any edit to the shared prefix invalidates it.

Histogram of 111 requests by the share of the prompt whose KV state was reused from llama.cpp's prompt cache. 13 reused under 10 percent; most reused 50 to 90 percent, with the largest group, 43 requests, at 80 to 90 percent. 0 10 20 30 40 50 0–10% from cache: 13 requests 13 0% 10% 20–30% from cache: 1 requests 1 20% 30–40% from cache: 1 requests 1 30% 40% 50–60% from cache: 18 requests 18 50% 60–70% from cache: 16 requests 16 60% 70–80% from cache: 14 requests 14 70% 80–90% from cache: 43 requests 43 80% 90–100% from cache: 5 requests 5 90% share of the prompt served from the cache
How much of each prompt llama.cpp reused from its cache, across 111 requests. The median is 71%; the requests near 0% are the first of a kind, or a prompt that changed.

Making a small model reliable

Four techniques took the classifier from unpredictable to something I can test:

  • Requests send a strict JSON schema, which Ollama compiles into a grammar that restricts which tokens can be sampled, so the reply is valid JSON in the right shape. If it still fails validation (with Zod), one retry spells the schema out in the prompt instead.
  • Sampling uses temperature 0 and a fixed seed, so a borderline post gets the same answer every run instead of flipping.
  • The model supplies facts and code makes the decisions. Asked for a 0–100 score directly, the model drifted by more than 30 points on the same post. Now it only extracts facts (who is asking, for what, where, when), and code scores them: intent up to 40, service fit 25, location 20, timing and value 15.
  • A lead needs a quote that actually appears in the post and actually names hair or makeup. Distances come from real coordinates, and dates like “January 7” posted in November resolve to the next January, in code rather than in the model.
Two histograms of lead score, side by side with separate vertical scales. Not leads, 827 posts: all score 10 to 19. Leads, 32 posts: 2 score 30 to 39, 3 score 60 to 69, 4 score 70 to 79, 12 score 80 to 89 and 11 score 90 to 99. Not leads · 827 posts 0 300 600 900 Not leads, score 10–19: 827 827 0 20 40 60 80 100 lead score Leads · 32 posts 0 5 10 15 Leads, score 30–39: 2 2 Leads, score 60–69: 3 3 Leads, score 70–79: 4 4 Leads, score 80–89: 12 12 Leads, score 90–99: 11 11 0 20 40 60 80 100 lead score
Scores for one week of posts the model analyzed, split by the final label (the two charts have different vertical scales). No non-lead scores above 20 and no lead below 30, so the alert threshold has a wide margin.

Switching models brought its own problems. After the move from Gemma 3 12B to Qwen3 14B, Qwen3 often left the quote fields empty while its own summary named the service, so the evidence check also accepts the extracted service when the post names it too.

Measuring it

The evaluation set is 4,292 posts, each labeled after one of the audits described below read it. Only 138 are leads, so accuracy is meaningless: a model that says no to everything scores 97%. What I track is recall, how many real leads it finds, and false alarms.

The latest run covered all 138 leads and a fixed sample of 600 non-leads:

MeasureCountRate
Recall: leads found115 of 13883%
Recall, leaving out events already past115 of 12989%
False alarms: non-leads flagged2 of 6000.3%
Leads dropped by the keyword filter1 of 1380.7%

Nine of the 23 misses are posts the scanner first read after the event had already happened, which the current rules reject on purpose. Most of the rest ask for recommendations without clearly asking to hire anyone. Some of the classifier's fixes came from these same posts, so the numbers lean optimistic. Alongside the eval, 69 regression cases pin specific posts to lead or not-lead, with score bounds, plus separate recall and keyword-filter tests.

Auditing the model with a Claude Code skill

The eval set has to keep up with what people actually post, so I wrote a Claude Code skill, /audit-posts, that does the review. When I run it, Claude:

  1. Dumps every post not yet audited, both the ones the model labeled and the ones the keyword filter dropped before the model saw them.
  2. Reads every one of them. The skill forbids sampling or keyword-searching, because the missed leads are exactly the posts that don't use the expected words.
  3. Judges each label against the business's written rules plus a list of the owner's past rulings (face painting counts, salon job ads don't, an expired date doesn't), and asks instead of guessing when a post doesn't fit.
  4. Fixes what the rules already decide: flips wrong labels, which records them as corrections in the eval set, and fixes the classifier for systematic misses.
  5. Adds each fixed post as a regression case, reruns all the tests and checks new rules against every existing non-lead for false positives, then redeploys and cleans up stale alerts.
  6. Marks only the posts it actually read as audited.

One rule in the skill came from experience: prefer term lists and code rules over prompt edits. Rewording the prompt shifts the quotes the model extracts and breaks unrelated tests, and it invalidates the prompt cache. Each audit round turns into a commit of classifier fixes and new test cases, so the system gets measurably better every week without me reading thousands of posts myself.

Sharing one model between apps

Once two apps each started their own Ollama, they fought over the same memory. LLMGateway began by fixing that: one Ollama server, started at login by launchd and restarted if it dies, with the settings above and a menu bar icon showing whether the model is loaded. Apps call it through the gateway's OpenAI-compatible API, described below.

TradeFlow's engine runs on another machine, so it reaches the model over Tailscale. Ollama stays bound to localhost; tailscale serve proxies the tailnet port to it, and an access rule lets only the trading host reach it, since Ollama has no authentication of its own.

The gateway

The two clients want different things. The sentinel sends about 2,200 requests a day, around 2,500 tokens in and 200 out, and some block a trade until they return, so it needs a p95 under 15 seconds. LeadScout is batch work that can wait, and its posts can contain personal details, while the sentinel only reads public news. The gateway sits in front of the model server and handles both:

LLMGateway architecture LeadScout and TradeFlow's news sentinel, which connects over Tailscale from another machine, send requests to the gateway, with priority queues, a response cache and budgets. The gateway forwards to Ollama running llama.cpp on an Apple M4 Pro with 48 GB of unified memory: two 16k-token slots, one reserved for interactive work, 9.3 GB of Q4_K_M weights, a 5 GiB f16 KV cache and a prompt cache of up to 8 GiB. When allowed, it falls back to a hosted copy of the same model. CLIENTS LeadScout batch · ~100 posts a day TradeFlow sentinel interactive · p95 < 15 s LLMGATEWAY Priority queues interactive > batch Response cache temperature-0 repeats Policy & budgets fallback per client, spend caps, metrics Hosted fallback same model, pay per token M4 PRO · 48 GB UNIFIED MEMORY Ollama · llama.cpp · Metal Slot 1 16k · interactive Slot 2 16k · shared RESIDENT IN MEMORY Weights Q4_K_M · 9.3 GB KV cache 2 × 16k · f16 · 5 GiB Prompt cache up to 8 GiB ~200 tok/s prefill · ~24 tok/s decode over Tailscale, from another host local if local can't make the deadline

Scroll sideways to see the whole diagram.

LLMGateway: every app talks to the gateway, which serves requests from the local model and falls back to a hosted copy (dashed path) only when the local model can't meet a request's deadline.
  • Strict priority queues (interactive, background, batch) with one of the two slots reserved for interactive work, and preemption of long batch requests when needed.
  • If the local model is down, or the queue means a request would miss its deadline, it can go to a hosted copy of the same model and quantization family, so answers stay consistent.
  • Whether fallback is allowed depends on the data. It's on for the sentinel's public headlines and off by default for LeadScout, which gets queueing or a 503 instead.
  • A response cache keyed on model, messages, schema and parameters for temperature-0 requests, since the sentinel often re-sends identical headline batches.
  • Per-client spending caps on the fallback, metrics per client, and no logging of prompts or responses.

The load test it's built around: with 50 LeadScout batch requests in flight, a sentinel request that arrives must still finish within its deadline, served locally by preemption or by the fallback.

Did it get her clients?

LeadScout has been scanning every day since October, and my girlfriend now books several $75 services a week from the leads it sends her. It runs on a laptop I already owned, and since LeadScout never uses the hosted fallback, the model costs nothing beyond electricity, so even a single booking more than pays for a month of running it. I also built her website, kissedbykenzie.com, and some of the work shown there is for clients she booked through LeadScout.

The kissedbykenzie.com home page: a header with the KissedByKenzie name, a pixel-art cat logo, tags for licensed cosmetologist, makeup and hair, and Salt Lake, Utah County and Park City, contact buttons and a Book now button, above a makeup portfolio showing character, bridal and competition looks.
kissedbykenzie.com, the site I built for her business.