Skip to main content

sb-decision

The SB Decision Model, by Sarathi Balakrishnan. Give it a text and your own list of options, each written as name: when to choose it, and it returns a calibrated probability per option in one pass. Nothing is retrained per use case: the option definitions are the policy. A reserved ask option is trained to win when the deciding fact is missing from the text, so irreversible actions go to a person instead of being guessed.

Not an LLM. It never generates text. It is the router, guardrail, or triage layer in front of one.

Install

pip install sb-decision

Use

from sb_decision import SBDecision

m = SBDecision.load()  # sarathi-balakrishnan/browser-decision-model-base
m.decide(
    "Package arrived broken, second time this month. I want a manager.",
    [
        "refund: customer wants money back for a damaged, wrong, or missing item",
        "replace: customer wants the product again",
        "escalate: angry, threatens to leave, or asks for a manager",
    ],
)
# {'decision': 'escalate', 'band': 'auto', 'scores': {'escalate': 0.90, 'ask': 0.09, 'refund': 0.01, 'replace': 0.01}}

band is auto when the top score is at or above auto=0.7, review at or above review=0.4, otherwise abstain. If ask wins it is always abstain. Both thresholds are arguments; they are statements about the error rate you accept, not model constants.

Independent tags, when several options can apply at once:

m.decide(
    "Headache since morning and now my chest feels tight.",
    ["headache: pain in the head", "chest pain: pressure or tightness in the chest", "rash: skin redness or itching"],
    mode="multi",
)
# {'decision': 'chest pain', 'band': 'auto', 'tags': ['headache', 'chest pain'],
#  'scores': {'chest pain': 0.76, 'headache': 0.61, 'ask': 0.14, 'rash': 0.0}}

Many texts at once: m.scores_many(texts, options). Command line:

sb-decision "It doesn't work on my machine." -o "crash: the app exits or hangs" -o "slow: works but takes too long" -o "question: asks how to do something"

Access

The package is public; the weights are in private preview. SBDecision.load() raises SBAccessError with contact details if your Hugging Face token does not have access. To try it on your own option set, contact Sarathi Balakrishnan at https://huggingface.co/sarathi-balakrishnan .

Writing options

  • One line per option, saying when to choose it, with the boundary to its neighbours explicit.
  • Describe what the text says, not what you will do about it. "chest pressure with sweating or arm tingling" scores; "tell the caller to call 911" does not.
  • Keep ask in the list whenever the action is irreversible.
  • Up to 12 options, 1,024 tokens, English. It decides from the text, not the world: no lookups, no arithmetic.

Results

Measured on 4,745 messages from five domains never seen in training or validation.

model params held-out top-1 vs teacher ask recall false ask calibration error (ECE)
base 151M 0.765 0.752 0.024 0.030
large 399M 0.796 0.822 0.021 0.072

The teacher's own self-agreement on the same messages is 0.883.

License

Apache-2.0. See NOTICE.

Metadata

Release files for sb-decision 0.2.0

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

Source distribution (sdist)

Source distribution for sb-decision 0.2.0
File Size Uploaded Provenance
sb_decision-0.2.0.tar.gz 15.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sb-decision 0.2.0
File Interpreter ABI Platform
sb_decision-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.7 kB

Release files / sb_decision-0.2.0.tar.gz

Download URL sb_decision-0.2.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2b5316a8948ea3b143a7b07a00c4b04bd56a8edf66df6c517d5e5f275aeb95cb
BLAKE2b-256 checksum
How to use checksums
3833d9373400fee00e6bad7bc87846aa0dcc78e4cc9b931be6bceefa5ccaa406
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.4

Release files / sb_decision-0.2.0-py3-none-any.whl

Download URL sb_decision-0.2.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70d8ec03b2a8f791ae08e5ae2aa97b65ffa7c6f7f80ebedb1443aacac5af5100
BLAKE2b-256 checksum
How to use checksums
7e86b7c9f7a305cbcfb9845526a866c6562d8acc0f72b4557573fc14d6449f42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.4

Security for sb-decision 0.2.0

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