Skip to content

Jev directory

Parallel Constrained Decoding

A Java and Python implementation of parallel constrained decoding: fill a whole JSON schema of booleans and enums in two forward passes, with calibrated confidence per field and output that is schema-valid by construction.
Stars
15
Language
Java
License
APACHE-2.0
Reading time
3 min
Published by
Community
Author
stephanj
Last verified
Oct 2026

Highlights

  • On an Apple M1 Ultra the Java engine fills a 28-field schema in 266 ms cold and 130 ms warm, versus 2388 ms token-by-token and 337 ms in Python.
  • Java drives llama.cpp through the JDK Foreign Function & Memory API with no JNI, loads any GGUF including local Ollama models, and ships a racing web app.
  • Warm single-pass mode keeps the schema's KV cells between calls, a production optimization the Python reference engine does not have.
  • Presets cover fraud/AML triage, code-security audit, support triage, a 255-choice tariff router, spam/phishing triage and Devoxx talk routing.
  • The Python port runs the original MLX engine on Apple Silicon only with stock Qwen2.5-1.5B-Instruct; its Hugging Face source repo holds no weights.

Quickstart

bash
git clone https://github.com/stephanj/parallelConstraintDecoding.git
brew install llama.cpp
mkdir -p models
curl -L -o models/qwen2.5-1.5b-instruct-q8_0.gguf https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct

Watch out

Grounded in the truncated repository README, video link and GitHub metadata reviewed on 2026-10-15; all benchmark numbers come from one Apple M1 Ultra with an otherwise idle GPU, and on Linux the engine runs on CPU with seconds per race instead of sub-second.

Questions about this entry

Short answers drawn from the linked project or page.

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai