1.0.0: remove structured/constrained decoding (output_formatter, jsonformer)
Target: 1.0.0. Remove constrained/structured decoding — the output_formatter="jsonformer" feature that constrains token-level generation to a schema.
Surface
guardrails/formatters/—base_formatter.py(BaseFormatter,PassthroughFormatter),json_formatter.py(JsonFormatter,_jsonschema_to_jsonformer,_deref_schema_path),__init__.py(get_formatter)- The only entry point:
output_formatteronGuard.for_pydantic(guard.py:392) andAsyncGuard(async_guard.py:92) - Application sites:
api = self._output_formatter.wrap_callable(api)(guard.py:626–628,async_guard.py:308–309) and theGuard._output_formatterattribute (guard.py:171) - Dependency:
guardrails-jsonformer>=0.13.1,<1.0.0in thehuggingfaceextra — a first-party fork we maintain, so this also retires a package we own.
Why
- Obsoleted by the providers. OpenAI and Anthropic ship native structured outputs / JSON mode. Core tenant 5 is "around feature parity with OpenAI and Anthropic's APIs" — reimplementing constrained decoding ourselves is now below parity, not above it.
- Only works with local HuggingFace models. Token-level constraint requires logits access, so this has never applied to API models — i.e. to nearly all real usage.
- Structurally incompatible with the direction. It works by wrapping the LLM callable. With reask removed (#1592) and the LLM moving out of Guard, there is no callable to wrap. Same argument that killed reask.
- Slim (tenant 3). Deletes a module, an extra's heaviest justification, and a maintained fork.
Nuance: this does not drop torch/transformers on its own
Those are also imported by guardrails/llm_providers.py (:270, :277, :375, :382, :550, :585) for local HuggingFace model callables — a separate feature sharing the same huggingface extra. Removing structured decoding retires guardrails-jsonformer and formatters/, but transformers and torch only leave if we also drop local-HF LLM support.
Follow-on question for the board: should we? If the LLM is leaving Guard, then custom LLM callables of any kind — HF pipelines included — become the caller's concern, and the whole huggingface extra goes with them. Worth deciding alongside open question 2 in #1591 rather than separately.
Source: guardrails-ai/guardrails