Skip to main content

STROT

A decision compiler

Compile System-2 reasoning into System-1 decisions — $0 at inference.

PyPI License Python

STROT distills an agent's judgment into a specialized decision model — a calibrated head on a frozen encoder, trained on your real data — that then makes every decision locally, on CPU, at $0: no API calls, no GPU, no per-record cost. You (the agent) are the teacher: you design the questions and label a small sample. STROT runs no LLM and holds no API key — it only embeds, fits, and bakes.

The core (a head on a frozen gte-modernbert encoder) is benchmark-validated on Banking77 (93% full-data, 87% at 10 examples/class). Drive it from your agent (Claude, Codex, ChatGPT) over MCP, or from the Python API. No keys.

pip install "strot-ai[local]"
import strot

# You design the typed questions (see `strot playbook`), and label a small sample
# yourself — your own decisions, or human ground truth. STROT distills the rest.
questions = {"is_bug": {"type": "predicate", "instructions": "mentions a crash or error?"}}
labels    = [{"is_bug": True}, {"is_bug": False}, ...]   # one per record, same order

# Compile a decision model — no LLM, no key. A calibrated head per question.
model = strot.compile(tickets, questions, labels)

# Decide — locally, on CPU, $0 per call.
model(tickets[0])
# {"predicates": {...}, "scores": {...}, "choices": {...}}  probabilities + calibrated confidence

# Ship one self-contained file; reload anywhere.
model.dispatch("ticket-triage")
strot.load_model("ticket-triage")

No LLM runs inside STROT, at compile time or after. Production is a self-contained model file: the local model answers every record, nothing is generated at runtime, and every output is bounded typed JSON with a calibrated confidence.

Typed questions

A decision config maps a name to a typed question — predicate, choice, or score:

questions = {
    "is_bug_report":      {"type": "predicate", "instructions": "mentions crashes or errors?"},
    "customer_sentiment": {"type": "score", "instructions": "how upset is the customer?",
                           "levels": [{"label": "angry"}, {"label": "neutral"}, {"label": "happy"}]},
    "routing_bucket":     {"type": "choice", "choices": [
                              {"value": "billing",     "description": "charges, invoices, refunds"},
                              {"value": "engineering", "description": "crashes, bugs, defects"}]},
}

Pass that to strot.compile(data, questions, labels). You design the config — the agent's job (see strot playbook). Each answer carries probabilities and a calibrated confidence.

Two tiers

strot.compile(data, questions, labels, mode=...) picks how hard it works. Both distill from the labels you bring:

mode what it is when
head (default) a calibrated logistic head per question the accuracy of training on your records
deep a shared top-N LoRA adapter over all questions, then refit heads representation-bound tasks a frozen head can't crack

How it works

