1rgs

jsonformer: Generate Schema-Shaped JSON with Language Models

Jsonformer guides Hugging Face language models to produce JSON matching a supported schema by supplying predictable structural tokens itself. It may suit Python projects needing structured output, but the repository has been inactive for over a year.

InactiveJupyter NotebookMITPythonLibraryLLM
View on GitHub Compare
Stars
4.9k
Forks
181
Stars, last 30 days
-2
Last commit
2.6 years ago
Contributors
6

Our take

Inactiveno commits in over a year

Health score

22/100

How it is scored
Activity
19
Community
29
Issues
21
Pull requests
20

-2 stars in the last 30 days

Jsonformer offers a focused approach to schema-shaped generation, but its inactive status and highly concentrated contributor history make it a cautious choice for new production dependencies.

Good fit if

  • You use Python and Hugging Face models and need JSON matching schemas made from the documented supported types.
  • You can evaluate and maintain the integration yourself, given there have been no commits or releases in over a year and most of the code comes from one person.
  • MIT licensing fits your project and its notice requirements.

Look elsewhere if

  • You need recent maintenance or active issue handling; the repository has no recent commits, releases, or issue closures.
  • Your schemas require JSON Schema types or constraints beyond the listed numbers, booleans, strings, arrays, and objects.
  • You need a project with tests or CI in the repository's stated requirements and health data.
All health signals
Last commit2024-02-24 (2.6 years ago)
Commits, last 90 days0
Releases, last 12 months0
Contributors6 (top contributor: 86% of commits)
Issues closed, last 90 days0
Pull requests merged, last 90 days0
Project age3 years

Checked on 2026-10-12 with the GitHub API.

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

4,935

Forks

180

Change since Nov 17, 2026: 0 stars·-1 forks

Overview

Jsonformer is a Python wrapper for Hugging Face models that generates JSON according to a supplied schema. Instead of asking a model to produce the entire JSON string, it fills in predictable structural tokens and lets the model generate the content values.

It targets applications where valid structure matters more than unconstrained text generation. Its schema support is a subset of JSON Schema, covering numbers, booleans, strings, arrays, and objects.

Key Features

  • Generates JSON while supplying fixed structural tokens rather than relying on the model to write them.
  • Accepts schemas containing numbers, booleans, strings, arrays, and objects.
  • Handles nested objects and arrays, as shown in the project examples.
  • Wraps Hugging Face Transformers models and tokenizers.
  • Provides a Python package installable with pip.

Use Cases

  • Python developers can request schema-shaped records from a Hugging Face model instead of parsing free-form responses.
  • Teams prototyping data extraction can describe the desired fields and ask a model to fill their values.
  • Developers building structured generation around nested objects and arrays can test a Hugging Face model against a defined output shape.
  • Projects already using the Hugging Face interface can explore constrained JSON generation without switching model ecosystems.

What you need

Detected in the repository

  • Python (from pyproject.toml)

License in plain words

MITpermissive

  • Commercial use: yes
  • Modify and redistribute: yes
  • You must keep: the copyright and license notice
  • Share your changes: no

A summary, not legal advice: the LICENSE file is what applies.

Getting Started

Install the package:

pip install jsonformer

See the README for a model and schema example and development instructions.

Considerations

The repository is marked inactive: it has had no commits or releases in over a year, and no issues were closed in the recent measurement period. Contributor activity is concentrated, with most of the code attributed to one person, which may affect maintenance continuity.

The README describes support for only a subset of JSON Schema. The project depends on Python and Hugging Face Transformers; the hardware needed depends on the model you choose, and the supplied example uses a large model. The provided requirements data reports no CI or tests, so adopters should validate generated output and compatibility for their own models. The MIT license permits broad use, subject to retaining the applicable copyright and license notice.

Found this useful?

Share it with someone who would like jsonformer.

Comparisons