What is SemIf
SemIf (formerly OpenJev) is an open-source AI decision model that uses open-source models to reproduce the semantic decision interface pattern of the closed-source TypeSafe Jev . SemIf directly reads the logits scores corresponding to candidate options in a single forward pass, and the server constructs the structured result; when multiple questions share state, the prefix can also be reused, speeding up by nearly an order of magnitude. SemIf can run on an RTX 3090, provides a browser demo, and includes line-by-line reproducible benchmarks, temperature calibration, and 27B model bridging.
Main features of SemIf
- Direct logit scoring: Reads the logits of candidate options in a single forward pass to obtain probabilities, without generating answer text and then parsing it, about 5 times faster than autoregressive generation.
- Shared-state reuse: When multiple decisions share the same context, the prefix is prefilled once, then each criterion is evaluated serially or in parallel, increasing throughput by nearly an order of magnitude.
- Runtime-definable decisions: Criteria and option descriptions are passed in with the request, with no need for fine-tuning or predefined tasks, suitable for small agent decisions such as routing and retry judgment.
- Fully auditable: Fixed prompts, model versions, prompt hashes, line-by-line outputs, and known failures are all committed in the repository, supporting exact reproduction.
- Temperature calibration: Built-in temperature scaling fitted per workload, improving the consistency between probability confidence and actual accuracy.
- Multi-backend support: Supports CUDA GPU, Apple Silicon (MPS/MLX), CPU, and a browser WebGPU demo.
Follow WeChat and reply with "open source" to join theAI open-source project exchange group
How to use SemIf
-
Environment preparation: Install Python 3.10+, CUDA, and a GPU capable of accommodating a 4B BF16 model.
-
Install the project: After creating a virtual environment, run
pip install -e '.[test]'。 -
Prepare input: Write a decision file in JSONL format, with each line containing
id、state、questionandoptionscandidate list. -
Run scoring: Run
semif-score --mode direct --model Qwen/Qwen3.5-4B --revision <固定版本> --input examples/decisions.jsonl --output results.jsonlto obtain line-by-line option probabilities, elapsed time, and prompt hash. -
Shared-state mode: When the state of all lines is exactly the same, switch to
--mode shared, prefilling the prefix once and then evaluating all criteria in parallel. -
Calibration application: Use the project's built-in script to fit temperature scaling on the target workload so that output confidence matches actual accuracy.
Core advantages of SemIf
-
Fast decision speed: Directly reading option logits eliminates the generate-parse pipeline; 21 binary decisions take only about 1 second, 5.2 times faster than generating JSON.
-
Shared-prefix reuse: One prefilling and multiple branch evaluations raise throughput in shared-state scenarios from 2.33 to as high as 20.03 decisions/second.
-
Zero generated tokens: No answer text is sampled, eliminating JSON format errors, decoding loops, and output parsing failures.
-
Low hardware threshold: The frozen 4B model can run on a single RTX 3090, and also supports CPU, Apple Silicon, and browser WebGPU.
-
Fully open source and reproducible: All prompts, model versions, line-by-line results and known failures are committed to the repository, auditable and verifiable item by item.
-
Calibratable confidence: Built-in workload-based temperature scaling aligns probability confidence with actual accuracy, so outputs can be used directly for automated decision-making.
SemIf's project address
- Project website:https://openjev.com/
- GitHub repository:https://github.com/TheoLeeCJ/SemIf-OpenJev
Comparison of SemIf with similar competing products
| Comparison dimension | SemIf | Jev |
|---|---|---|
| Product nature | Independent open-source project (MIT license), formerly OpenJev | TypeSafe closed-source commercial hosted service |
| Decision mechanism | Single forward pass directly reads option logits, 0 output tokens | Internal mechanism not disclosed, semantic decision interface |
| Availability | No waitlist, try it in the browser/WebGPU, can run locally | Closed-source service, access requires application |
| Hardware threshold | A single RTX 3090 can run a 4B model; also supports CPU and Apple Silicon | Cloud-hosted, users do not need their own hardware |
| Decision speed | About 1.02 seconds for 21 binary decisions; with shared state reuse, up to 20 decisions/second | No public latency data |
| Quality performance | 0.845 agreement on the 102-row subset selected by TypeSafe; the 27B bridge reaches 0.958 on human decisions | 0.883 agreement on the same subset |
SemIf's application scenarios
-
Customer service ticket routing: Based on the customer's problem description and account status, score queue options such as "account support / billing support" directly, enabling millisecond-level automatic dispatch.
-
Agent action firewall: Before an Agent performs a high-risk operation, make a binary judgment on candidate actions; the 0.700 composite accuracy can serve as the first line of defense.
-
Evidence retrieval and ranking: Replace traditional rerankers in codebase retrieval and enterprise knowledge base question answering (0.929), giving candidate document scores in a single forward pass.
-
Inference conclusion verification: Used for NLI-type tasks, judging whether "the evidence supports the conclusion"; after calibration, the confidence can directly drive downstream automation.