← all work

laya-mcp

A small multilingual classifier (Laya, German + English) running on my Mac as an MCP server, CLI and local API, so Claude Code can hand off bulk sorting and only review what the model is unsure about.

Type
Personal Project · AI / Local ML
Year
2026
Role
Sole developer - packaging, calibration and tooling around the open Laya model.

Decides the confident bulk of short items locally in ~20-40 ms each, and sends only the uncertain rest to Claude - with calibration so its confidence actually means something.

  • Local model, ~20-40 ms per item
  • Calibrated confidence gating
  • Powers Morph's signal reading

The problem

Sorting hundreds of notes, emails or log lines with a large model is slow and costly, and most of the items are easy calls.

Let a free local model take the easy calls, keep the hard ones for Claude, and never write anything back without approval.

What I did

  1. Pinned the model and weights, ran it on Apple Silicon and exposed it as MCP tools, a CLI and a localhost API.
  2. Added calibration from labelled examples, so a confidence threshold can split auto-decided items from ones that need review.
  3. Built loaders for Markdown, mail and logs, a live dashboard, and an eval script that compares it with Claude on the same task.

Outcome

Registered in Claude Code and running as the local brain behind Morph, with honest published numbers on where it is and isn't reliable yet.

Stack

  • Python
  • MCP
  • PyTorch (MPS)
  • uv
  • Hugging Face
Next caseRepGate

© Johan Stefanesback home

Get in touch
Still building this site