json-schema-spec VS outlines

Compare json-schema-spec vs outlines and see what are their differences.

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
WorkOS - The modern identity platform for B2B SaaS
The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
workos.com
featured
json-schema-spec outlines
29 31
3,219 5,649
6.6% 18.1%
7.9 9.7
8 days ago 4 days ago
JavaScript Python
GNU General Public License v3.0 or later 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.

json-schema-spec

Posts with mentions or reviews of json-schema-spec. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-29.

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-04-30.
  • 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:")
  • Ollama Python and JavaScript Libraries
    17 projects | news.ycombinator.com | 24 Jan 2024
    There are "smaller" models, for example tinyllama 1.1B (tiny seems like an exaggeration). PHI2 is 2.7B parameters. I can't name a 500M parameter model but there is probably one.

    The problem is they are all still broadly trained and so they end up being Jack of all trades master of none. You'd have to fine tune them if you want them good at some narrow task and other than code completion I don't know that 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 call, although it could still be nonsense if the model doesn't understand, it will just match the regex. There are other similar tools around.

What are some alternatives?

When comparing json-schema-spec and outlines you can also consider the following projects:

guidance - A guidance language for controlling large language models.

uplaybook - A python-centric IT automation system.

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

nix-configs - My Nix{OS} configuration files

torch-grammar

OpenAPI-Specification - The OpenAPI Specification Repository

Constrained-Text-Genera

langroid - Harness LLMs with Multi-Agent Programming

ajv - The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)

llama.cpp - LLM inference in C/C++