Two phases: the labeling (the agent's judgment) happens once; the cheap deterministic part runs on every record forever.

  • Compile once. You design the questions and label a small sample; STROT projects each record to text, embeds it on the frozen encoder, fits a calibrated head per question, and bakes a standalone artifact. No LLM, no network. Content-addressed: different labels or a schema change is a fresh model.
  • Decide forever. The local model projects a record, embeds it once, and every question head answers — typed JSON, bounded, with calibrated confidence. No LLM, ~tens of ms on CPU.
  • Refuses what it hasn't seen. A drift gate (per-class centroids + a distance threshold, fit at compile time) returns a refusal for records unlike anything in training rather than guessing on them.
  • Recompile, don't increment. Every compile is a fresh fit from the frozen base on the current labels — never a warm-start from prior weights. A model's weights are a pure function of its own (data, questions, labels, mode), so retraining on accumulated data can only gain quality; it is immune to catastrophic forgetting by construction.

Data & privacy

The labels are yours — the agent's own decisions, or human ground truth; STROT never invents data. STROT holds no key and sends records nowhere: it embeds them locally. The only PII exposure is whatever you feed your own agent while labeling — so strot.pii_scan(data) is an advisory regex scan (email, SSN, card, IBAN, IP/MAC/phone) that flags what a record carries, and the real protection is which agent you point at the data: a local/open-weight agent keeps it in your infra.

Install

pip install strot-ai                # core + the MCP server
pip install "strot-ai[local]"       # + torch/transformers (compile + serve a model)

[local] is all you need to compile and serve. The MCP server ships in the core install (python -m strot.mcp). No API keys, ever.

Drive it from an agent (MCP)

STROT's MCP server lets an agent (Claude, Codex, ChatGPT, or a production automation agent) compile, run, evaluate, and keep decision models healthy with tools instead of code. The agent designs the questions and labels the sample; the tools do the deterministic rest.

pip install "strot-ai[local]"
python -m strot.mcp          # runs the MCP server over stdio

Tools cover the whole lifecycle — inspect_data, pii_scan, compile_start/compile_status (you pass the labels), decide, evaluate_model, read_traces, drift_check, cluster_rejections, recompile, set_status (circuit breaker) — and a strot_compiler prompt (the playbook) teaches the agent how to use them. Even simpler for code-running agents: strot init drops a skill (SKILL.md + a compile script) into your project.

Point any MCP client at python -m strot.mcp. For Claude Desktop, add to claude_desktop_config.json:

{
  "mcpServers": {
    "strot": { "command": "python", "args": ["-m", "strot.mcp"] }
  }
}

Watcher — learn from an agent's traces

An observed agent's (input → decision) pairs are labels — real, free, and in-distribution. The watcher turns them into a local understudy that takes the confident cases at $0 and defers the rest back to the agent:

records, labels = strot.ingest_traces("agent_traces.jsonl")   # plain dicts or OTel spans
questions = strot.infer_questions(labels)                      # recover the schema
model = strot.compile(records, questions, labels)              # distill — no LLM

No labels to collect — the decisions the agent already made are the supervision. It clones the agent's policy (not truth), for typed decisions only. strot init installs the full watcher playbook as a skill; see WATCHER.md.

Bake the encoder into your image for offline production:

RUN pip install "strot-ai[local]" \
 && python -c "import strot; strot.prefetch_nlu(local_dir='/opt/encoder')"
ENV STROT_NLU_CHECKPOINT=/opt/encoder

Docs

DEVELOPERS.md covers the architecture — the compile path, the head/deep tiers, calibration & the drift gate, the lifecycle primitives (evaluate, traces, drift_check, cluster_rejections), the watcher (learn from an agent's traces), and the MCP agent surface.

Contributing & contact

Pull requests welcome — keep them focused, branch off the latest main, and run the suite first. See CONTRIBUTING.md. Questions or ideas: open an issue or email lee@strot-ai.xyz.

Built by Amit Rath — LinkedIn.

License

MIT. The base encoder (Alibaba-NLP/gte-modernbert-base) is Apache-2.0. Implements ideas from STROT (arXiv:2505.01636).

Metadata

Release files for strot-ai 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for strot-ai 2.0.1
File Size Uploaded Provenance Actions
strot_ai-2.0.1.tar.gz 65.2 kB With provenance Details for strot_ai-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for strot-ai 2.0.1
File Interpreter ABI Platform Actions
strot_ai-2.0.1-py3-none-any.whl Python 3 none any Details for strot_ai-2.0.1-py3-none-any.whl

Total release size: 141.8 kB

Release files / strot_ai-2.0.1.tar.gz

Download URL strot_ai-2.0.1.tar.gz
Size 65.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5d46371fece0dd40a1bbacc0d9fadf15c3eaa4205ca64c634393f8c943a866e5
BLAKE2b-256 checksum
How to use checksums
dfd24e831bc11e0130ac56ea54982464622a88c35abb8994963cbc84e73bba20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / strot_ai-2.0.1-py3-none-any.whl

Download URL strot_ai-2.0.1-py3-none-any.whl
Size 76.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4aa66b1218c68bd2f33c99010ad26f2b2bd67ee392d528bd1c5cb4fa83b6c929
BLAKE2b-256 checksum
How to use checksums
4030549204658335b81a14ae158177aa37fa763c568490a4ab7a1c774dd3dc6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for strot-ai 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for strot_ai-2.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page