{"slug": "outlines", "name": "Outlines", "category": "dev-libs", "category_name": "Libraries and frameworks", "description": "", "recommenders": 5, "commenters": 7, "warners": 0, "score": 4.789, "rising": -0.31, "first": "2025-11-02", "latest": "2026-09-29", "why": "The team behind Outlines has repeatedly provided evaluations that show constrained decoding improves the outputs:", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 5, "neutral": 1, "compare": 1, "warn": 0}, "spark": [1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0], "listed": true, "loved": [], "caveat": "", "short_quote": "The team behind Outlines has repeatedly provided evaluations that show constrained decoding improves the outputs:", "kind": "", "icon": true, "domain": null, "github_repo": "github.com/outlines-dev/outlines", "official_url": "https://github.com/dottxt-ai/outlines", "pricing": "", "aliases": ["Outlines", "outlines"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 798192322, "item_id": 49887020, "url": "https://news.ycombinator.com/item?id=49887020", "by": "fzysingularity", "date": "2026-09-29", "stance": "recommend", "quote": "Look up vLLM, SGLang and outlines\u2019 implementations for more technical details.", "excerpt": "I don\u2019t know of one definitive resource but \u201cconstrained decoding\u201d, regex/grammar-based decoding, json-schema decoding will give you a bunch of hits. Look up vLLM, SGLang and outlines\u2019 implementations for more technical details. This looks pretty decent: https://www.aidancooper.co.uk/constrained-decoding/", "context": "", "use_case": "", "switched_from": "", "story": "Jeff \u2013 Jev-compatible 0.8B decision models, trained at home, ~30 ms"}, {"id": 781380546, "item_id": 48836284, "url": "https://news.ycombinator.com/item?id=48836284", "by": "Der_Einzige", "date": "2026-07-08", "stance": "recommend", "quote": "open models with xgrammer/guidnace/outlines can get you", "excerpt": "When it is still for awhile longer \"supported\" via API hosted models, the allowable schema's are far nerfed compared to what open models with xgrammer/guidnace/outlines can get you The following are not supported features: Recursive schemas Complex types within enums External $ref (for example, '$ref': 'http://...') Numerical constraints (such as minimum, maximum, multipleOf) String constraints (minLength, maxLength)", "context": "", "use_case": "", "switched_from": "", "story": "Grok 4.5"}, {"id": 746429824, "item_id": 46651864, "url": "https://news.ycombinator.com/item?id=46651864", "by": "ironbound", "date": "2026-01-16", "stance": "recommend", "quote": "Use one of these structured output libraries:", "excerpt": "Use one of these structured output libraries: https://github.com/outlines-dev/outlines https://github.com/jxnl/instructor https://github.com/guardrails-ai/guardrails https://www.askmarvin.ai/docs/text/transformation/ Some of them allow a JSON schema, others a Pydantic model (which you can transform to/from JSON).", "context": "", "use_case": "", "switched_from": "", "story": "How to wrangle non-deterministic AI outputs into conventional software? (2025)"}, {"id": 741542192, "item_id": 46346387, "url": "https://news.ycombinator.com/item?id=46346387", "by": "crystal_revenge", "date": "2025-12-21", "stance": "recommend", "quote": "The team behind Outlines has repeatedly provided evaluations that show constrained decoding improves the outputs:", "excerpt": "(repeating an earlier comment). The team behind Outlines has repeatedly provided evaluations that show constrained decoding improves the outputs: - https://blog.dottxt.ai/performance-gsm8k.html - https://blog.dottxt.ai/oss-v-gpt4.html - https://blog.dottxt.ai/say-what-you-mean.html", "context": "", "use_case": "", "switched_from": "", "story": "Structured outputs create false confidence"}, {"id": 741541904, "item_id": 46346369, "url": "https://news.ycombinator.com/item?id=46346369", "by": "crystal_revenge", "date": "2025-12-21", "stance": "recommend", "quote": "The team behind the Outlines library has produced several sets of evals", "excerpt": "> but never actually seen concrete evals. The team behind the Outlines library has produced several sets of evals and repeatedly shown the opposite: that constrained decoding improves model performance (including examples of \"CoT\" which the post claims isn't possible). [0,1] There was a paper that claimed constrained decoding hurt performance, but it had some fundamental errors which they also wrote about [2]. People", "context": "", "use_case": "Constrained decoding library", "switched_from": "", "story": "Structured outputs create false confidence"}]}], "caveats": [], "who": [], "tags": [], "use_cases": ["structured llm output", "constrained decoding library", "structured generation"], "compared": [{"slug": "sglang", "name": "SGLang", "co": 2, "switched_from": 0, "switched_to": 0}, {"slug": "instructor", "name": "Instructor", "co": 2, "switched_from": 0, "switched_to": 0}], "makers": [], "threads": [{"url": "https://news.ycombinator.com/item?id=46643754", "title": "How to wrangle non-deterministic AI outputs into conventional software? (2025)", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=46345333", "title": "Structured outputs create false confidence", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=49883844", "title": "Jeff \u2013 Jev-compatible 0.8B decision models, trained at home, ~30 ms", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=48835111", "title": "Grok 4.5", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=48192383", "title": "item 48192383", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=45788842", "title": "Context engineering", "mentions": 1}], "sentiment_by_month": {"2025-11": {"recommend": 1}, "2025-12": {"recommend": 1}, "2026-01": {"recommend": 1, "neutral": 1}, "2026-02": {}, "2026-03": {}, "2026-04": {}, "2026-05": {"compare": 1}, "2026-06": {}, "2026-07": {"recommend": 1}, "2026-08": {}, "2026-09": {"recommend": 1}, "2026-10": {}}, "quotes": [{"id": 798192322, "item_id": 49887020, "url": "https://news.ycombinator.com/item?id=49887020", "by": "fzysingularity", "date": "2026-09-29", "stance": "recommend", "quote": "Look up vLLM, SGLang and outlines\u2019 implementations for more technical details.", "excerpt": "I don\u2019t know of one definitive resource but \u201cconstrained decoding\u201d, regex/grammar-based decoding, json-schema decoding will give you a bunch of hits. Look up vLLM, SGLang and outlines\u2019 implementations for more technical details. This looks pretty decent: https://www.aidancooper.co.uk/constrained-decoding/", "context": "", "use_case": "", "switched_from": "", "story": "Jeff \u2013 Jev-compatible 0.8B decision models, trained at home, ~30 ms"}, {"id": 781380546, "item_id": 48836284, "url": "https://news.ycombinator.com/item?id=48836284", "by": "Der_Einzige", "date": "2026-07-08", "stance": "recommend", "quote": "open models with xgrammer/guidnace/outlines can get you", "excerpt": "When it is still for awhile longer \"supported\" via API hosted models, the allowable schema's are far nerfed compared to what open models with xgrammer/guidnace/outlines can get you The following are not supported features: Recursive schemas Complex types within enums External $ref (for example, '$ref': 'http://...') Numerical constraints (such as minimum, maximum, multipleOf) String constraints (minLength, maxLength)", "context": "", "use_case": "", "switched_from": "", "story": "Grok 4.5"}, {"id": 771200032, "item_id": 48200002, "url": "https://news.ycombinator.com/item?id=48200002", "by": "lucrbvi", "date": "2026-05-19", "stance": "compare", "quote": "How does this differ from dottxt's Outlines[0] on the technical level?", "excerpt": "How does this differ from dottxt's Outlines[0] on the technical level? Are you using some JSON grammar to force the LM head distribution to follow it? [0]: https://github.com/dottxt-ai/outlines", "context": "", "use_case": "", "switched_from": "", "story": null}, {"id": 746856256, "item_id": 46678516, "url": "https://news.ycombinator.com/item?id=46678516", "by": "johndough", "date": "2026-01-19", "stance": "neutral", "quote": "", "excerpt": "To add to that, llama.cpp supports GBNF grammars, which allows generation of JSON, or even programming languages: https://github.com/ggml-org/llama.cpp/blob/master/grammars/README.md", "context": "", "use_case": "Structured LLM output", "switched_from": "", "story": "How to wrangle non-deterministic AI outputs into conventional software? (2025)"}, {"id": 746429824, "item_id": 46651864, "url": "https://news.ycombinator.com/item?id=46651864", "by": "ironbound", "date": "2026-01-16", "stance": "recommend", "quote": "Use one of these structured output libraries:", "excerpt": "Use one of these structured output libraries: https://github.com/outlines-dev/outlines https://github.com/jxnl/instructor https://github.com/guardrails-ai/guardrails https://www.askmarvin.ai/docs/text/transformation/ Some of them allow a JSON schema, others a Pydantic model (which you can transform to/from JSON).", "context": "", "use_case": "", "switched_from": "", "story": "How to wrangle non-deterministic AI outputs into conventional software? (2025)"}, {"id": 741542192, "item_id": 46346387, "url": "https://news.ycombinator.com/item?id=46346387", "by": "crystal_revenge", "date": "2025-12-21", "stance": "recommend", "quote": "The team behind Outlines has repeatedly provided evaluations that show constrained decoding improves the outputs:", "excerpt": "(repeating an earlier comment). The team behind Outlines has repeatedly provided evaluations that show constrained decoding improves the outputs: - https://blog.dottxt.ai/performance-gsm8k.html - https://blog.dottxt.ai/oss-v-gpt4.html - https://blog.dottxt.ai/say-what-you-mean.html", "context": "", "use_case": "", "switched_from": "", "story": "Structured outputs create false confidence"}, {"id": 741541904, "item_id": 46346369, "url": "https://news.ycombinator.com/item?id=46346369", "by": "crystal_revenge", "date": "2025-12-21", "stance": "recommend", "quote": "The team behind the Outlines library has produced several sets of evals", "excerpt": "> but never actually seen concrete evals. The team behind the Outlines library has produced several sets of evals and repeatedly shown the opposite: that constrained decoding improves model performance (including examples of \"CoT\" which the post claims isn't possible). [0,1] There was a paper that claimed constrained decoding hurt performance, but it had some fundamental errors which they also wrote about [2]. People", "context": "", "use_case": "Constrained decoding library", "switched_from": "", "story": "Structured outputs create false confidence"}, {"id": 732660416, "item_id": 45791276, "url": "https://news.ycombinator.com/item?id=45791276", "by": "calebkaiser", "date": "2025-11-02", "stance": "recommend", "quote": "outlines is a particularly cool library", "excerpt": "Any of the \"design patterns\" listed in the article will have a ton of popular open source implementations. For structured generation, I think outlines is a particularly cool library, especially if you want to poke around at how constrained decoding works under the hood: https://github.com/dottxt-ai/outlines", "context": "", "use_case": "Structured generation", "switched_from": "", "story": "Context engineering"}]}