Skip to content

Output Generation Guided by JSON Schema #1328

Description

@crisdesivo

Feature request

I propose the addition of a feature to transformers.js that allows users to enforce a specified JSON schema during the text generation process. This would ensure that the model's output is syntactically correct JSON and conforms to the provided schema.

Motivation

Many applications require LLMs to produce predictable, valid JSON output for tasks like data extraction, API response generation, and populating structured data fields.

Your contribution

Afraid not.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions