Skip to main content
Glama

reflex

CI License

A System-1 decision layer for homelab and self-hosted platforms: give it a state and typed questions, it returns calibrated routing decisions in a single forward pass — no generation, no parsing, no hallucination.

Built on convaiinnovations/laya (System-1 decision models, Apache-2.0), packaged as a production service: YAML policies in, MCP/HTTP routing decisions out.

flowchart LR
    subgraph Consumers
        GW[agentgateway]
        TH[toolhive / vmcp]
        AG[agents / hermes]
    end
    subgraph reflex
        API["/decide (FastAPI)"]
        MCP["MCP server (Streamable HTTP)"]
        POL["policies/*.yaml → typed question schemas"]
        RTR["laya Router(preload=True)"]
    end
    GW --> API
    TH --> MCP
    AG --> MCP
    API --> POL --> RTR
    MCP --> POL

What it routes

Policy

Decision

Example

mcp

which MCP server / backend should handle a request

karakeep vs hindsight vs netbox vs obsidian

tool

which tool inside a chosen server, plus relevance score

find_bookmarks vs search_notes

profile

which agent profile should take the message

ops vs chat vs default

All three are choice-type questions with calibrated probabilities — schemas live in policies/*.yaml, so new routes ship without retraining. When base accuracy isn't enough, the production fine-tune path (shadow traffic → domain dataset → fine-tune → repackage) produces your own checkpoint, the same way laya-typed-decisions derives from laya.

Related MCP server: genpark-cross-lingual-semantic-intent-router-skill

What it is not

  • Not an embedding service — no vectors; use TEI for embeddings.

  • Not a rerankerscore primitives can rank candidates, but a dedicated cross-encoder reranker is the right tool for large candidate sets.

  • Not an LLM — it cannot chat, summarize, or generate anything.

  • Not a guardrail — never sits in a deny path; deny-path scanning belongs to fail-closed sidecars (e.g. mcp-guardrails).

Quickstart

pip install -r requirements.txt
uvicorn serving.app:app --host 0.0.0.0 --port 9000
curl -s localhost:9000/decide/mcp -d '{"state": {"text": "what did I bookmark about cilium last week"}}'
# {"policy":"mcp","answer":{"choice":"karakeep","probability":0.91},...}

Docker / Kubernetes: see Dockerfile and deploy/k8s.

Fine-tuning is a production feature

reflex treats fine-tuning as an operational stage, not research:

  1. Shadow mode — log every decision + the route actually taken.

  2. Distill — build the domain dataset from traffic logs (teacher = your production LLM or rule labels).

  3. Fine-tune — upstream notebook (laya_finetune_typed_decisions) against the dataset; refit temperature on your data (required — base checkpoints ship over-confident).

  4. Repackage & promote — versioned checkpoint into the image, shadow again, then enforce.

See ARCHITECTURE.md for the design deep dive and finetune/ for the pipeline contract.

License

Apache-2.0 (see LICENSE). Model weights: Apache-2.0 (Convai Innovations).

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables measuring and reporting which tool a model selects from an MCP server's tool list, without ever executing tools. Provides inspection, trial runs, and confusion analysis to benchmark routing accuracy.
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents and MCP clients to dispatch queries to the most suitable model among 70+ LLMs by scoring intent, budget, cost, and latency, returning structured routing decisions with execution telemetry. It runs as a zero-dependency Python MCP server that plugs into Claude Desktop, Cursor, and other MCP-compatible clients.
    8
    -
  • A
    license
    A
    quality
    C
    maintenance
    Enables agents to make calibrated decisions via six MCP tools for classification, relevance ranking, claim verification, action gating, next-step control, and model listing, using Jev's System One model without generating text.
    6
    17
    MIT