krite
The Krite decision runtime in process: Protocol v1 answers from Python, with the same runtime, the same bytes, and the same errors as krite serve, and no server.
pip install krite
hf download skyoo2003/krite-0.15b-v1 --local-dir krite-0.15b-v1
import krite
k = krite.Krite("krite-0.15b-v1")
r = k.decide(
{
"state": [
{"from": "customer", "text": "Hi, I was charged twice for my March subscription."},
{"from": "agent", "text": "Sorry about that. Can you share the invoice number?"},
],
"questions": {
"route": {"type": "choice", "criteria": {"billing": None, "technical": None, "other": None}},
"refund_requested": {"type": "noul"},
},
}
)
print(r["answers"]["route"]["choice"], r["answers"]["refund_requested"]["noul"])
decide accepts a dict, a JSON string, or JSON bytes and returns the response as a dict. The model alias jev-latest resolves to the loaded model, as on the server.
| Error | status |
type |
|---|---|---|
| Malformed JSON, schema violation, body over 4 MiB | 422 | invalid_request |
Model other than the loaded one or jev-latest |
422 | unknown_model |
| Over a server limit | 422 | state_too_long, too_many_questions, too_many_options |
| Runtime failure | 500 | internal_error |
Errors raise krite.KriteError with status, type, message, and param. A missing or broken model directory raises RuntimeError when Krite is constructed.
device="auto" uses Metal on Apple silicon and the CPU elsewhere; device="cpu" forces the CPU. Calls run one at a time on one Krite and release the GIL, so threads may share it. See docs/runtime.md.
Metadata
Release files for krite 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| krite-0.1.0.tar.gz | 58.0 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| krite-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| krite-0.1.0-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 5.6 MB
Release files / krite-0.1.0.tar.gz
| Download URL | krite-0.1.0.tar.gz |
|---|---|
| Size | 58.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
952f2cd739521224891f04a2344bcb1d8b887381ef05cf9a506c8eff144e3346
|
|
BLAKE2b-256 checksum How to use checksums |
7ee1d9968340b0e26ad5a3c644d080767a932bdfa23b1abcfa5f4cae1260a311
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / krite-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl
| Download URL | krite-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
4562f0abb4875ee9476226dc32d40af95867e75b7e9a2af4aa99c82e03600b8b
|
|
BLAKE2b-256 checksum How to use checksums |
519cf750e1dcdab4d3acb2b75d25f8008f362926b45be2782b7de768caee29e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / krite-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | krite-0.1.0-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fc317aebd8a04dc6fe926aa01a3eb9463053e56edc484234fdbc86282e1fe716
|
|
BLAKE2b-256 checksum How to use checksums |
ec33a9979dff551b4415529ce65662b9440d8621b4cab27a2a63f1a8d70ba644
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|