Skip to main content

STROT

The open decision compiler. Compile your intent once with an LLM. Then decide on every record forever — classification, scoring, routing — as type-safe JSON with probabilities, confidence, and a fitted statistical guarantee, on your own hardware, at zero marginal cost.

STROT = Agentic Schema Intent + Compiler Creation & State + Code + Execution + NLU
      ⟹ JSON Decisions (classification · scoring · routing)

Agents at compile time. Never at runtime.

pip install strot-ai

How it works

                    COMPILE (once per intent + schema)
  intent + sample ──▶ agent synthesizes config ──▶ golden gate ──▶ teacher labels
                                                   (your known      (LLM annotates
                                                    answers must     your real sample,
                                                    pass)            once)
                      ──▶ calibration fitted ──▶ frozen artifact (.py)
                          (temperature +
                           conformal threshold)

                    RUNTIME (every record, forever)
  record ──▶ projection ──▶ local decision model ──▶ conformal gate ──▶ typed JSON
             (compiled)     (144M, CPU, ~60ms)       (dispatch or        decision
                                                      abstain)

The LLM runs once, at compile time. Production is a frozen, self-contained Python artifact: a small local decision model arbitrates every record, nothing is ever generated, every output is bounded, and low-confidence records abstain instead of guessing.

Decide: typed questions over records

import strot

result = strot.decide(
    records,
    questions={
        "is_bug_report": {"type": "boolean",
            "instructions": "Does this mention malfunctions, errors, or crashes?"},
        "customer_sentiment": {"type": "score", "min": 1, "max": 5,
            "instructions": "1 is furious, 5 is delighted."},
        "routing_bucket": {"type": "choice",
            "options": ["billing_team", "engineering_team", "product_feedback", "spam"]},
    },
    llm="anthropic/claude-opus-4-8",   # used once, on cache miss only
)

result.outcomes[0]["decision"]
# {"booleans": {"is_bug_report": {"type": "boolean", "probability": 0.9998}},
#  "scores":   {"customer_sentiment": {"value": 1.79, "confidence": 0.899}},
#  "choices":  {"routing_bucket": {"selected": "engineering_team",
#               "probabilities": {...}, "confidence": 0.9992}}}

Run: route and dispatch, with a guarantee

result = strot.run(
    tickets,
    query="Triage incoming support tickets into the correct resolution workflow.",
    action_registry={
        "billing_dispute":  "Refunds, invoice corrections, double charges",
        "technical_defect": "Crashes, bugs, broken behavior",
        "account_lifecycle": "Deletion, data export, GDPR requests",
    },
    llm="anthropic/claude-opus-4-8",
    golden=[  # promotion gate: artifacts must pass your known answers
        {"record": {"body": "I was double charged"}, "expect": "billing_dispute"},
    ],
    target_risk=0.1,  # fitted guarantee: wrong dispatches ≤ 10% of all records (marginal); ambiguous records abstain
)

result.summary()
# {"processed": 13, "fallbacks": 1, "actions": {...}, "cache_hit": False, ...}

The first call compiles (seconds, cents). Every later call — and every restart sharing the state directory — is a cache hit: no LLM, no API key, pure execution.

Measured

Real model (SupersonicLabs/Julia-1, 144M, CPU), real datasets, clean Docker containers:

Metric Result
Grounded routing accuracy (398 records, ground truth) 92.5% compiled (74.8% naive — the compiler is worth +18pp on the same model)
Hand-tuned ceiling, same model 100%
Typed decisions vs the leading hosted decision API's own example near-identical (score 1.79 vs 1.8)
Calibrated dispatch (α=0.15, 14 records) 13 dispatched, all correct; 1 ambiguous record abstained (guarantee is marginal — see DEVELOPERS.md)
Latency ~60 ms/record, CPU, in-process
Marginal cost per decision $0
LLM calls per runtime record 0

Install

