#1593·guardrails

1.0.0: remove structured/constrained decoding (output_formatter, jsonformer)

Author: zsimjeeCreated Jul 24, 2026Updated Sep 23, 2026
LabelsStale

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_formatter on Guard.for_pydantic (guard.py:392) and AsyncGuard (async_guard.py:92)
  • Application sites: api = self._output_formatter.wrap_callable(api) (guard.py:626–628, async_guard.py:308–309) and the Guard._output_formatter attribute (guard.py:171)
  • Dependency: guardrails-jsonformer>=0.13.1,<1.0.0 in the huggingface extra — a first-party fork we maintain, so this also retires a package we own.

Why

  1. 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.
  2. 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.
  3. 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.
  4. 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