outlines VS Constrained-Text-Genera

Compare outlines vs Constrained-Text-Genera and see what are their differences.

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
outlines Constrained-Text-Genera
33 11
5,799 -
11.0% -
9.7 -
6 days ago -
Python
Apache License 2.0 -
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

outlines

Posts with mentions or reviews of outlines. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-05-05.
  • Infini-Gram: Scaling unbounded n-gram language models to a trillion tokens
    4 projects | news.ycombinator.com | 5 May 2024
    > [2]: https://github.com/outlines-dev/outlines?tab=readme-ov-file#...

    It's interesting as speech recognition has become more popular than ever through services like Alexa, and other iot devices support for OS speech recognition

    Unfortunately most implementations (especially those that are iot focused) don't have very important features for robust speech recognition.

    1. Ability to enable and disable a grammar

  • Show HN: LLM-powered NPCs running on your hardware
    4 projects | news.ycombinator.com | 30 Apr 2024
    [4] https://github.com/outlines-dev/outlines/tree/main
  • Advanced RAG with guided generation
    2 projects | dev.to | 18 Apr 2024
    The next step is defining how to guide generation. For this step, we'll use the Outlines library. Outlines is a library for controlling how tokens are generated. It applies logic to enforce schemas, regular expressions and/or specific output formats such as JSON.
  • Anthropic's Haiku Beats GPT-4 Turbo in Tool Use
    5 projects | news.ycombinator.com | 8 Apr 2024
    No benchmarks, just my anecdotal experience trying to get local LLM's to respond with JSON. The method above works for my use case nearly 100% of the time. Other things I've tried (e.g. `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

  • Show HN: Chess-LLM, using constrained-generation to force LLMs to battle it out
    1 project | news.ycombinator.com | 14 Mar 2024
    As I was playing with the Outlines library (https://outlines-dev.github.io/outlines/), I discussed with my friend Maxime how funny it would be if we set up a way to pair LLMs in chess matches till one wins. The first time I tried it, it required substantial prompt engineering to get some of those LLMs to propose valid moves. Large language models can mostly stay focused and even play rather well; see https://news.ycombinator.com/item?id=37616170 for example. However small language models aren't as easy to convince.

    Some of those LLMs have seen very little chess notation and so after the first few opening moves there aren't any valid tactics, let alone strategy, so they would end up either repeating the same move, or hallucinate moves that are not valid (Kxe5, but there would be a queen on e5!)

    Then Outlines came along and we could force them to pick valid moves with little cost! Maxime worked super fast and got a first version of this idea as a gradio space.

    I think it is pretty fun to see the (mostly terrible, but otherwise valid) chess that those LLMs play. Maybe it will even be instructive to how we can create small LLMs that can play much better than the ones on the leaderboard.

    Anyway, you can check it out here:

    https://huggingface.co/spaces/mlabonne/chessllm

    What is interactive about it: you can pick the LLMs from available models on HuggingFace (within reason, small LLMs are preferable so that the space does not crash) or push one of your own small models to HF and have it fight with others. At the end of the game the leaderboard is updated.

    Hope you find it fun!

  • Show HN: Prompts as (WASM) Programs
    9 projects | news.ycombinator.com | 11 Mar 2024
    > The most obvious usage of this is forcing a model to output valid JSON

    Isn't this something that Outlines [0], Guidance [1] and others [2] already solve much more elegantly?

    0. https://github.com/outlines-dev/outlines

    1. https://github.com/guidance-ai/guidance

    2. https://github.com/sgl-project/sglang

  • Show HN: Fructose, LLM calls as strongly typed functions
    10 projects | news.ycombinator.com | 6 Mar 2024
  • Unlocking the frontend – a call for standardizing component APIs pt.2
    8 projects | dev.to | 5 Mar 2024
    And I think “just” Markdown doesn’t quite cut it for safe guidance. For example: directly generating content for your components. But I’m really excited about tooling like outlines appearing, with a greater focus on guided generation for structured data. Because this is often what we actually need!
  • Ask HN: What are some actual use cases of AI Agents?
    6 projects | news.ycombinator.com | 14 Feb 2024
    It's pretty easy to force a locally running model to always output valid JSON: when it gives you probabilities for the next tokens, discard all tokens that would result in invalid JSON at that point (basically reverse parsing), and then apply the usual techniques to pick the completion only from the remaining tokens. You can even validate against a JSON schema 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

  • Launch HN: AgentHub (YC W24) – A no-code automation platform
    2 projects | news.ycombinator.com | 8 Feb 2024
    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:")

Constrained-Text-Genera

Posts with mentions or reviews of Constrained-Text-Genera. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-06.
  • Photoshop for Text (2022)
    2 projects | news.ycombinator.com | 6 Apr 2024
    Oh my god. I wrote a whole library called "Constrained Text Generation Studio" where I mused that I wanted a "Photoshop for Text". I'm not even sure which work predates the other: https://github.com/Hellisotherpeople/Constrained-Text-Genera...

    The core idea of a "photoshop for text", specifically a word processor made for prosumers supporting GenAI first class (i.e oobabooga but actually good) - is worth so much. If you're a VC reading this, chances are I want to talk to you to actually execute on the idea from the OP

  • Ask HN: What have you built with LLMs?
    43 projects | news.ycombinator.com | 5 Feb 2024
    I was working on this stuff before it was cool, so in the sense of the precursor to LLMs (and sometimes supporting LLMs still) I've built many things:

    1. Games you can play with word2vec or related models (could be drop in replaced with sentence transformer). It's crazy that this is 5 years old now: https://github.com/Hellisotherpeople/Language-games

    2. "Constrained Text Generation Studio" - A research project I wrote when I was trying to solve LLM's inability to follow syntactic, phonetic, or semantic constraints: https://github.com/Hellisotherpeople/Constrained-Text-Genera...

    3. DebateKG - A bunch of "Semantic Knowledge Graphs" built on my pet debate evidence dataset (LLM backed embeddings indexes synchronized with a graphDB and a sqlDB via txtai). Can create compelling policy debate cases https://github.com/Hellisotherpeople/DebateKG

    4. My failed attempt at a good extractive summarizer. My life work is dedicated to one day solving the problems I tried to fix with this project: https://github.com/Hellisotherpeople/CX_DB8

  • You need a mental model of LLMs to build or use a LLM-based product
    2 projects | news.ycombinator.com | 13 Nov 2023
    My mental model for LLMs was built by carefully studying the distribution of its output vocabulary at every time step.

    There are tools that allow you to right click and see all possible continuations for an LLM like you would in a code IDE[1]. Seeing what this vocabulary is[2] and how trivial modifications to the prompt can impact probabilities will do a lot for improving the mental model of how LLM operate.

    Shameless self plug, but software which can do what I am describing is here, and it's worth noting that it ended up as peer reviewed research.

    [1] https://github.com/Hellisotherpeople/Constrained-Text-Genera...

  • Ask HN: How training of LLM dedicated to code is different from LLM of “text”
    3 projects | news.ycombinator.com | 2 Oct 2023
    Yeah, the LLM outputs a distribution of likely next tokens. It is up to the decoder to select one, and it can use a grammar to enforce certain rules on the output. https://github.com/Hellisotherpeople/Constrained-Text-Genera... or https://github.com/ggerganov/llama.cpp/blob/master/grammars/... for example.
  • Show HN: LLMs can generate valid JSON 100% of the time
    25 projects | news.ycombinator.com | 14 Aug 2023
  • Llama: Add Grammar-Based Sampling
    7 projects | news.ycombinator.com | 21 Jul 2023
    I am in love with this, I tried my hand at building a Constrained Text Generation Studio (https://github.com/Hellisotherpeople/Constrained-Text-Genera...), and got published at COLING 2022 for my paper on it (https://paperswithcode.com/paper/most-language-models-can-be...), but I always knew that something like this or the related idea enumerated in this paper: https://arxiv.org/abs/2306.03081 was the way to go.
  • Understanding GPT Tokenizers
    10 projects | news.ycombinator.com | 8 Jun 2023
    I agree with you, and I'm SHOCKED at how little work there actually is in phonetics within the NLP community. Consider that most of the phonetic tools that I am using to enforce rhyming or similar syntactic constrained in constrained text generation studio (https://github.com/Hellisotherpeople/Constrained-Text-Genera...) were built circa 2014, such as the CMU rhyming dictionary. In most cases, I could not find better modern implementations of these tools.

    I did learn an awful lot about phonetic representations and matching algorithms. Things like "soundex" and "double metaphone" now make sense to me and are fascinating to read about.

  • Don Knuth Plays with ChatGPT
    6 projects | news.ycombinator.com | 20 May 2023
    https://github.com/hellisotherpeople/constrained-text-genera...

    Just ban the damn tokens and try again. I wish that folks had more intuition around tokenization, and why LLMs struggle to follow syntactic, lexical, or phonetic constraints.

  • GPT-3 Creative Fiction
    2 projects | news.ycombinator.com | 19 Apr 2023
    My work on constrained text generation / filter assisted decoding for LLMS is cited in this article! One of my proudest moments was being noticed by my senpai Gwern!

    https://paperswithcode.com/paper/most-language-models-can-be...

    I want to update that just because GPT-4 appears to be far better at following constraints, doesn't mean that it's anywhere near perfect at following them. It's better now at my easy example of "ban the letter e" but if you ask for several constraints, or mixing lexical and phonetic constraints, it gets pretty awful pretty quickly. Filter assisted decoding can make any LLM (no matter how awful they are) follow constraints perfectly.

    I can't wait to get someone whose better at coding than me to implement these techniques in the major LLM frontends (oogabooga, llamma.ccp, etc) since my attempt at it was quite poopy research code: https://github.com/hellisotherpeople/constrained-text-genera...

  • Photoshop for Text
    2 projects | news.ycombinator.com | 18 Oct 2022
    The paper at COLING 2022 that I wrote, titled "Most language models can be poets too" included a GUI constrained text generation studio that I market as being "Like Photoshop but for text"

    https://github.com/Hellisotherpeople/Constrained-Text-Genera...

What are some alternatives?

When comparing outlines and Constrained-Text-Genera you can also consider the following projects:

guidance - A guidance language for controlling large language models.

Constrained-Text-Generation-Studio - Code repo for "Most Language Models can be Poets too: An AI Writing Assistant and Constrained Text Generation Studio" at the (CAI2) workshop, jointly held at (COLING 2022)

jsonformer - A Bulletproof Way to Generate Structured JSON from Language Models

agency - Agency: Robust LLM Agent Management with Go

json-schema-spec - The JSON Schema specification

tokenizer - Pure Go implementation of OpenAI's tiktoken tokenizer

torch-grammar

langroid - Harness LLMs with Multi-Agent Programming

relm - ReLM is a Regular Expression engine for Language Models

TypeChat - TypeChat is a library that makes it easy to build natural language interfaces using types.

fastbpe - Java library implementing Byte-Pair Encoding Tokenization