Back to directory

Outlines

A Python library that guarantees structured output from a language model during generation itself, by specifying a desired output type such as a Python literal, an integer or a Pydantic model, rather than parsing or fixing the output afterward.

Outlines

Outlines guarantees structured outputs from a large language model during generation, rather than trying to fix unpredictable output afterward with parsing, regular expressions or other fragile code.

Its API mirrors Python's own type system: a call passes the desired output type directly, from a Literal for a yes or no answer, to an int for a numeric value, to a Pydantic model for a complex object, and Outlines ensures the generated data matches that structure exactly. The same code runs across different model backends, including OpenAI, Ollama and vLLM, so switching providers does not require changing the calling code.

It installs from PyPI and is written in Python, released under the Apache 2.0 license.

More in Libraries

See all 292
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • TradeCanvas

    bonguynvan.github.io

    A zero-dependency canvas charting engine for building TradingView-style trading charts in JavaScript, with 66 technical indicators, 24 drawing tools, 17 chart types, and real-time streaming.

  • 3d retro graphics

    3d-retro.com

    A free, CC0-licensed library of copy-paste retro 3D and demoscene graphics effects, such as plasma, raytracing, and voxel terrain, runnable as WebGL 1 or plain 2D canvas.