Ross ROSS = Recommend OSS · open-source software intelligence for agents

noamgat/lm-format-enforcer

Enforce the output format (JSON Schema, Regex etc) of a language model observed · 2026-08-28

github.com/noamgat/lm-format-enforcer · Python · MIT (permissive) observed · 2026-08-28

Health v2 · maintenance only

64/100

  • Activity 75
  • Release rhythm 42
  • Longevity 76
How is this computed?

round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.

  • gap_med: 11
  • age_days: 1077
  • days_rel: 389
  • days_push: 151
  • n_releases_24m: 8

Full methodology

Adoption not part of the score

2029 stars · 92 forks observed · 2026-08-28

What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded

A Python library that enforces output formats like JSON Schema or regex on language models by filtering allowed tokens at each generation step. It integrates with transformers, LangChain, llama.cpp, vLLM, and other inference stacks.

Use cases

  • force an LLM to output valid JSON matching a schema
  • make a language model follow a regex output pattern
  • get structured data extraction from LLM responses
  • prevent malformed JSON from a chat model
  • constrain model output to a pydantic model schema
  • guarantee parseable LLM output for downstream pipelines

When to choose

  • you need guaranteed schema-valid or regex-valid LLM output
  • you use Hugging Face transformers, vLLM, llama.cpp, or LangChain and want constrained decoding
  • prompt engineering alone isn't reliable enough for structured output

When to avoid

  • you need function-calling or structured output built into a hosted API like OpenAI's
  • your model server already provides native grammar-constrained sampling
  • you work outside the Python ecosystem

Facets

library · maturity active

llm-inference parser prompt-engineering serialization large-language-models machine-learning developer-tools python structured-output -schema constrained-decoding regex-enforcement token-filtering langchain-integration transformers natural-language-processing

2 sources

Member repositories

RepositoryRoleHealth v2
noamgat/lm-format-enforcermain64

For agents

markdown · JSON · MCP: product_card(name="noamgat/lm-format-enforcer")

Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem