Skip to main content

TurboJev

Typed decisions from local open-weight models

Turn text, structured state, images, audio, or video into a typed decision with auditable probabilities.

Website and docs · Samples · Documentation · Multimodal input · Order robustness

License Rust Local inference GitHub Actions

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") as jev:
    result = jev.evaluate({
        "state": {"message": "My package arrived broken."},
        "questions": {"department": {"type": "choice", "instructions": "Which department should handle this?", "criteria": {"billing": "Payments", "shipping": "Delivery", "technical": "Product issue", "other": "Other"}}},
    })["answers"]["department"]

print(result["choice"])
print(result["probabilities"])

Native runtimes use CPU by default. To request GPU offload, set device="gpu" in Python or device: "gpu" in Node/.NET load options. The Windows x64 native package includes Vulkan support; x86 and ARM64 are CPU-only. A GPU request fails with the runtime error if no supported GPU backend or device is available.

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 choice questions in 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:

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

License

TurboJev is available under the Apache License 2.0, which permits commercial use and redistribution subject to its terms.

Metadata

Release files for turbojev 0.29.0

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

Built distributions (wheels)

Table of built distributions (wheels) for turbojev 0.29.0
File Interpreter ABI Platform Actions
turbojev-0.29.0-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details for turbojev-0.29.0-cp39-abi3-win_arm64.whl
turbojev-0.29.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for turbojev-0.29.0-cp39-abi3-win_amd64.whl
turbojev-0.29.0-cp39-abi3-win32.whl CPython 3.9 abi3 Windows x86-32 Details for turbojev-0.29.0-cp39-abi3-win32.whl

Total release size: 19.8 MB

Release files / turbojev-0.29.0-cp39-abi3-win_arm64.whl

Download URL turbojev-0.29.0-cp39-abi3-win_arm64.whl
Size 2.3 MB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
771c6688db6f1a1f9cbf34a52b5bcaa365217106547b12afca8c31e6b9328382
BLAKE2b-256 checksum
How to use checksums
5f438b88763a1ef9adb45d5a2f327bcd1c640492c30c096bbad9426accd7e6b1
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.29.0-cp39-abi3-win_amd64.whl

Download URL turbojev-0.29.0-cp39-abi3-win_amd64.whl
Size 15.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
138a79803bd7923f6cd49b11b45e9be279baba38646fedcec1138c37e80c58e4
BLAKE2b-256 checksum
How to use checksums
b1e2a2cd2e8591b3a5a0f2c65e12374b105491460b0961dc0b83adc7ff6d1da2
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.29.0-cp39-abi3-win32.whl

Download URL turbojev-0.29.0-cp39-abi3-win32.whl
Size 2.1 MB
Tags CPython 3.9 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
a944c9d1394219cac5813a07dffaebd46669802b8522f86339f05e42874fcbe0
BLAKE2b-256 checksum
How to use checksums
47add24b41a85cc853691d7ea5f8ada7a6dbf960a8f6b69c71084b97d788976f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Security for turbojev 0.29.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