R162 · Infrastructure for agents at scale › Inference providers and serving reliability

MLX Model Scout: a local agent team that never does the arithmetic

Read the original

Authors Paul Iusztin (shared)

inferenceopen-modelsmcpopen-sourcehuman-oversight

Source: michaelhannecke/mlx-model-scout (MIT, Python, FastMCP), a capstone project from an agent-engineering course, surfaced by Paul Iusztin on 2026-11-19. README validation data dated 2026-10-28.

What it is

An MCP server that answers a practical question: which of the thousands of MLX conversions on Hugging Face will fit in this Mac's memory, how fast will it decode, and which suits my use case? It runs a small team of agents (planner, scout, analyst, advisor) on a local LLM served on 127.0.0.1, so prompts and reports never leave the machine. The only outbound traffic is search terms and public repo ids sent to the Hub.

The design point worth studying is the split of responsibilities: agents plan, search, read model cards and write recommendations; a deterministic calculator produces every number; a human approves at two server-enforced checkpoints.

Architecture

  1. Plan. The planner LLM turns a use case ("Python coding assistant in the IDE") into Hub search terms.

  2. Scan. Parallel Hub scans; the scout LLM shortlists candidates.

  3. Compute. A pure-Python calculator estimates memory fit and decode speed per candidate. If nothing fits, it tries smaller quantizations or shorter contexts.

  4. Checkpoint 1. The user keeps, removes or adds candidates, or changes the context length.

  5. Analyze. The analyst LLM extracts a small, flat set of facts from each model card.

  6. Advise. The advisor LLM ranks and explains; code then checks every repo id and number in the draft against the inputs.

  7. Checkpoint 2. The user approves, rejects or asks for a revision.

  8. Save. The approved report and a full audit trail (every LLM call, tool call and decision) go to SQLite, browsable with Datasette.

The checkpoints are state-machine gates in the server, not prompt instructions: a run cannot reach a report without a selection, and nothing is saved as approved without an explicit approval.

How the numbers are produced

QuantityMethod
Weight memoryactual safetensors download size from the Hub API (exact); parameter formula only as fallback
KV cacheper layer, 2 x kv_heads x head_dim x tokens x 2 bytes; sliding-window layers cap tokens at the window
Available memorymin(GPU wired limit, unified memory minus reserve)
Decode tok/sbandwidth x efficiency / (active weight bytes + KV bytes); efficiency 0.8 dense, 0.6 MoE

Two details are good practice. Parameter counts come from config.json because the Hub's metadata is wrong for quantized MLX repos (weights are packed into uint32). And per-layer KV accounting matters for hybrid architectures: on a 64-layer model with only 16 full-attention layers, treating every layer as full attention predicts 11.8 tok/s at 24k context against a measured 16.0. The README's estimates land within a few percent of measured speeds on an M5 Pro.

Making small local models reliable

Tradeoffs and limitations

Failure modes to watch

Review checklist for similar agent tools

Cited in field guides

Connections

See R162 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.