Skip to main content

s1kit

Test, calibrate and route System One decision models on your own data.

繁體中文說明

Decision models (Jev, Laya, kev, and anything served by llama.cpp or Ollama) all speak the same /v1/systemone API and return typed answers with a confidence. s1kit answers the three questions you hit on day one:

  1. Which model is most accurate on my data? s1kit test runs one suite against every model side by side.
  2. What confidence can I trust? s1kit calibrate picks a cutoff per question that reaches your target precision.
  3. What happens below that cutoff? s1kit.Router asks the cheapest model first and escalates only when it is unsure.
$ s1kit test examples/support-tickets.yaml
provider         question            n  accuracy errors   p50 ms   p95 ms
-------------------------------------------------------------------------
keyword          mood                8     50.0%      0      0.1      0.1
keyword          team               10    100.0%      0      0.1      0.1
keyword          urgent              5     80.0%      0      0.1      0.1

$ s1kit calibrate results.jsonl --target 0.95
keyword/mood: confidence >= 0.5761 -> 100.0% precise, answers 25% of cases
keyword/team: confidence >= 0.3333 -> 100.0% precise, answers 100% of cases
keyword/urgent: confidence >= 0.7143 -> 100.0% precise, answers 40% of cases

Read it as: trust the baseline on team, but send three quarters of mood questions to a stronger model.

The example runs offline: keyword is a built-in word-overlap baseline that needs no API key. Uncomment a real model in the suite to see how far it beats the baseline.

Status: alpha (0.1.0). The API may change before 1.0.

Install

pip install s1kit

To work on s1kit itself, clone the repo and run pip install -e ".[dev]".

Write a suite

providers:
  - type: keyword                      # offline baseline
  - name: laya
    base_url: http://localhost:8080    # any /v1/systemone server
    model: laya
  - name: jev
    base_url: https://api.typesafe.ai
    model: jev-latest
    api_key_env: TYPESAFE_API_KEY

questions:
  team:
    type: choice
    instructions: Which team should handle this ticket?
    criteria:
      billing: Charges, invoices, payment methods
      tech: Login problems, bugs, errors

cases:
  - state: "I was charged twice for my order"
    expect: {team: billing}

choice expects an option name, score a level index or label, noul true/false.

Route in production

import yaml
from s1kit import Router
from s1kit.providers import HttpProvider

thresholds = yaml.safe_load(open("thresholds.yaml"))
router = Router(
    [HttpProvider("laya", "http://localhost:8080", "laya"),
     HttpProvider("jev", "https://api.typesafe.ai", "jev-latest", "TYPESAFE_API_KEY")],
    thresholds,
)
result = router.decide(ticket_text, questions)
result.answers, result.provider, result.escalations

The last provider always answers, so put your most capable model at the end.

Commands

Command What it does
s1kit test SUITE [--only NAME] [--fail-under 0.9] Run the suite, save every decision to results.jsonl, print a comparison
s1kit report RESULTS Print the comparison again from a results file
s1kit calibrate RESULTS [--target 0.95] Write thresholds.yaml with one cutoff per provider and question

Roadmap

  • 0.2: response cache, JSONL decision log for the router
  • 0.3: GitHub Action, pytest plugin, TypeScript package, LangChain and n8n integrations
  • 1.0: public dataset packs, stable API

Contributing

New provider configs, integrations, report formats and datasets are all welcome, and most fit in one evening. See CONTRIBUTING.md.

License

MIT

Metadata

Release files for s1kit 0.1.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 s1kit 0.1.0
File Size Uploaded Provenance Actions
s1kit-0.1.0.tar.gz 13.4 kB With provenance Details for s1kit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for s1kit 0.1.0
File Interpreter ABI Platform Actions
s1kit-0.1.0-py3-none-any.whl Python 3 none any Details for s1kit-0.1.0-py3-none-any.whl

Total release size: 25.2 kB

Release files / s1kit-0.1.0.tar.gz

Download URL s1kit-0.1.0.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
45212838195839babdda89fa096d75c751415a94ba6ebf93c804f5bbef1fadbf
BLAKE2b-256 checksum
How to use checksums
8d12ce498397a145a2d0b8e165214f50f6461f654a6a5938db7e0ded9e0c407f
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 Oct 28, 2026.

Transparency log

Release files / s1kit-0.1.0-py3-none-any.whl

Download URL s1kit-0.1.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00433e98d177794b9db61083a96deb1615e93c6d2eaef27814fc50559eb925f4
BLAKE2b-256 checksum
How to use checksums
31f3b6987ae824d854b25098252c9a423cb0fe75add715c2155e66769ebd744b
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 Oct 28, 2026.

Transparency log

Security for s1kit 0.1.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for s1kit-0.1.0.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 28, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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