oh-my-laya
This server exposes a single local Laya-MLX tool for advisory typed decisions.
laya_tell_meruns bounded classification (choice), ordered scoring (score), and yes/no probability (noul) questions.Accepts a state plus a set of questions, returning structured results.
Results are advisory only; they must not be used to authorize destructive or consequential actions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@oh-my-laya Use Laya to classify this change as low, medium, or high risk and whether human review is needed."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Oh My Laya
English | 简体中文
One command to bring local Laya decision-making to your coding agents. Native Laya decisions for your AI agents. Integrate Laya-MLX with Codex, Claude Code, DeepSeek Harness (DSH), and pi-agent: keep simple work with the main agent, route useful subtasks within your model limits, and learn from reviewed feedback. Use it for research, analysis, planning, coding, and other agent tasks.
Oh My Laya builds on laya-mlx. It downloads and verifies Hugging Face weights, then registers the laya_tell_me tool for classification, scoring, risk routing, and yes/no decisions. Inference runs entirely on your Mac after the model is downloaded.
Reflect. Get structured classifications, scores, and probabilities directly from local inference—not generated text to parse.
Route. Pair with Alpha Squad to select necessary roles and model/reasoning combinations. Your main model stays unchanged.
Refine. Preserve first scores, inspect uncertain decisions, and review cases before evaluating and activating them for future advice.
Install
Apple Silicon Mac · macOS 14+ · Python 3.11+. Install your agent client first. The default multilingual weights are approximately 678 MB; inference runs locally after download.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/leo1394/oh-my-laya/master/tools/oh-my-laya.sh)"sh -c "$(wget -qO- https://raw.githubusercontent.com/leo1394/oh-my-laya/master/tools/oh-my-laya.sh)"
# Interactive client selection
./install.sh
# Choose specific clients, or all detected clients
./install.sh --targets codex
./install.sh --targets codex,claude
./install.sh --targets allall and both select every detected client. The installer downloads and verifies the model and installs a prebuilt workbench without requiring Rust or Node.js.
Choose y when asked Use Alpha Squad + Laya with /goal? to connect the workflow. The installer backs up and updates only the Goal section of your client's global instructions. Choose n to leave it unchanged. For unattended setup, add --goal-workflow yes or --goal-workflow no.
Restart your agent session after installation. In Codex, find Plugins → Personal → Oh My Laya and start a new task. Codex needs a CLI with plugin add support. The advisor and Squad are installed as separate Skills; existing unmanaged or locally modified Skills are preserved.
Related MCP server: local-mcp
Use It
Start with a goal
After enabling Goal integration, enter /goal and describe the result you want:
Add search to this project, cover it with tests, and review the changes.
Use Alpha Squad with Laya's structured orchestration. Check compatibility first;
keep my main model, authorization ceilings, and recording settings unchanged.Confirm your limits. Choose a recommendation policy, execution model/reasoning ceiling, and reviewer configuration. Submit Confirm and continue; saved choices are revalidated on later tasks.
Decide before dividing. Clear, low-risk local work can stay with the main agent. Useful independent work gets only the necessary roles. Missing information triggers clarification—not more agents.
Execute within bounds. Squad applies accepted assignments through the host, using focused context and bounded repair/upgrade attempts. Required review and execution approvals still apply.
Keep the evidence. With recording authorized, save first scores as they arrive; link later test/reviewer feedback, actual model settings, and available usage without overwriting them. Review uncertain or problematic cases in the workbench.
flowchart TD
goal["/goal + your task"] --> limits["Confirm policy and model limits"]
limits --> assess["Local Laya: assess task and constraints"]
assess --> plan{"Structured plan"}
plan -->|"direct"| direct["Main agent works; no optional child"]
plan -->|"needs_context"| clarify["Clarify missing evidence"]
clarify --> assess
plan -->|"delegate"| squad["Only necessary roles; authorized model / effort"]
squad --> work["Focused context; bounded attempts; required review"]
direct --> verify["Main agent verifies and delivers"]
work --> verify
work -.->|"Recording authorized"| feedback["First scores now; outcomes and usage as available"]
direct -.->|"Recording authorized"| feedback
feedback --> study["Human review → evaluate → explicitly activate cases"]
study -.->|"Future advice"| assessLoading Squad does not mean spawning a squad. direct clears optional spawn parameters. Low complexity alone does not remove a required reviewer or other explicit obligations. These are advisory controls consumed by the host, not a hard interceptor for every native agent call.
Structured orchestration is opt-in and requires compatible installed tools and the companion Skill. The agent checks support and reports fallback rather than claiming the policy ran. To disable it, ask the agent to stop structured orchestration; recorded feedback is retained. For a local build, see Development.
Execution roles include explorer, researcher, worker, and tester—only when needed. Difficult, high-risk, or uncertain reviews use the main session's model/effort; ordinary reviews use your configured reviewer. Automatic advice stays within the selected model and reasoning ceiling; tier mappings never expand authorization.
Designed to reduce wasted tokens, not promise a percentage. Avoid unnecessary delegation, repeated context, and unproductive retries. Coordination itself costs tokens; a cheaper model is not necessarily a lower-token solution. Actual savings depend on the task and quality of the outcome.
Host capabilities vary: Codex, Claude Code, and DSH need a compatible Goal implementation/profile. Pi uses a /goal prompt template, not a persistent Goal loop. Popups and subagent assignments require host support; missing capabilities are reported.
Ask Laya directly
Ask your agent:
Use Laya to classify this change as low, medium, or high risk.
Show the structured result; do not modify any files.Tool | Purpose |
| Structured classification, scoring, yes/no probability, and model advice |
| Read or change recommendation preferences |
| Save authorized feedback, including original first scores |
For session-level advice, ask: “Use $laya-model-advisor for each new task; let me choose a recommendation policy.” Choose always ask, ask for high complexity/risk/uncertainty, or automatic advice within your selected model/effort ceiling. Accepting advice does not switch the main session model or authorize execution.
Laya does not generate code. Keep decision inputs concise: the multilingual checkpoint has a total context budget of 1,024 tokens. Preserve relevant constraints when summarizing.
Try the local Snake demo:
laya --snakeDependencies and the model path are configured during installation. Use laya --snake --help for options.
See decisions. Improve the next one.
laya dashboardThe workbench runs at http://127.0.0.1:18686. The command starts the service and pairs your browser. Use --port 18687 to choose another port; stop an existing service with laya stop before changing it.
After pairing once, you can visit or refresh that address directly—even after a service restart or upgrade. Browser trust is renewed for 30 days when you open the dashboard. A new browser, cleared cookies, or expired trust requires laya dashboard again; authorization and same-origin checks remain enabled.

Actual workbench UI with synthetic demonstration data—not measured product savings or personal usage.
Overview: scenario-estimated token savings alongside recorded actual usage, model assignments, review signals, and coverage. Filter today, 7 days, 30 days, or a custom range.
Case study: inspect uncertain decisions and original Squad feedback, correct labels, and prepare reviewed learning cases. The Overview time range carries over.
Settings: configure low/medium/high model combinations, control recording, and manage backups. English and Chinese are available.
Estimates are not measured savings; incomplete usage stays marked as partial, and negative estimates remain visible. First scores are preserved alongside later corrections. Cases inform future decisions only after evaluation and explicit activation—collection is not automatic weight training.
With recording and replay enabled, completed Codex turns with verifiable Laya receipts are periodically reconciled against native main/subagent token counters. Allow up to about seven minutes after completion; ambiguous or missing evidence is not filled with zero. Inspect laya status → native_usage_sync if usage is delayed.
Update and recover
CLI reference
Use laya version (or laya --version), laya help, and laya help dashboard for command details. man laya provides the local manual. The installer includes Bash, Zsh, and Fish completion; laya completion <shell> can regenerate it.
For a user-local installation, if your shell does not load these automatically:
export MANPATH="$HOME/.local/share/man:${MANPATH:-}"
# Bash
source ~/.local/share/bash-completion/completions/laya
# Zsh: put these before running compinit in your shell configuration
fpath=(~/.local/share/zsh/site-functions $fpath)
autoload -Uz compinit && compinitFish loads ~/.local/share/fish/vendor_completions.d automatically when using its default XDG data directory. The installer does not edit shell startup files.
Upgrades
Rerun the installer to update; local customizations are not silently overwritten. The companion Skill comes from the repository's pinned submodule. Default installation: ~/.local/share/oh-my-laya/.
Database upgrades create a private backup. Find new migration snapshots in Settings → Backup & export. Restoring recovers that snapshot, honors privacy deletions, and saves the replaced state; it does not merge newer records or downgrade the program. Stop the service and use a compatible backup before a binary rollback.
Development
To install a local source build, build the frontend and workbench, then pass the binary to the installer. Requires Node.js and Rust locally:
(cd web && npm ci && npm run build)
cargo build --locked --release -p laya
./install.sh --targets codex --workbench-binary "$PWD/target/release/laya"
# Tests
PYTHONPATH=src python3 -m unittest discover -s tests -v
cargo test --locked -p laya
(cd web && npm test)Licensed under the MIT License.
Available Tools
2 toolslaya_advisor_preferencesA
Read preferences, or save ONLY after the user's Confirm and continue.
always: ask on every assessment; conditional: ask only for high complexity, high risk or uncertainty; auto: accept within the user-approved ceiling. For auto, provide ceiling={model, reasoning_effort} and the host-verified, locally filtered models catalog. Auto uses only that model and at most that effort. Missing ceilings require setup; no automatic acceptance is allowed. These authorize recommendations, not actual switching or any other action. Omit policy to read. Unknown/unconfigured preferences default to asking. Optional squad={enabled: bool, reviewer: {model, reasoning_effort} or null} enables Alpha Squad's bounded spawn recommendations after explicit setup. Null reviewer uses the orchestrator; difficult reviews always use it. Omitted squad preserves its prior setting. This never authorizes task actions.
Inputs: squad, models, policy, ceiling. Returns: object
laya_tell_meA
Run a local typed decision with Laya-MLX.
Use for bounded classification, ordered scoring, and yes/no probability. Question types are choice, score, and noul. Treat results as advisory; never use them as authorization for destructive or consequential actions.
Unless advisor is provided, questions is required: an object keyed by question id. Each question requires type and instructions (use a string). choice requires criteria: a nonempty list of unique string labels or an object mapping labels to descriptions. score requires a nonempty criteria list ordered from lowest to highest. noul optionally accepts a criteria object with false/true descriptions. Use criteria, not options. Example: {"risk": {"type": "choice", "instructions": "Classify risk", "criteria": {"low": "Reversible documentation edit", "high": "Data loss"}}}.
For model advice, omit questions and pass advisor with models and current_model. Each host-verified model has id, reasoning_efforts (least to most), and an optional user-approved tier: fast, balanced, strong. No model is switched. For Alpha Squad, also pass role and verified current_reasoning_effort. Non-auto execution roles also require the confirmed session execution_choice pair; omit it for auto and reviewer routing. Returned delegation parameters are recommendations for the host's spawn call, never execution authorization. The current session is not changed.
Inputs: state (required), advisor, questions, orchestration. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
laya_tell_me runs a typed decision while laya_advisor_preferences reads/saves configuration policy, so their core purposes are distinct. The shared 'advisor' vocabulary and overlapping policy/recommendation language create minor potential confusion, but an agent can tell them apart.
Both names use a consistent laya_ snake_case prefix, which is good. However the second element is inconsistent in style: laya_tell_me is an imperative verb phrase while laya_advisor_preferences is a noun phrase, breaking a predictable pattern.
Two tools is thin for a server that apparently covers decision execution, model catalog advice, policy configuration, and squad setup. Much functionality appears overloaded into these two, which is borderline rather than comfortably scoped.
The domain (advisory decisions plus preference management) seems approximated by running decisions and configuring policy. There is no separate operation to inspect models, ceilings, or squad state independently, so several capabilities are only reachable indirectly.
Maintenance
Related MCP Connectors
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Paid remote MCP for LLM security scans, jailbreak checks, analytics, checkout, and readiness.
Shared memory and mail for your AI agents. Verified with Claude Code; other MCP clients in testing.
Related MCP Servers
- FlicenseAqualityDmaintenanceLocal multimodal MCP server for vision, document, audio, video, and GUI automation, all processed locally on Apple Silicon for privacy and security.9-
- FlicenseNot gradedqualityDmaintenanceEnables running MCP tools against local MLX models on your Mac, with hardware-aware configuration, CLI streaming, and a dashboard for routing and monitoring.-
- AlicenseNot gradedqualityCmaintenanceLaya-MLX as an MCP server (and plain-HTTP API). It answers typed decisions — choose an option / score a rubric / is this true? — on your own machine (Apple Silicon / MLX), with no cloud and ~10ms after warm-up. Not a chatbot. No token-by-token text, no JSON that can break. One forward pass returns a structured answer you can branch on. Ideal for routing, triage, classification, lead scoring, and gMIT
- AlicenseNot gradedqualityCmaintenanceEnables local, read-only Laya typed decisions for Codex, providing classification, scoring, truth-probability, batch decision, and token-budget planning tools on Apple Silicon.MIT