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", 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:

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.

Release files for turbojev 0.28.4

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.28.4
File Interpreter ABI Platform
turbojev-0.28.4-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
turbojev-0.28.4-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
turbojev-0.28.4-cp39-abi3-win32.whl CPython 3.9 abi3 Windows x86-32 Details

Total release size: 1.6 MB

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

Download URL turbojev-0.28.4-cp39-abi3-win_arm64.whl
Size 518.7 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
592b1e34a67b6bf0926e103b009f3488235b9ba335e61c88da8ef34130bc0b5a
BLAKE2b-256 checksum
How to use checksums
a1fe92d07da793500265fe51a2f83ea24c87afe83ae167629bf3bb0c814be4fd
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.4-cp39-abi3-win_amd64.whl

Download URL turbojev-0.28.4-cp39-abi3-win_amd64.whl
Size 538.7 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ee1f75fae05b757ca568c9572274bc0fa7e673d91f2b7718692b46fbbb421926
BLAKE2b-256 checksum
How to use checksums
b6e885887253b651ed31c187a10f3cd38fa485181c19531f5f6c51673d46fab5
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.4-cp39-abi3-win32.whl

Download URL turbojev-0.28.4-cp39-abi3-win32.whl
Size 500.3 kB
Tags CPython 3.9 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
cff323901e723c0e7a2c75d3fe073e1ff396f949844788bb58d8c2b21497ea72
BLAKE2b-256 checksum
How to use checksums
f933918153e367ef676e87bcfa660b9473446c5b5af9273fe961cf7f8539c6d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release history Release notifications | RSS feed

0.28.5

3 release files

This release

0.28.4 This release

3 release files

0.28.3

3 release files

0.28.2

3 release files

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