Hacker GitHub

← All repos

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

Mentions per year 53 mentions · busiest year 2024 (24)
20082026
  1. ▲ 3
    Outlines – Structured Outputs for LLMs
    story by modinfo · 2026-10-16 · 0 comments
  2. …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
  3. …level? Are you using some JSON grammar to force the LM head distribution to follow it? [0]: https://github.com/dottxt-ai/outlines
  4. …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
  5. 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…
  6. …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
  7. `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…
  8. …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
  9. ▲ 2
    Outlines – Structured Outputs from LLMs
    story by subset · 2025-04-14 · 0 comments
  10. …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
  11. …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
  12. ▲ 2
    Robust (Structured) Text Generation
    story by fzliu · 2024-10-16 · 0 comments
  13. Have you looked into structured generation with a library like outlines? https://github.com/dottxt-ai/outlines
  14. ▲ 3
    Outlines v0.1.0 release: 98% reduction in runtime overhead
    story by cpfiffer · 2024-10-08 · 1 comment
  15. …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
  16. …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
  17. …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
  18. 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
  19. Also the outlines library: https://github.com/outlines-dev/outlines
    comment by AStrangeMorrow · 2024-08-06 · in Structured Outputs in the API
  20. 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
  21. …[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…
  22. …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#...
  23. ▲ 24
    Show HN: LLM-powered NPCs running on your hardware
    story by Tantris · 2024-04-30 · 4 comments
  24. …`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
  25. 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
  26. …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
  27. Mentioned packages https://github.com/eth-sri/lmql https://github.com/outlines-dev/outlines https://github.com/guidance-ai/guidance
  28. …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.
  29. You can use outlines https://github.com/outlines-dev/outlines to let models generate with correct syntax.
  30. …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
  31. 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) #…
  32. This might be useful for this: https://github.com/outlines-dev/outlines
  33. …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…
  34. …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…
  35. 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…
  36. …). The structured outputs can be arbitrary grammars, for example, not just JSON ( https://github.com/outlines-dev/outlines#using-context-free-... ).
  37. …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
  38. 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
  39. …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…
  40. …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?
  41. ▲ 3
    Show HN: Vectorize OpenAI API calls (like NumPy)
    story by remilouf · 2023-11-13 · 0 comments
  42. Interesting! Is the end goal similar to the outlines library: https://github.com/outlines-dev/outlines ?
  43. We provide this in https://github.com/outlines-dev/outlines .
  44. …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
  45. …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…
  46. …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
  47. 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…
  48. …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…
  49. …sampling. We describe the approach in the paper linked above. The following PR is relevant: https://github.com/normal-computing/outlines/pull/178
  50. …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…