The execution layer for AI agents. Act across more of your systems with precise controls: safer, faster and more efficient than MCP tools and gateways.
An event-driven framework designed to build and orchestrate multi-agent AI systems. It enables seamless integration of AI agents with real-world data sources and systems, facilitating complex, multi-step workflows.
ACI.dev is the open source tool-calling platform that hooks up 600+ tools into any agentic IDE or custom AI agent through direct function calling or a unified MCP server. The birthplace of VibeOps.
Two conversational AI agents switching from English to sound-level protocol after confirming they are both AI agents.
Key parameters and specifications
Key parameters and specifications
Parameter
Value
Language
Jupyter Notebook
Category
AI Engineering
Subcategory
Prompt & Scaffold
Keywords
Structured outputs
Stars
4,938
Forks
181
Contributors
6
Created date
2023-04-29
Updated date
2026-10-09
Stars in 1 day
0
Stars in 7 days
1
Rank
7,483
Previous rank
7,622
Rank change
139
7-day stars rank
9,066
Previous 7-day stars rank
9,117
7-day stars rank change
51
Total stars rank
2,839
Previous total stars rank
2,834
Total stars rank change
-5
Country
Canada
README summary
Jsonformer: A Bulletproof Way to Generate Structured JSON from Language Models. Problem: Getting models to output structured JSON is hard Solution: Only generate the content tokens and fill in the fixed tokens Generating structured JSON from language models is a challenging task. The generated JSON must be syntactically correct, and it must conform to a schema that specifies the structure of the JSON. Current approaches to this problem are brittle and error-prone. They rely on prompt engineering, fine-tuning
, and post-processing, but they still fail to generate syntactically correct JSON in many cases. Jsonformer is a new approach to this problem. In structured data, many tokens are fixed and predictable. Jsonformer is a wrapper around Hugging Face models that fills in the fixed tokens during the generation process, and only delegates the generation of content tokens to the language model. This makes it more efficient and bulletproof than existing approaches. This currently supports a subset of JSON Schema
. Below is a list of the supported schema types: number boolean string array object Example Jsonformer works on complex schemas, even with tiny models. Here is an example of a schema with nested objects and arrays, generated by a 3B parameter model. Features Bulletproof JSON generation: Jsonformer ensures that the generated JSON is always syntactically correct and conforms to the specified schema. Efficiency: By generating only the content tokens and filling in the fixed tokens, Jsonformer is more efficient than
generating a full JSON string and parsing it. Flexible and extendable: Jsonformer is built on top of the Hugging Face transformers library, making it compatible with any model that supports the Hugging Face interface. Installation Development Poetry is used for dependency management. License Jsonformer is released under the MIT License. You are free to use, modify, and distribute this software for any purpose, commercial or non-commercial, as long as the original copyright and license notice are included.
Frequently asked questions
How many stars and forks are recorded?
1rgs/jsonformer has 4,938 stars and 181 forks.
What is the repository rank?
1rgs/jsonformer is ranked 7,483.
What language and category are recorded?
1rgs/jsonformer has 4,938 stars, uses Jupyter Notebook and belongs to AI Engineering.
Which repository is closest in rank?
1rgs/jsonformer is compared with withcoral/coral, ranked 7,484 with 4,938 stars.
README
Jsonformer: A Bulletproof Way to Generate Structured JSON from Language Models.
Problem: Getting models to output structured JSON is hard
Solution: Only generate the content tokens and fill in the fixed tokens
Generating structured JSON from language models is a challenging task. The
generated JSON must be syntactically correct, and it must conform to a schema
that specifies the structure of the JSON.
Current approaches to this problem are brittle and error-prone. They rely on prompt engineering, fine-tuning, and post-processing, but they still fail to generate syntactically correct JSON in many cases.
Jsonformer is a new approach to this problem. In structured data, many tokens are fixed and predictable. Jsonformer is a wrapper around Hugging Face models that fills in the fixed tokens during the generation process, and only delegates the generation of content tokens to the language model. This makes it more efficient and bulletproof than existing approaches.
This currently supports a subset of JSON Schema. Below is a list of the supported schema types:
number
boolean
string
array
object
Example
from jsonformer import Jsonformer
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("databricks/dolly-v2-12b")
tokenizer = AutoTokenizer.from_pretrained("databricks/dolly-v2-12b")
json_schema = {
"type": "object",
"properties": {
"name": {"type": "string"},
"age": {"type": "number"},
"is_student": {"type": "boolean"},
"courses": {
"type": "array",
"items": {"type": "string"}
}
}
}
prompt = "Generate a person's information based on the following schema:"
jsonformer = Jsonformer(model, tokenizer, json_schema, prompt)
generated_data = jsonformer()
print(generated_data)
Jsonformer works on complex schemas, even with tiny models. Here is an example of a schema with nested objects and arrays, generated by a 3B parameter model.
Bulletproof JSON generation: Jsonformer ensures that the generated JSON is always syntactically correct and conforms to the specified schema.
Efficiency: By generating only the content tokens and filling in the fixed tokens, Jsonformer is more efficient than generating a full JSON string and parsing it.
Flexible and extendable: Jsonformer is built on top of the Hugging Face transformers library, making it compatible with any model that supports the Hugging Face interface.
Jsonformer is released under the MIT License. You are free to use, modify, and distribute this software for any purpose, commercial or non-commercial, as long as the original copyright and license notice are included.