HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
dottxt-ai
outlines
Python2023–2026
dottxt-ai / outlines

outlines

Structured Outputs

46Distinct people
53Mentions
0Explicit recommenders
16KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Structured Outputs

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 5:58:53 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year53 dated mentions

Observed mentions: 2023-07-21 23:46:24 UTC to 2026-10-16 19:42:56 UTC.

05101520252023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 19 mentions; 3 submissions, 16 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 24 mentions; 3 submissions, 21 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC19316
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC24321
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC514
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC514

What Hacker News says

19 sources
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 not very good at arithmetics :) print(sequence) # 1+3-2-4+5-7+8-6+9-6+4-2+3+5-1+1 sure, that's "correct" per the definition of the grammar, but it's also one of the worst possible way to get to the number 5
In Pushing ChatGPT's Structured Data Support to Its Limits
> very few open-source LLMs explicitly claim they intentionally support structured data, but they’re smart enough and they have logically seen enough examples of JSON Schema that with enough system prompt tweaking they should behave. Open source models are actually _better_ at structured outputs because you can adapt them using tools like JSONFormer et al that interact with the internals of the model (https://www.reddit.com/r/LocalLLaMA/comments/17a4zlf/reliabl...). The structured outputs can be arbitrary grammars, for example, not just JSON (https://github.com/outlines-dev/outlines#using-context-free-...).
In Pushing ChatGPT's Structured Data Support to Its Limits
I feel like the work on using CFGs with LLMs should be low-hanging fruit for improving code assistants, but perhaps someone more knowledgeable could chime in[1], [2], [3]. At lot of the confabulations we see today - non-existent variables, imports and APIs, out-of-scope variables, etc - would seem (to me) to be meaningfully addressable with these techniques. Relatedly, I have gotten surprisingly great mileage out of treating confabulations, in the first instance, as a user (ie, my own) failure to adequately contextualise, rather than error. In a sense, CFGs give you sharper tools to do that contextualisation. I wonder how far the “sharper tools” approach will carry us. It seems, to this interested layman, consistent with Shannon’s work in statistical language modelling.[4] The term “prompt engineering” implies, to me, a focus on the instr
Read the rest
uctive aspects of prompting, which is a bit unfortunate but also wholly consistent with the way I see colleagues and friends trying to interact with LLMs. Perhaps we should 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/156gu8c/d_const... [4] https://hedgehogreview.com/issues/markets-and-the-good/artic...
In How to tackle unreliability of coding assistants
One of the most powerful ways to integrate LLMs with existing systems is constrained generation. Libraries such as outlines[1] and instructor[2] allow structural specification of the expected outputs as regex patterns, simple types, jsonschema or pydantic models. Llama.cpp supports bnf 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
In Ask HN: Cheapest way to run local LLMs?
remilouf·Nov 13, 2023Submission

Show HN: Vectorize OpenAI API calls (like NumPy)

Outlines is a Python library that focuses on text generation with large language models. While the library mainly focuses on open source models we have an integration with the OpenAI API. When trying to implement Tree of Thoughts we became frustrated with the iterative workflow in which other libraries forced us. What we wanted was to be able to pass an array of prompts or completions with arbitrary shape, ask for several samples, and get an array of completions back. So we implemented a vectorization routine inspired by NumPy's. This makes our OpenAI integration have the "broadcast" behavior described above. All call are performed concurrently. We thought this could be of use to some folks here who are trying to implement complex workflows with the OpenAI API.
3 points · Open discussion
Our project Outlines provides JSON 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 repository. It builds off of the Lark library, so you can use existing grammar specifications instead of starting from scratch.
In Mistral 7B
Right now it just works with OpenAI chat models (gpt-3.5-turbo, gpt-4) but if there's interest I plan to extend it to have several backends. 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 - on a github issue would be great to make it visible to others.
In Show HN: Magentic – Use LLMs as simple Python functions
I think you might be over-simplifying. This (and llama.cpp's grammar-based sampling, which this is moving towards[1]) doesn't say "no, not like that, give me another token". It excludes impossible tokens at each step, but otherwise samples like normal. Is this a revolutionary trick? Not really, since llama.cpp and guidance, and probably others have 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
In Show HN: LLMs can generate valid JSON 100% of the time

Showing the 15 most recent of 19 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.