Skip to main content

System Zero

A decision model with no learned weights, published as sr-zero. System Zero answers the typed decision questions of the System One API (a choice of 2 to 255 options, a yes/no, a score on ordered levels) with a probability for every option. The answers come from rules counted over training decisions, kept as Python literals you can read, and from hand-written modules for what can be computed. Every answer names its rule, the rule's record in training, and its file and line, or says that no rule applied. The probability is the lower end of that record's 95% interval, so a weak record says "not sure", and a caller can send the decision up to a neural model.

Pure Python standard library, no dependencies, one CPU core, deterministic. The full story, with interactive demos: system-zero.semantic-router.org.

Licence, in short: the code is Apache-2.0. The rule tables are statistics counted from datasets with mixed licences, some of them non-commercial, share-alike, research-only or unknown; their licence is under review. Check DATA_SOURCES.md, installed with the package, before commercial use.

Install

uvx sr-zero 'Check out my channel and subscribe' -q 'Is this comment spam?' --yes-no

To install it, run one of:

uv tool install sr-zero
pip install sr-zero

Then serve the System One API:

sr-zero serve --port 8000

From another terminal, one question over HTTP:

curl -s http://localhost:8000/v1/systemone \
  -H 'Content-Type: application/json' \
  -d '{"state": "Check out my channel and subscribe",
       "questions": {"spam": {"type": "noul", "instructions": "Is this comment spam?"}}}'
{"model":"system-zero","answers":{"spam":{"type":"noul","noul":0.9059390425448562}},"usage":{"input_tokens":10,"output_tokens":0}}

Python 3.9 or newer. The package installs the command sr-zero, also available as system-zero, and the Python package system_zero. The command line reads only the rules a question needs: one question in a fresh process took 0.2 to 0.6 seconds and 31 to 35 MB of memory in our tests. sr-zero serve loads every rule in 1.2 to 1.6 seconds, peaks at 190 to 220 MB, and then answers in about 0.2 ms a question.

For coding agents: point your agent at system-zero.semantic-router.org/llms.txt. It installs System Zero, answers with it, and builds and maintains your own Zero from your labelled data. The same steps as an agent skill: system-zero.semantic-router.org/skill/SKILL.md.

From the command line

Command What it does
sr-zero STATE -q QUESTION -o A B C one choice, with the rule behind it
sr-zero STATE -q QUESTION --yes-no a yes/no probability
sr-zero STATE -q QUESTION --levels LOW MID HIGH a score on ordered levels
sr-zero -j requests.jsonl -e {state, questions} per line in, one answer per line out, with explanations
sr-zero serve --host HOST --port PORT the System One API over HTTP
sr-zero pack COMMAND your own rules in a Zero pack: init, compile, test, explain, unlearn (below)

From Python

With System One's request: a state and named questions.

from system_zero import decide

decide("Our production app has returned 500 errors since the 09:00 deploy. Customers cannot check out.",
       {"team": {"type": "choice", "instructions": "Which team should handle this ticket?",
                 "criteria": {"billing": "Payments, invoices and refunds",
                              "engineering": "Outages, errors and bugs",
                              "sales": "Plans, pricing and contracts"}},
        "urgent": {"type": "noul", "instructions": "Does the user report a problem that blocks them?"}},
       explain=True)

The System One API

sr-zero serve answers the System One API as the published standard, systemone/0.2, and its vllm-sr/5.0 extensions define it, so System One clients work unchanged.

Endpoint Does
POST /v1/systemone one request; a question that cannot be answered fails it with question_failed
POST /v1/systemone/batch named requests in one call, each answered as it would be alone
POST /v1/decisions the native form: a failed question carries its own error in a 200
GET /v1/models, GET /health the model and its card, and readiness
Question You write The answer
choice criteria: 2 to 255 options, each a key and a description choice, confidence and every option's probabilities
noul instructions; optionally criteria.true and criteria.false noul: P(yes)
score criteria: 2 to 10 levels, lowest first score (the expected level), confidence, legend and each level's probabilities

Errors are the standard's. System Zero reads text: box questions and images are refused. Set SYSTEM_ZERO_API_KEYS to require an API key on the /v1/ paths.

Build your own Zero

A Zero pack is your own rules, counted from your labelled examples and served in front of the official rules. Every answer from a pack names the line of the rule that decided it, its record, and how many of its counts came from each of your sources. A CSV needs text and label columns; source keeps the counts by source, so a source can be removed exactly, and group keeps near-duplicates together when the compiler holds questions out. System One JSON lines ({"state", "questions", "expected"}) compile the same way. The example: 600 synthetic support tickets for six teams, written from templates, and 180 dev tickets from templates the training tickets never use.

$ sr-zero pack init support --question 'Which team should handle this ticket?'
created support/: manifest.json, overrides.jsonl (rules you write), tests.jsonl (their examples and your decision tests)
…
$ sr-zero pack compile tickets.csv -o support --licence Apache-2.0
read 600 rows from 1 file(s); skipped 0 without a usable label
  account, billing, returns, sales, shipping, technical (under any question template): 600 training questions, evidence sums and a decision list: 45 rules, 1134 evidence cues
sources (questions, licence class): email 300 (P), web 300 (P)
…
$ sr-zero pack test support --dev dev.csv
…
  accuracy        51.7% (the official rules alone: 20.6%)
