TurboJev
Typed decisions from local open-weight models
Turn text, structured state, images, audio, or video into a typed decision with auditable probabilities.
Samples · Documentation · Multimodal input · Order robustness
state + typed questions → candidate scores → probabilities → typed answers
TurboJev is a Rust-first decision layer for applications that need a model to
choose, route, assess, or approve. It scores the allowed candidates directly
and returns structured choice, noul, and score answers. The optimized
path does not ask a model to generate JSON and does not rely on parsing a
natural-language reply.
It runs locally with open-weight models, keeps inference and decision semantics separate, and exposes the same contract through Rust, Node/TypeScript, Python, C, .NET, and browser/WASM hosts.
Get a real model running
The fastest path is one of the runnable samples. It builds the native libraries, downloads a small verified GGUF model, then runs the same local model through four language bindings.
py samples/build.py native --download-model
py samples/run.py ts
py samples/run.py python
py samples/run.py csharp
py samples/run.py rust
On Linux or macOS, use python in place of py. See the complete
samples guide, including architecture selection and the
browser-only JavaScript example.
Ask a typed question
from turbojev import TurboJev
with TurboJev.load("./model.gguf", n_gpu_layers=0) as jev:
result = jev.classify(
"My package arrived broken.",
["billing", "shipping", "technical", "other"],
)
print(result["choice"])
print(result["probabilities"])
Use evaluate when one state needs several typed decisions at once:
{
"state": {"message": "My package arrived broken.", "customerTier": "plus"},
"questions": {
"route": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments, invoices, or refunds",
"shipping": "Delivery, damage, or replacement",
"technical": "Product or application problem"
}
},
"urgent": {
"type": "noul",
"instructions": "Does this need urgent human intervention?"
},
"resolution": {
"type": "score",
"instructions": "How complete is the proposed resolution?",
"criteria": ["Not started", "Partly resolved", "Resolved"]
}
}
}
The response preserves each question's type, candidate distribution, selected answer, zero-generation usage, execution path, and calibration provenance.
Why TurboJev
| Need | TurboJev approach |
|---|---|
| Route a request | choice returns a stable named option and its full distribution. |
| Gate an action | noul represents a typed yes/no decision without string parsing. |
| Evaluate a state | score returns an ordered, expected-value assessment. |
| Avoid output parsing | Backends score candidates; TurboJev owns validation and response construction. |
| Keep data local | Local inference is supported with no mandatory telemetry or service. |
| Use one contract everywhere | Native bindings and browser/WASM share the same decision schema. |
| Bring a new model | Implement a small scoring adapter instead of rewriting decision logic. |
Stable option ordering when order is irrelevant
Many models favor the first or last presented option. For unordered choice
questions, enable cyclic order robustness:
{
"model": "./model.gguf",
"execution": { "orderRobustness": "cyclic" }
}
TurboJev evaluates each cyclic option order, maps scores back to the original
keys, averages the raw logits, and then calibrates the result. The response
records both the active policy and the actual number of model evaluations.
The feature applies to classify as well as evaluate; it deliberately leaves
ordered scores and boolean decisions unchanged. Read the full contract and
cost model.
Calibrated confidence is explicit
A softmax distribution is useful for ranking but is not automatically a calibrated probability. TurboJev keeps calibration separate from inference and records whether a fitted calibration profile was used. This lets applications set thresholds based on evidence instead of treating every high model score as a guarantee. See calibration tooling.
Text and multimodal models
Text models can use the built-in llama.cpp/GGUF route or a custom runtime adapter. For models that accept media, TurboJev carries a model-independent envelope for text, image, audio, and video evidence. The selected runtime owns the processor and candidate scoring; TurboJev still validates the input and produces the same typed response.
The repository includes local CPU examples for:
- SmolVLM2 image and short-video decisions.
- LFM2.5-Audio spoken-intent decisions.
The generic protocol does not claim that every GGUF, ONNX, or safetensors model is multimodal. Runtime support is declared by the adapter and documented in multimodal compatibility.
Pick your host
| Host | Starting point | Runtime path |
|---|---|---|
| Rust | Rust sample | Rust crates + llama.cpp |
| Node / TypeScript | Node sample | Node-API + llama.cpp |
| Python | Python sample | PyO3 + llama.cpp or worker |
| C / .NET | C# sample | Stable C ABI + P/Invoke |
| Browser | Vanilla JS sample | Rust/WASM + Transformers.js |
| Custom model runtime | Adapter contract | Candidate-scoring backend |
Built for evidence, not opaque claims
The Windows validation run used a real small GGUF model with complete response parity across Node/TypeScript, Python, C, and .NET, including typed answers and the zero-generation invariant. The multimodal SmolVLM2 CPU sample also has a recorded real image/video validation run. Reproduce the commands and inspect the limits in Windows validation and multimodal validation.
TurboJev keeps an independent reference path and treats runtime optimizations as capabilities that require parity evidence. It does not advertise cross-request fusion merely because a runtime can batch tokens.
Design commitments
- Portable core: semantic logic has no operating-system, filesystem, network, hardware, tokenizer, or model dependency.
- Truthful runtime boundaries: adapters use the real model template and tokenizer; they never invent candidate token IDs.
- Local by default: no mandatory hosted service and no mandatory telemetry.
- Typed output: model backends return scores; TurboJev validates, normalizes, calibrates, and builds one canonical response.
- Open integration: custom runtimes and model families plug into the scoring contract without forking the decision engine.
Documentation
- Architecture
- Samples and build commands
- Multimodal input contract
- Candidate-order robustness
- Calibration tooling
- Runtime qualification
- Testing and validation
- Release and package publishing
License
TurboJev is available under the Apache License 2.0, which permits commercial use and redistribution subject to its terms.
Release files for turbojev 0.28.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| turbojev-0.28.2-cp39-abi3-win_arm64.whl | CPython 3.9 | abi3 | Windows ARM64 | Details |
| turbojev-0.28.2-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| turbojev-0.28.2-cp39-abi3-win32.whl | CPython 3.9 | abi3 | Windows x86-32 | Details |
Total release size: 1.6 MB
Release files / turbojev-0.28.2-cp39-abi3-win_arm64.whl
| Download URL | turbojev-0.28.2-cp39-abi3-win_arm64.whl |
|---|---|
| Size | 521.1 kB |
| Tags | CPython 3.9 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
996d912f678b73fb9a126b5e2fb3bf5bc1fc2a56b2ced5487de4b508b9ade3d3
|
|
BLAKE2b-256 checksum How to use checksums |
f7475e4f3aa5dc5f674c269b492bb7e7f39ed3729762ed7f5ff3e238dbf26b46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Release files / turbojev-0.28.2-cp39-abi3-win_amd64.whl
| Download URL | turbojev-0.28.2-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 538.9 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
4f175235f3b799bddfdfdb65fc366ea803ebb0b924cd81d3c29843ff8ef6af70
|
|
BLAKE2b-256 checksum How to use checksums |
ec5aa37a11c72d7772c6e4cac6bda391fbf744027491975ca83e3ee04670f86d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Release files / turbojev-0.28.2-cp39-abi3-win32.whl
| Download URL | turbojev-0.28.2-cp39-abi3-win32.whl |
|---|---|
| Size | 499.1 kB |
| Tags | CPython 3.9 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
f05cc5047d33e27a24101c7005ff4cf9d9b97e6ad0c99f88e47437da735bdaa3
|
|
BLAKE2b-256 checksum How to use checksums |
27bd4db9edfceb73dc7800afbe6bd27ca87f735ce95e261a66c7ef19313c9b85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|