Outlines enforces structure at the token level, so your LLM outputs valid JSON, XML, or regex-matched text every time. It works by converting schemas (Pydantic models, JSON schemas, regexes) into finite state machines that filter invalid tokens during generation. You get type-safe outputs with zero parsing errors, and it actually speeds up inference by fast-forwarding through deterministic paths. Works with local models via Transformers, vLLM, or llama.cpp, which matters if you're running 8B models locally and need guaranteed structure without the back-and-forth of prompt engineering. From dottxt.ai with 8,000+ stars. Use it when you're tired of LLMs hallucinating malformed JSON or need production-grade structured extraction.
npx skills add https://github.com/orchestra-research/ai-research-skills --skill outlines