…
gate: passed (180 questions the pack answers: pack 51.7%, official alone 20.6%; 56 won, 0 lost, sign test p < 0.0001)
$ sr-zero pack explain support 'I was charged twice for my plan this month'
> billing     0.63  ###############
…
why: the answer the request's words count for most (12 of its cues: "i was", "month", "was charged") (132 of 190 right in training)
     support/rules.jsonl:454 · 353 µs · 0 parameters
     by source: email 64 of 98, web 68 of 92

The gate passes: on the dev tickets, the pack is right where the official rules are wrong 56 times, and never the reverse. A third of the dev tickets get a probability of 0.5 or more, and those are right 88.5% of the time: serve the pack for them, and send the rest to a person or a larger model.

A policy you know is one line of support/overrides.jsonl. The examples it must fire on, or leave alone, and your decision tests go in support/tests.jsonl; the pack refuses to load when an example does not hold.

{"id": "chargebacks", "when": {"any": ["chargeback", "disputed the charge"]}, "answer": "billing", "note": "Payment disputes go to billing, whatever else the ticket says."}
{"rule": "chargebacks", "state": "My bank shows a chargeback from you.", "fires": true}
{"rule": "chargebacks", "state": "I disputed the charge with my card company.", "fires": true}
{"rule": "chargebacks", "state": "Can I charge my phone with the dock?", "fires": false}
{"state": "I was charged twice for my plan this month", "expect": "billing"}
$ sr-zero pack test support --seal
…
overrides: 1 rule(s), 3 example(s), all as they should be
decision tests: 1 of 1 pass
sealed: manifest.json records the hashes of the files that passed
$ sr-zero serve --pack support --port 8000
System Zero 0.9.2: loading the rules ...
packs: support 0.1.0
System Zero is listening on http://127.0.0.1:8000 (POST /v1/systemone)
$ sr-zero pack unlearn support --source email tickets.csv -o support-web
removed 300 rows of email; rebuilt support-web from 300 rows: 1121 rule lines gone, 839 new or changed
its rules.jsonl is the one a compile of the remaining rows gives, byte for byte; manifest.json records the removal

The served pack answers its own question, and the official rules answer every other question as they would without it. unlearn rebuilds the pack from the remaining sources with the recorded settings; overrides and tests come along.

Results

Public-benchmark results of the full 0.9.0 build, the one this package ships, each run with its benchmark's own scorer on one CPU core.

Measure System Zero 0.9.0 For reference
Decision Index, public index (37 benchmarks, chance-corrected) 25.6
Decision Index, public, outside language understanding (28 benchmarks, index points) 23.44
Decision Bench, bench-v4 (1,071 decisions, accuracy) 48.4% chance 28.0%
Held-out test (49,674 questions, accuracy) 57.16%, calibration error 2.2% majority answer 39.6%; uniform 33.8%
Latency, one CPU core, on the Decision Index harness 1.1 ms median, 13.1 ms p95 in one process, about 0.2 ms a question

These are public-index and largely in-distribution numbers: stand-ins and train splits for many of the task formats are in the training data, so private tests may show less.

Limits

  • Language understanding and world knowledge stay with neural models. Words alone do not carry those answers, and System Zero says so with a low probability, so the decision can go up.
  • Under distribution shift, some families of decisions are confidently wrong.
  • Its modules are written for English text, so other languages lean on the counted rules.
  • Most answer keys come from the generator that built the row or from the source dataset; 0.6% were set by models, and for 26.7% (our pooled data) the origin isn't recorded per row.
  • Not for decisions about people or other high-stakes uses without review.

Licence

  • The code is licensed under the Apache License 2.0 (LICENSE).
  • The rule tables are counted from the datasets and data pools listed in DATA_SOURCES.md: 995,023 training questions, 37.6% of them from sources flagged there (non-commercial, share-alike, of unknown licence, or written by a model or a machine). Their answer keys: 41.2% set by the generator program that built the row, 27.2% published with the source dataset, 4.3% source labels on machine-translated or paraphrased text, 26.7% our pooled data whose label origin is not recorded per row, and 0.6% set by models. Their licence is under review; the package metadata names it LicenseRef-System-Zero-Rule-Tables.
  • Check DATA_SOURCES.md before commercial use. It is in the sdist, and NOTICE and DATA_SOURCES.md are installed with the package in its .dist-info/licenses/ directory.

Metadata

Release files for sr-zero 0.9.3

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

Source distribution (sdist)

Source distribution for sr-zero 0.9.3
File Size Uploaded Provenance Actions
sr_zero-0.9.3.tar.gz 2.8 MB Without provenance Details for sr_zero-0.9.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sr-zero 0.9.3
File Interpreter ABI Platform Actions
sr_zero-0.9.3-py3-none-any.whl Python 3 none any Details for sr_zero-0.9.3-py3-none-any.whl

Total release size: 5.7 MB

Release files / sr_zero-0.9.3.tar.gz

Download URL sr_zero-0.9.3.tar.gz
Size 2.8 MB
Tags Source
SHA-256 checksum
How to use checksums
f68a31fdb441f43daa00a187b1741442ae831d796fe63ca55bacc9cb44578859
BLAKE2b-256 checksum
How to use checksums
badf66f795a5c320f07e0f48bba101434ba02d9d9845478b0a82af338a71827d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / sr_zero-0.9.3-py3-none-any.whl

Download URL sr_zero-0.9.3-py3-none-any.whl
Size 2.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e92060531160181ec28a42beb449c3ce03895dc2c9f6c565553026fb5eb1cda3
BLAKE2b-256 checksum
How to use checksums
978fb20d2d410534ef3512e7eb075780a85761cd07caf9d605a9e1887607beeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for sr-zero 0.9.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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