Skip to main content

TurboJev

Typed decisions and structured generation with local open-weight models.

Turn context and questions into decisions, probabilities and structured data.
Built in Rust, with Python, JavaScript, TypeScript, C#, C and browser bindings,
plus source integrations for Android and Swift.

Native packages for Windows · Linux · macOS
Windows / Linux: x86 · x64 · ARM64 · macOS: Intel · Apple Silicon
Portable Rust core · Browser WebAssembly · CPU and supported GPU runtimes

Python package on PyPI JavaScript and TypeScript packages on npm .NET package on NuGet Rust package on crates.io

Browser and WebAssembly packages Runnable demos using published packages Reproducible evaluation tools License: Apache 2.0

Quick start · SDK guide · Cookbook · Samples · Demos


TurboJev turns context and questions into typed answers. Use it to route support tickets, assess urgency, extract invoice fields, or build workflows where one answer determines the next question. It runs compatible models locally through llama.cpp or a browser runtime, with no mandatory hosted service or telemetry.

Bindings share the Rust engine's validation, schemas and response contracts. Choose your language and runtime while keeping the same decision semantics.

Capability Use it for
Typed decisions Select an allowed answer, assess a boolean condition or score ordered criteria.
Structured generation Extract text, numbers, nullable values, objects and bounded arrays.
Workflows Run dependent questions and include fields only when their conditions hold.
Probability controls Inspect distributions, sample answers and configure option-order averaging.
Multimodal input Evaluate images, audio and timestamped video frames with a compatible runtime and model.

Install

Language Registry Install
Python PyPI python -m pip install --upgrade turbojev
Node.js / TypeScript npm npm install @turbojev/node
C# / .NET NuGet dotnet add package TurboJev
Rust crates.io cargo add turbojev
Browser npm / CDN npm install @turbojev/web @turbojev/wasm @turbojev/runtime-llamacpp-wasm

Native packages include the model runtime and its library dependencies:

Platform Architectures Requirement
Windows x86, x64, ARM64 Matching process architecture
Linux x86, x64, ARM64 glibc 2.28+; Alpine/musl needs a source build
macOS x64, ARM64 macOS 11+; Intel or Apple Silicon

Python and npm select the native package for the running interpreter. NuGet contains all eight runtime directories. Browser WebAssembly is architecture independent. Android and iOS integrations are available as source.

The Rust core does not load models on its own. Add turbojev-runtime-llamacpp with its ffi feature and provide the matching native shim for GGUF inference. C links the C ABI library; Android and Swift need native libraries built for their targets. The self-contained SDK guide includes installation and examples for every binding, including browser CDN use.

The NuGet package includes .NET Standard 2.0, .NET Framework 4.8 and .NET 8 assemblies, supporting .NET Core 3.1, .NET 5–7 and newer .NET versions. See .NET compatibility for installation and validation details. See the binding compatibility matrix for runtime requirements, architecture coverage and the status of mobile/Apple bindings.

Quick start

Download a compatible text GGUF to model.gguf, then ask a bounded question:

from turbojev import TurboJev

with TurboJev.load("model.gguf", device="cpu") as client:
    response = client.generate(
        context="My package arrived broken. Please send a replacement.",
        questions={
            "team": {
                "type": "string",
                "instructions": "Which team should handle this request?",
                "choices": [
                    {"value": "shipping", "description": "Delivery damage or replacement"},
                    {"value": "billing", "description": "Payments, charges or refunds"},
                    {"value": "technical", "description": "Software bugs or outages"},
                ],
                "return_probabilities": True,
                "permutations": 1,
            },
            "urgent": {
                "type": "boolean",
                "instructions": "Does this require a reply within the hour?",
            },
        },
    )

print(response["result"]["team"]["value"])
print(response["result"]["team"]["distribution"])
print(response["result"]["urgent"])
print(response["usage"])

Finite fields score permitted answers. Open text and numeric fields generate bounded values. The SDK validates output types; the model remains responsible for the answer's meaning. Invalid or unsupported outputs raise errors.

