• Picks
  • Discover
  • Alternatives
  • About

© 2026 Willet

  • Newsletter
  • About
  • FAQ
  • Terms
  • Privacy & Cookies
Join the Discord (opens in a new tab)
.txt avatar

Outlines

Python library that constrains LLM generation to schemas and grammars

  • Agent frameworks and tools
  • AI models and runtimes
View on GitHub
Website

What it is

Outlines is a Python library that forces language model output to match a given type, regex, JSON schema, Pydantic model, or context-free grammar while tokens are being generated, instead of fixing output afterward. The same code works across backends such as Hugging Face Transformers, vLLM, Ollama, and OpenAI. Developers building extraction, classification, or function-calling pipelines use it to get valid, parseable results every time, and it also includes reusable prompt templates.

Images

Facts

Stars
15,960 GitHub stars.
15,960

Forks
909
Commits
1,325
Contributors
179
Language
Python
License
Apache-2.0
Last commit
Aug 24, 2026
On GitHub since
March 2023
First release
May 2023
Platforms
library
Self-hostable
No
Tags
  • llm-inference
  • structured-output
  • prompt-engineering

Last synced from GitHub on Oct 20, 2026

The 10 best overlooked open-source projects, every Monday.

Share and more

Comments

No comments yet. Start the conversation.

Similar projects

  • Antoine avatar

    forge

    Reliability layer that makes local LLM tool calls succeed more often

    2.3k
  • Google avatar

    LangExtract

    Python library for pulling structured, source-linked data out of text with LLMs

    39k
  • Vercel Labs avatar

    json-render

    Framework for rendering AI-generated JSON specs as UI from your own components

    18.7k

What people are saying

Updated Oct 21, 2026
  • Bluesky“If you are a fan of OpenAI's structured outputs with pydantic, then check out outlines. It achieves similar results with open-source models. It let's you use…”Nov 14, 2024 · 11 likes · 0 replies (opens Bluesky in a new tab)
  • Hacker NewsOutlines v0.1.0 release: 98% reduction in runtime overheadOct 8, 2024 · 3 points · 1 comment (opens Hacker News in a new tab)
  • Hacker NewsOutlines – Structured Outputs for LLMsOct 16, 2026 · 3 points · 0 comments (opens Hacker News in a new tab)
  • Bluesky“Just in case unclear I mean adhere less in the sense of "obey schema without mistakes" and more as in reduce effort for model to attend more easily to the…”May 5, 2026 · 1 like · 1 reply (opens Bluesky in a new tab)
  • Hacker NewsOutlines – Structured Outputs from LLMsApr 14, 2025 · 2 points · 0 comments (opens Hacker News in a new tab)
  • Bluesky“No, constrained decoding. This works on all models with no fine-tuning required.”Feb 12, 2025 · 1 like · 1 reply (opens Bluesky in a new tab)
  • Hacker NewsRobust (Structured) Text GenerationOct 16, 2024 · 2 points · 0 comments (opens Hacker News in a new tab)
  • Bluesky“@mitsuhiko.at , thanks for sharing this and helping grow the community here! Also happy and with claude code. Surely missing something, but where would…”Jun 22, 2025 · 0 likes · 1 reply (opens Bluesky in a new tab)
  • Bluesky“To add to the structured generation recommendations, is designed for locally run models, can run on top of HF Transformers or Llama.cpp and provides a…”Sep 26, 2024 · 0 likes · 1 reply (opens Bluesky in a new tab)
  • Bluesky“dottxt-ai / outlines Structured Outputs”Aug 7, 2026 · 0 likes · 0 replies (opens Bluesky in a new tab)
  • Bluesky“If you like this stuff, go check out our docs + demos:”Jan 10, 2025 · 0 likes · 0 replies (opens Bluesky in a new tab)