Skip to main content
Glama
laya-mcp

laya-mcp

by jerepaira

laya-mcp

Laya as an MCP server: typed decisions (choice / score / noul) with real probabilities in ~20-40 ms, on your own machine. No LLM calls, no tokens, no API keys, 100+ languages.

Same tool interface as jev-local, so it is a drop-in replacement wherever those tools are used.

Install

pip install git+https://github.com/jerepaira/laya-mcp.git

This pulls laya (which pulls torch) — for NVIDIA GPU you get CUDA support out of the box; on CPU-only machines it just runs slower (~15 s for the first call, milliseconds after warmup).

Model weights (~2 GB) download automatically from HuggingFace on first use.

Related MCP server: JevMCP

Use with your agent

opencode (~/.config/opencode/opencode.json):

"mcp": {
  "laya": {
    "type": "local",
    "command": ["laya-mcp"],
    "enabled": true
  }
}

Claude Code (claude mcp add):

claude mcp add laya -- laya-mcp

Any other MCP client: stdio command laya-mcp.

Tools

tool

what it does

decide(state, questions)

answer any set of typed questions at once

classify(text, labels, instructions?)

pick one label + confidence + scores

score(text, criteria, instructions?)

rate on an ordered scale + distribution

check(state, question)

yes/no → P(yes) in [0,1]

Example — route a support message:

classify("me cobraron dos veces, quiero la devolución",
         ["billing", "technical", "sales", "other"])
→ {"label": "billing", "confidence": 0.845, "scores": {...}}

Config

env

default

meaning

LAYA_DEVICE

auto (cuda if available, else cpu)

force "cpu" if VRAM is tight

LAYA_MODEL

auto-router per request

pin "english", "multilingual" or "typed-decisions"

Tip: Spanish text routes to the multilingual checkpoint. Pinning one model with LAYA_MODEL avoids checkpoint reloads when requests mix languages.

Accuracy notes

Out of the box it is fast and decent, not magic — wording of the question matters a lot and thresholds should be calibrated on your own labeled examples before trusting the probabilities. Measure, don't assume.

Credits

Decision model by Nandakishor M (Convai Innovations), Apache-2.0. This repo is only the MCP wrapper (MIT).

Available Tools

4 tools
checkB

Answer a yes/no question about a state. Returns P(yes) in [0,1].

Inputs: state (required), question (required). Returns: result

classifyA

Pick the single best label for a text, with calibrated confidence and a score for every label. Use for routing, tagging, moderation, triage.

Inputs: text (required), labels (required), instructions. Returns: result

decideB

Make typed decisions about a state. questions maps an id to {type: "choice"|"score"|"noul", instructions, criteria}. For choice, criteria is {key: description}; for score, a list of level labels. Returns each answer with a probability distribution.

Inputs: state (required), questions (required). Returns: result

scoreB

Rate a text on an ordered scale given by criteria (low to high). Returns the probability-weighted score plus the distribution.

Inputs: text (required), criteria (required), instructions. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 4 tools

    Disambiguation2/5

    decide is a generic decision engine that can handle choice and score types, which substantially overlaps with classify and score. The specialized tools add context (text vs. state), but the boundaries are not crisp, and an agent could easily misselect decide for tasks the others are designed for.

    Naming Consistency5/5

    All four tool names are single lowercase verbs with no mixed conventions or inconsistent patterns. The imperative style is consistent and easy to predict, even if the verbs are somewhat generic.

    Tool Count4/5

    Four tools is a reasonable number for a decision/classification/rating server. However, decide's broad scope makes classify, score, and check feel somewhat redundant, so the count earns slightly less than full marks.

    Completeness4/5

    The set covers common decision tasks: choice/classification, ordered scoring, and yes/no checking, plus the generic noul type through decide. Minor gaps exist around batch processing or clearer support for unstructured outputs, but the core decision surface appears well covered.

    Maintenance

    ActivitySlowing
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables AI coding agents to make fast, zero-output-token decisions by evaluating context, diffs, logs, or options through the OpenRouter Decisions API using TypeSafe Jev, returning calibrated probabilities for binary, categorical, or scoring questions.
      1
      18 npm
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI coding agents to offload yes/no, multiple-choice, and scoring questions to TypeSafe's Jev, returning compact confidence-scored answers to save tokens and improve speed.
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Provides fast, offline typed decision tools (classify, score, check, triage) to agents via the Model Context Protocol, enabling safe local inference across 100+ languages with calibrated confidence and no text generation.
      8
      60 PyPI
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Judgment calls on small, fast, cheap models: yes/no, pick-one and rating questions about any text, answered YES, NO or UNSURE. Four tools (likely, classify, rate, each) for TypeSafe's Jev, open models on Ollaya, Ollama or a local NLI model.
      4
      49 PyPI
      7
      Apache 2.0