Output types

Output Field definition Returned value
Text {"type": "string"} String
Integer {"type": "integer"} Integer
Number {"type": "number"} Number
Boolean {"type": "boolean"} Boolean
Nullable value {"type": ["string", "null"]} Value or actual null
Enum {"type": "string", "enum": ["meal", "travel"]} One permitted value
Described choice {"type": "string", "choices": [{"value": "billing", "description": "Payments"}, ...]} One permitted value
Ordered score {"type": "number", "levels": [{"label": "low"}, {"label": "high"}]} Probability-weighted zero-based index
Object {"type": "object", "properties": {...}} Object
Array {"type": "array", "items": {...}, "maxItems": 10} Bounded array

Numeric enums are unordered choices. Ordered levels preserve the original scale and can return fractional scores. Schemas support nested objects and top-level arrays of scalars or objects; arrays inside objects and nested arrays are not supported. This is a defined JSON Schema subset.

Use questions for a field map or schema for an object schema, never both. See typed fields for the complete contract.

Dependencies and conditional fields

Declare depends_on when a field needs previous answers. Use when to omit a field unless its condition holds:

with TurboJev.load("model.gguf") as client:
    response = client.generate(
        context="Payments are failing after this morning's deployment.",
        questions={
            "category": {
                "type": "string",
                "enum": ["incident", "billing", "feature_request"],
                "instructions": "What kind of request is this?",
            },
            "severity": {
                "type": "string",
                "enum": ["low", "medium", "high"],
                "instructions": "Assess the incident severity.",
                "when": {"category": "incident"},
            },
            "page_on_call": {
                "type": "boolean",
                "instructions": "Should the on-call engineer be paged?",
                "depends_on": ["severity"],
            },
        },
    )

print(response["result"])
print(response["skipped"])

Conditions support equality, membership, numeric comparisons and confidence bounds. Skipped fields are absent from result and listed in skipped; they are distinct from an actual null answer. Dependencies are validated for unknown fields and cycles. Fields currently execute serially in dependency order.

Probabilities and option ordering

return_probabilities adds the selected value, its probability, a confidence statistic and the full typed distribution. These are conditional scores over the supplied answers, not automatically calibrated confidence.

permutations controls extra model evaluations for unordered fields:

  • 1: one pass in the supplied order.
  • "auto": canonical balanced layouts; K passes for even K, 2K for odd K.
  • A positive integer: that many distinct sampled layouts, capped by the number available.
  • "all": every layout, subject to a 720-evaluation limit.

Small unordered probability fields default to automatic averaging. Large enums and ordinal levels default to one pass. Averaging costs real inference time and does not guarantee a correct answer. Ordered scores keep their scale order.

from turbojev import Dice

with TurboJev.load("model.gguf") as client:
    response = client.generate(
        context="A single roll of a fair six-sided die.",
        questions={"roll": Dice(permutations=1).to_schema()},
        temperature=1,
        seed=42,
    )

print(response["result"]["roll"])

Positive temperature enables sampling; the default selects the most likely answer. Dice uses the model's distribution and does not force fairness. See order robustness and calibration.

Thinking

Thinking is off by default. Native text GGUF inference can generate reasoning before a field's answer using thinking=True, thinking_budget, or thinking_effort (none, low, medium, high). Set thinking="auto" to let the model select effort as an additional decision. Fields can override the request policy.

Reasoning adds tokens and latency. It requires a compatible model and enough context; unfinished reasoning raises an error. Built-in browser runtimes and native multimodal reasoning currently report unsupported mode errors. Actual reasoning and selected effort appear in thinking and thinking_effort.

Images, audio and video

Use a compatible multimodal model and its matching projector. For GGUF image extraction:

from pathlib import Path

with TurboJev.load(
    "vision.gguf",
    mmproj="mmproj.gguf",
    device="cpu",
    n_ctx=8192,
) as client:
    response = client.generate(
        context="Read the attached receipt.",
        images=[Path("receipt.png")],
        questions={
            "merchant": {"type": "string", "instructions": "Extract the merchant name."},
            "total": {"type": "number", "instructions": "Extract the printed total."},
        },
    )

