SuperAPIAI Directory

SemIf-OpenJev

github.com · AI developer platforms

🌱 An MIT-licensed **independent open-source project** (explicitly unaffiliated with Jev or TypeSafe) that turns runtime semantic decisions into a probability readout: **no training, no fine-tuning** — it reads typed option probabilities directly from a frozen Qwen3.5-4B, generating no text and needi

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS

About this tool

Purpose

SemIf (formerly OpenJev) targets "small semantic decisions." Most agent judgments are simple, such as routing to this branch, retrying that request, or whether the evidence supports conclusion X. A chat model can answer such questions, but it takes time to generate text, and the software then has to parse the text back into an if statement. SemIf's approach is to skip the text generation step and read the probabilities of candidate options directly from an open model as the basis for the decision.

The project is positioned as an open-source reproduction of the Jev interface pattern. Jev is a closed-source service provided by TypeSafe for defining semantic decisions at runtime. SemIf reproduces this interface pattern, not Jev's undisclosed models or training process. The project is an independent research project and is not affiliated with or endorsed by TypeSafe.

Main capabilities

  • Runtime-defined: The judgment criteria and option descriptions are passed in with the request.
  • Decision-native: A single forward pass reads the logits of the declared options without sampling any answer tokens.
  • Shared-state aware: A longer state can be prefilled once and then branched and reused across multiple judgment criteria.
  • Auditable: Its own test fixtures, exact runner, line-by-line output, model version, prompts, and known failure cases are all committed with the repository.
  • Probability output and calibration: The returned probabilities are conditioned on the provided options; the project includes temperature scaling calibration fitted per workload. Calibration does not change which option is selected; it improves markedly on WANLI, while confidence intervals overlap on the author's own and Every workloads. Calibration and validation should be performed on the workloads where the model will actually be used for decisions.

Comparison with a compact generative baseline: With the same frozen Qwen3.5-4B, the same own state, and the same 21 binary judgments, on a single RTX 3090, the compact generative baseline outputs only ordered "yes"/"no" values, without key names, confidence objects, or explanations; its median time to first token is 0.489 seconds, but completing the entire array takes 5.21 times as long as direct reading; both arrays are valid and identical, and its choices agree with direct argmax on 18/21 judgments. The project notes that this is a system-level comparison and does not claim that the two reading methods are semantically equivalent.

State reuse: In one ownOn the 37-state × 21 standard workloads, the faster prefix-reuse path is an experimental feature, and BF16 execution changed 5–6 of 777 argmaxes relative to fresh scoring.

General decision baseline: the reranker remains strong on retrieval ranking, but direct logits are a better general decision baseline. The Jev numbers cited in the text come from TypeSafe's public records, and its online endpoint was not actually run; the comparison covers the 102 rows that can be aligned from public materials, rather than the 711-row summary reported by TypeSafe.

Qwen3.8-27B EXL3 bridge: using the same 144 rows of author-built data, the prompt hashes, options, direct logits reading, and metrics are consistent with the 4B baseline. The project emphasizes that this is a system-level quality comparison, not a controlled model-size or quantization ablation, because the model family, size, quantization, and runtime environment all differ; it has not yet been run on other quality workloads. On the shared-state fixture of 777 decisions, its choices agree with the fixed 4B model on 84.43% of rows.

Usage

Environment requirements are Python 3.10+, CUDA, and a GPU that can hold a 4B BF16 model.

Apple Silicon: using the native MLX backend allows direct scoring, supporting serial prefix reuse and parallel shared-state decisions, for macOS arm64. Install command: pip install -e '.[test,mlx]', and add --backend mlx to the scorer command. PyTorch/MPS (--device mps) is also supported, for direct, serial, and shared modes.

CPU-only: the llama.cpp backend can score the same prompts from a local GGUF checkpoint without a CUDA device. Install pip install -e '.[test,llamacpp]', obtain a GGUF (for example Qwen_Qwen3.5-4B-Q4_K_M.gguf from bartowski/Qwen_Qwen3.5-4B-GGUF), and add --backend llamacpp --gguf /path/to/model.gguf; --llama-threads is used to limit the number of CPU threads. Prompt construction still uses a fixed-version reference tokenizer, so prompt_sha256 is line-by-line consistent with the Torch backend; scores carry a GGUF checksum and are conditioned on the quantized weights. Direct execution and prefix-cache execution may show minor numerical differences due to different evaluation paths in llama.cpp, so comparisons should use tolerances rather than bit-for-bit comparison of raw logits. A loaded backend has a stateful scoring context. If a slower full-precision Torch reference path is needed, explicitly pass --device cpu --dtype float32.

After running the included example, each result contains typed option scores, elapsed time, the exact model version, and the prompt hash. If the state of each line is exactly the same, you can switch to --mode shared, filling once first and then evaluating each criterion in parallel.

The repository also provides: a browser-only WebGPU demo (no waitlist required, runs directly in the browser, the browser build uses quantized GGUF), interactive replay, machine-readable summaries, a benchmark package (including fixtures, runners, selection IDs, and reproduction commands), raw results, and checksums.

When to use

Suitable for scenarios that require small, high-frequency semantic judgments locally (such as on a home 3090) using open models, for example routing in agents, retry decisions, evidence sufficiency judgments, etc.; also suitable for research purposes that want to compare direct logits readings with generative readings in an auditable, reproducible way.

Limitations

  • The returned probabilities are conditioned on the provided options, and are only meaningful in scenarios where the model is used to make decisions; they need to be calibrated and validated first; calibration does not change the selected option.
  • The fast state reuse path is experimental, and BF16 execution has a small number of argmax differences from fresh scoring results.
  • The EXL3 27B bridge is a system-level comparison, not a controlled model scale or quantization ablation experiment, and has not been run on other quality workloads.
  • The comparison with Jev is based on 102 lines of data aligned with public records; its real-time endpoint was not run, and it does not cover the 711-line summary reported by TypeSafe.
  • Model weights and third-party source records are not included in the repository; upstream models retain their respective licenses. The project code is released under the MIT license.
  • The browser demo uses quantized GGUF, while native BF16 is the scoring method, so there are differences between the two.

(Other details, such as specific pricing, platform matrix, etc., are not provided for now.)

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools