dottxt-ai/outlines
View on GitHub ↗ ★ 15,996 Python
Structured Outputs
53 mentions on Hacker News by 46 people: 8 stories, 45 comments · first 2023-07-21 · latest 2026-10-16
20082026
-
▲ 3
Outlines – Structured Outputs for LLMsstory by modinfo · 2026-10-16 · 0 comments
-
…https://github.com/noamgat/lm-format-enforcer https://github.com/mlc-ai/xgrammar https://github.com/dottxt-ai/outlines
comment by Der_Einzige · 2026-06-15 · in Not everyone is using AI for everything -
…level? Are you using some JSON grammar to force the LM head distribution to follow it? [0]: https://github.com/dottxt-ai/outlines
comment by lucrbvi · 2026-05-19 · in Show HN: Forge – Guardrails take an 8B model from 53% to 99% on agentic tasks -
…who might be interested: Some libraries: - Outlines, a nice library for structured generation - https://github.com/dottxt-ai/outlines - Guidance (already covered by FlyingLawnmower in this thread), another nice library -…
comment by mcyc · 2026-01-17 · in LLM Structured Outputs Handbook -
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…
comment by ironbound · 2026-01-16 · in How to wrangle non-deterministic AI outputs into conventional software? (2025) -
…library, especially if you want to poke around at how constrained decoding works under the hood: https://github.com/dottxt-ai/outlines
comment by calebkaiser · 2025-11-02 · in Context engineering -
`outlines` ( https://github.com/dottxt-ai/outlines ) is very good and supported by vLLM as a backend structured output provider ( https://docs.vllm.ai/en/v0.8.2/features/structured_outputs.h... ) for both local and remote LLMs. vLLM is…
comment by mmargenot · 2025-09-15 · in Show HN: AI-powered web service combining FastAPI, Pydantic-AI, and MCP servers -
…provide the model a choice of only which tokens are valid JSON immediately after a `{`, etc. [0] https://github.com/dottxt-ai/outlines [1] https://github.com/guidance-ai/guidance
comment by evnc · 2025-08-07 · in GPT-5 for Developers -
▲ 2
Outlines – Structured Outputs from LLMsstory by subset · 2025-04-14 · 0 comments
-
…is solv-". With "ing" as the obvious next token. It will select the best beam for the output. [1]: https://github.com/dottxt-ai/outlines
comment by lelag · 2025-04-14 · in Albert Einstein's theory of relativity in words of four letters or less (1999) -
…all valid moves and using outlines[0] or Structured Outputs[1] to constrain the output. [0]: https://github.com/dottxt-ai/outlines [1]: https://openai.com/index/introducing-structured-outputs-in-t...
comment by ElFitz · 2024-11-19 · in How to Build a Chess Engine and Fail -
▲ 2
Robust (Structured) Text Generationstory by fzliu · 2024-10-16 · 0 comments
-
Have you looked into structured generation with a library like outlines? https://github.com/dottxt-ai/outlines
comment by msp26 · 2024-10-15 · in Extracting financial disclosure and police reports with OpenAI Structured Output -
▲ 3
Outlines v0.1.0 release: 98% reduction in runtime overheadstory by cpfiffer · 2024-10-08 · 1 comment
-
…has lead me to the prior art: using same Pydantic API to generate structured output from local LLMs https://github.com/outlines-dev/outlines?tab=readme-ov-file#...
comment by munro · 2024-08-07 · in Structured Outputs in the API -
…of my workflows when using their APIs directly. I also want to give a shout out to Outlines team, https://github.com/outlines-dev/outlines , they've been doing structured outputs for the last 12 months, and their open source lib can be…
comment by armcat · 2024-08-07 · in Structured Outputs in the API -
…are valid according to a grammar. There are quite a few open source implementations of this e.g. https://github.com/outlines-dev/outlines
comment by jeeceebees · 2024-08-06 · in Structured Outputs in the API -
At least depends on the approach and use: stuff like outlines ( https://github.com/outlines-dev/outlines ) that actually changes the sampling to adhere to a grammar and can be used with local/custom models shouldn't be too impacted. Those…
comment by AStrangeMorrow · 2024-08-06 · in Structured Outputs in the API -
Also the outlines library: https://github.com/outlines-dev/outlines
comment by AStrangeMorrow · 2024-08-06 · in Structured Outputs in the API -
You can use structured generation instead of fiddling with the prompt, which is unreliable. https://github.com/outlines-dev/outlines
comment by NeutralForest · 2024-05-25 · in Mistral Fine-Tune -
…[1] solutions [2] on the horizon. > > [1]: https://github.com/alphacep/vosk-api/issues/55 > > [2]: https://github.com/outlines-dev/outlines?tab=readme-ov-file#... It's interesting as speech recognition has become more popular than ever…
comment by FloatArtifact · 2024-05-07 · in Infini-Gram: Scaling unbounded n-gram language models to a trillion tokens -
…are some [1] solutions [2] on the horizon. [1]: https://github.com/alphacep/vosk-api/issues/55 [2]: https://github.com/outlines-dev/outlines?tab=readme-ov-file#...
comment by bmc7505 · 2024-05-06 · in Infini-Gram: Scaling unbounded n-gram language models to a trillion tokens -
▲ 24
Show HN: LLM-powered NPCs running on your hardwarestory by Tantris · 2024-04-30 · 4 comments
-
…`outlines`[0]) are really slow or don't work at all. Would love to hear what others have tried! 0 - https://github.com/outlines-dev/outlines
comment by mritchie712 · 2024-04-08 · in Anthropic's Haiku Beats GPT-4 Turbo in Tool Use -
Check out outlines by .txt : https://github.com/outlines-dev/outlines sglang: https://arxiv.org/abs/2312.07104
comment by fzysingularity · 2024-03-19 · in Inversion: Fast, Reliable Structured LLMs -
…something that Outlines [0], Guidance [1] and others [2] already solved much more elegantly? 0. https://github.com/outlines-dev/outlines 1. https://github.com/guidance-ai/guidance 2. https://github.com/sgl-project/sglang
comment by PheonixPharts · 2024-03-12 · in Show HN: Prompts as WASM Programs -
Mentioned packages https://github.com/eth-sri/lmql https://github.com/outlines-dev/outlines https://github.com/guidance-ai/guidance
comment by nerpderp82 · 2024-03-06 · in Show HN: Fructose – LLM calls as strongly typed functions -
…good job of it ( https://news.ycombinator.com/item?id=38782678 ), and libraries such as outlines ( https://github.com/outlines-dev/outlines ) which is more complex but can better ensure a dictionary output for local LLMs.
comment by minimaxir · 2024-03-06 · in Show HN: Fructose – LLM calls as strongly typed functions -
You can use outlines https://github.com/outlines-dev/outlines to let models generate with correct syntax.
comment by sanxiyn · 2024-02-18 · in Representation Engineering: Mistral-7B on Acid -
…that way, so long as it is simple enough. There are a bunch of libraries for this already, e.g.: https://github.com/outlines-dev/outlines
comment by int_19h · 2024-02-15 · in Ask HN: What are some actual use cases of AI Agents right now? -
https://github.com/outlines-dev/outlines/blob/7fae436345e621... squares with my experience using LLMs for anything real sequence = generator("Alice had 4 apples and Bob ate 2. Write an expression for Alice's apples:") print(sequence) #…
comment by mdaniel · 2024-02-08 · in Launch HN: AgentHub (YC W24) – A no-code automation platform -
This might be useful for this: https://github.com/outlines-dev/outlines
comment by cuchoi · 2024-02-08 · in Launch HN: AgentHub (YC W24) – A no-code automation platform -
…anyone has done that. If you want to generate json or other structured output, there is Outlines https://github.com/outlines-dev/outlines that constrains the output to match a regex so it guarantees e.g. the model will generate a valid API…
comment by andy99 · 2024-01-25 · in Ollama releases Python and JavaScript Libraries -
…ONLY words which are JSON matching your favorite JSON format. This is a library which does this: https://github.com/outlines-dev/outlines The one piece of advice I will give: Do NOT neuter the AI like OpenAI did. There is a near-obsession…
comment by blagie · 2024-01-14 · in Building a fully local LLM voice assistant to control my smart home -
That last link is interesting. See https://github.com/outlines-dev/outlines#using-context-free-... specifically # ... sequence = generator("Write a formula that returns 5 using only additions and subtractions.") # It looks like Mistral is…
comment by airstrike · 2023-12-27 · in Pushing ChatGPT's Structured Data Support to Its Limits -
…). The structured outputs can be arbitrary grammars, for example, not just JSON ( https://github.com/outlines-dev/outlines#using-context-free-... ).
comment by twelfthnight · 2023-12-27 · in Pushing ChatGPT's Structured Data Support to Its Limits -
…like Outlines[0] and jsonformer[1]. I haven't tried them myself but they look very promising. [0]: https://github.com/outlines-dev/outlines [1]: https://github.com/1rgs/jsonformer
comment by Hugsun · 2023-12-25 · in Ask HN: How do I train a custom LLM/ChatGPT on my own documents in Dec 2023? -
Thank you for the great library and examples! Can you please comment on how simpleaichat compares to https://github.com/outlines-dev/outlines ?
comment by abrichr · 2023-12-15 · in Prompt engineering -
…instead call it “context composition” or something, to emphasise the constructive nature. [1] https://github.com/outlines-dev/outlines [2] https://github.com/ggerganov/llama.cpp/pull/1773 [3] https://www.reddit.com/r/LocalLLaMA/comments/156…
comment by darkteflon · 2023-11-29 · in How to tackle unreliability of coding assistants -
…grammars. These outputs often consume significantly fewer tokens than chat or text completions. [1] https://github.com/outlines-dev/outlines [2] https://github.com/jxnl/instructor
comment by gmt2027 · 2023-11-27 · in Ask HN: Cheapest way to run local LLMs? -
▲ 3
Show HN: Vectorize OpenAI API calls (like NumPy)story by remilouf · 2023-11-13 · 0 comments
-
Interesting! Is the end goal similar to the outlines library: https://github.com/outlines-dev/outlines ?
comment by namin · 2023-11-12 · in Show HN: LLM Verified with Monte Carlo Tree Search -
We provide this in https://github.com/outlines-dev/outlines .
comment by btwillard · 2023-10-04 · in Show HN: Generate JSON mock data for testing/initial app development -
…output in a near optimal way that also works for all types of pre-trained transformer-based LLMs: https://github.com/outlines-dev/outlines Our approach also extends to EBNF grammars and LALR parsing. There's an example of that in the…
comment by btwillard · 2023-09-28 · in Mistral 7B -
…These would probably each be an existing library that implements generating structured output like https://github.com/outlines-dev/outlines or https://github.com/guidance-ai/guidance . If you have ideas how this should be done let me know…
comment by jackmpcollins · 2023-09-26 · in Show HN: Magentic – Use LLMs as simple Python functions -
…already done it. But it's a good trick, and hopefully one of many to justify the valuation :). [1]: https://github.com/normal-computing/outlines/pull/178
comment by kristjansson · 2023-08-15 · in Show HN: LLMs can generate valid JSON 100% of the time -
We also had an implementation of grammar-driven guidance around the same time: https://github.com/normal-computing/outlines/pull/131 . I imagine many others did as well, given all the papers we found on the subject. The point of this and…
comment by btwillard · 2023-08-14 · in Show HN: LLMs can generate valid JSON 100% of the time -
…can get the logits), and to some extent with OpenAI's API. Here is an example with `transformers`: https://github.com/normal-computing/outlines#efficient-json-... We plan on adding more model integrations, but it is completely decoupled…
comment by remilouf · 2023-08-14 · in Show HN: LLMs can generate valid JSON 100% of the time -
…sampling. We describe the approach in the paper linked above. The following PR is relevant: https://github.com/normal-computing/outlines/pull/178
comment by remilouf · 2023-08-14 · in Show HN: LLMs can generate valid JSON 100% of the time -
…extend our approach to grammar-based sampling, as explained in the paper linked above. Relevant PR: https://github.com/normal-computing/outlines/pull/178 Our method is much more efficient. llama.cpp loops over the entire vocabulary (~50k…
comment by remilouf · 2023-08-14 · in Show HN: LLMs can generate valid JSON 100% of the time