print(response["result"])

Python accepts image paths, bytes, base64/data URIs and PIL-like images. Other bindings use the same base64 JSON contract; browser helpers encode Files/Blobs. Audio uses an audio-capable checkpoint and projector. Video evidence is an ordered sequence of timestamped image frames, decoded by the application. TurboJev does not require external ffmpeg/ffprobe executables.

The current OCR demos use Qwen3.5-2B with its vision projector. Text demos use QJev3.5-0.8B v19c Q8_0; that decision-trained checkpoint is not the OCR model or a general extraction/reasoning recommendation. See multimodal input and measured validation.

Direct typed decisions

evaluate provides the original Jev-style choice, noul and ordered score contracts over one state:

with TurboJev.load("model.gguf") as client:
    response = client.evaluate({
        "state": "Everything is down and our client demo starts at noon.",
        "questions": {
            "team": {
                "type": "choice",
                "instructions": "Which team should handle it?",
                "criteria": {
                    "outage": "Service unavailable",
                    "billing": "Charges and refunds",
                    "feature": "Requests and how-to",
                },
            },
            "urgent": {
                "type": "noul",
                "instructions": "Does this require a reply within the hour?",
            },
            "tone": {
                "type": "score",
                "instructions": "How upset is the customer?",
                "criteria": ["calm", "annoyed", "furious"],
            },
        },
    })

print(response["answers"])

Direct scoring generates no answer tokens unless reasoning is enabled. Its load-time orderRobustness policy is separate from generate.permutations; none is the single-pass default. Compatibility profiles translate supported TypeSafe-style and AI SDK wire formats without substituting their models.

Models and execution

Native GGUF inference uses the bundled llama.cpp runtime. A text checkpoint must have an architecture, tokenizer and prompt template supported by that build. Loading a GGUF does not reproduce a specialized model's custom head, scorer or training prompt automatically.

CPU is the default. Explicit GPU selection reports an error if the requested backend/device is unavailable. Windows x64 includes Vulkan and macOS includes Metal. Windows x86/ARM64 and Linux packages use CPU inference. Browser applications can choose GGUF through llama.cpp/WASM or supported ONNX through Transformers.js, with explicit WebGPU selection where supported.

Keep models loaded for repeated requests. Prefix reuse and other optimizations depend on runtime capabilities and numerical qualification; structured generation does not promise parallel field execution. Timeouts and cancellation are cooperative between model operations. Failed generation retains known usage.

Documentation and examples

  • Complete SDK skill: installation, APIs, configuration and examples for every language, all in one file.
  • Cookbook: routing, extraction, dependencies and continuation.
  • Samples: applications built from this repository.
  • Standalone demos: applications using published packages and CDN assets.
  • Decision design: prompts, option descriptions and honest model-controlled decisions.
  • Architecture: portable Rust core, runtimes and bindings.
  • Evaluations: reproducible task sets and real-model runs.
  • Testing: contracts, fixtures and validation limits.

Published assets and actual inference are different checks. See the native release matrix for build commands, package contents and execution evidence. Cross-compilation is not a hardware execution test, and a package release does not establish accuracy for every model.

License

Apache License 2.0.

Metadata

Release files for turbojev 0.34.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.34.0
File Actions
turbojev-0.34.0-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details for turbojev-0.34.0-cp39-abi3-win_arm64.whl
turbojev-0.34.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for turbojev-0.34.0-cp39-abi3-win_amd64.whl
turbojev-0.34.0-cp39-abi3-win32.whl CPython 3.9 abi3 Windows x86-32 Details for turbojev-0.34.0-cp39-abi3-win32.whl
turbojev-0.34.0-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details for turbojev-0.34.0-cp39-abi3-manylinux_2_28_x86_64.whl
turbojev-0.34.0-cp39-abi3-manylinux_2_28_i686.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-32 Details for turbojev-0.34.0-cp39-abi3-manylinux_2_28_i686.whl
turbojev-0.34.0-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details for turbojev-0.34.0-cp39-abi3-manylinux_2_28_aarch64.whl
turbojev-0.34.0-cp39-abi3-macosx_11_0_x86_64.whl CPython 3.9 abi3 macOS 11.0+ x86-64 Details for turbojev-0.34.0-cp39-abi3-macosx_11_0_x86_64.whl
turbojev-0.34.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for turbojev-0.34.0-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 113.8 MB

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