pip install strot-ai            # core: pure stdlib
pip install strot-ai[local]     # + torch/transformers for the local decision model
pip install strot-ai[hosted]    # + openai for a hosted decision runtime
pip install strot-ai[anthropic] # + anthropic for the synthesizer

The default local decision model (SupersonicLabs/Julia-1, Apache-2.0) ships its own inference package inside its Hugging Face repository. Bake it into your image at build time:

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

After that, production runs fully offline. (Never pip install julia — that's an unrelated package.)

What makes it different

  • Compile once, decide forever — content-addressed artifact cache; schema drift automatically triggers exactly one recompile
  • Golden-record promotion — a candidate artifact is executed against your known answers inside the compile loop; only passing artifacts are ever served
  • Measured label search — the compiler scores its synthesized routing labels against the bare registry keys on a teacher-labeled sample and bakes the winner: measurement instead of guessing (on by default with target_risk, or via measure_labels=True)
  • Compile-time distillation (distill=True) — the LLM teacher labels your real sample; a logistic head is trained on the frozen encoder's embeddings (seconds, CPU, pure-Python trainer) and ships only if it beats zero-shot on a held-out fold. Strict fold hygiene: synthetic/teacher data may teach, only held-out real records judge
  • Target-accuracy policy (target_accuracy=) — fit inference-level corrections (temperature + per-class bias) and a dispatch cutoff on held-out folds so auto-decided records meet an accuracy target; below-cutoff records abstain. All local, no runtime LLM. Empirical policy, not a finite-sample guarantee — and optimize accuracy only when accuracy is the right objective (for imbalanced moderation, prefer recall; see benchmarks/)
  • Fitted guarantees — temperature scaling + split conformal prediction (fitted on disjoint folds to preserve validity), baked into the artifact. The guarantee is marginal: under exchangeability, wrong dispatches are ≤ α of all records; non-singleton prediction sets abstain. The conditional-on-dispatch bound (α / dispatch rate) is reported in the artifact's calibration metadata
  • 0% structural hallucination — output is selection + computation over your registry; nothing is generated at runtime
  • Model-independent — the decision model is a slot (nlu=): local Julia-1 by default, hosted APIs, or any drop-in selector; the compiler, gates, and calibration keep their value across all of them
  • Every compile is logged (episodes.jsonl) — the dataset for future compile-policy training

Reproduce these numbers: benchmarks/.

Documentation

See DEVELOPERS.md for the developer guide: architecture, artifact anatomy, calibration semantics and caveats, deployment patterns, model swapping, and the API reference.

License

MIT. Default decision model: Apache-2.0 (SupersonicLabs/Julia-1). Implements ideas from STROT (arXiv:2505.01636).

Metadata

Release files for strot-ai 0.11.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 0.11.1
File Size Uploaded Provenance Actions
strot_ai-0.11.1.tar.gz 44.8 kB With provenance Details for strot_ai-0.11.1.tar.gz

Built distribution (wheel)

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

Total release size: 93.7 kB

Release files / strot_ai-0.11.1.tar.gz

Download URL strot_ai-0.11.1.tar.gz
Size 44.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4ba52add161efa307ee9be4a35aca570bbac9b3158edce212f23bc7112b868e0
BLAKE2b-256 checksum
How to use checksums
f2bbd26671fee61a438c3da6cc297dc24880e498a3355f46c333aff42def9cef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 18, 2026.

Transparency log

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

Download URL strot_ai-0.11.1-py3-none-any.whl
Size 48.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d152b58b08aaaa95b5c3f28badb19f57dcafc69b8195d45285bb02fa64af2cb4
BLAKE2b-256 checksum
How to use checksums
aaa37cc9c518eaa8c9f122f5e0e4ede308391f527f0d1489d3e0fa5f9054ef29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 18, 2026.

Transparency log

Security for strot-ai 0.11.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-0.11.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 Oct 18, 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