Download URL turbojev-0.34.0-cp39-abi3-win_arm64.whl
Size 4.7 MB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
4e8a06bc2f3b29382ccb46303cc2dd9b08564942ae83fcf6a15c65bd5d83ab08
BLAKE2b-256 checksum
How to use checksums
8fb28a66d69ea569f4c3a8374b9fcb5eea94f7832f382f8f6427b571c0059cc1
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.34.0-cp39-abi3-win_amd64.whl

Download URL turbojev-0.34.0-cp39-abi3-win_amd64.whl
Size 17.5 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ab36edc9c5aab7951ffcff5ec6b5d6488a93cfd072ab24a2afdb6c220188e0ab
BLAKE2b-256 checksum
How to use checksums
aac74c26563f35723a1cdf40da8533dd5dccce70895724670008ff0dd0476ffa
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.34.0-cp39-abi3-win32.whl

Download URL turbojev-0.34.0-cp39-abi3-win32.whl
Size 4.1 MB
Tags CPython 3.9 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
847441f67952fb2019f67d722f4ba8da82171669cf0ce3040ed60ce8463929d5
BLAKE2b-256 checksum
How to use checksums
ee04968702a3f2c7976a9498b554898efa34ca692f8b82802201ac5d2b73ab74
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.34.0-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL turbojev-0.34.0-cp39-abi3-manylinux_2_28_x86_64.whl
Size 19.0 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
cc66cce71bd364d0361a8dd68f983a2db57a2f329565e3781b45bdfe3b015192
BLAKE2b-256 checksum
How to use checksums
574255befb7b7e14d7eb9252c17e53b8e8a99d29efacd5ddf67ee7bd5eaff11c
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.34.0-cp39-abi3-manylinux_2_28_i686.whl

Download URL turbojev-0.34.0-cp39-abi3-manylinux_2_28_i686.whl
Size 20.5 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-32 abi3
SHA-256 checksum
How to use checksums
d565e25ae012cd89c4e0cb146af427d18be28536555dc222c7cae4dfd451eb01
BLAKE2b-256 checksum
How to use checksums
7fca41e7cd796e0ad88e25ddf3c2617839b84f5084a4165bc76aa10298d57589
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.34.0-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL turbojev-0.34.0-cp39-abi3-manylinux_2_28_aarch64.whl
Size 17.5 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
be3dbd19b6660cc0025899a5a2e3db2e71cd688def95b518064ece3084b1952b
BLAKE2b-256 checksum
How to use checksums
ae64d23f832b9af10d330f329ca7a857cf401f15d93891143ce38d864e498fc9
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.34.0-cp39-abi3-macosx_11_0_x86_64.whl

Download URL turbojev-0.34.0-cp39-abi3-macosx_11_0_x86_64.whl
Size 15.5 MB
Tags CPython 3.9 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
11fae3b0a94c1eb87a9eef64748fb09b0199e0c6c8a8bfa81d69408976587914
BLAKE2b-256 checksum
How to use checksums
47e95df56c23ca638ead0488595021a176863de86cc46314ccb5621df067189e
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.34.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL turbojev-0.34.0-cp39-abi3-macosx_11_0_arm64.whl
Size 14.9 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5f79b92cee6d828dafa7f901c905c47d8beed2918dd1c5c929fc35dffe4f6876
BLAKE2b-256 checksum
How to use checksums
947cf34f65f2a82ab37ac223065453743b85080a96accf490d95fce79ca1470f
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.34.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