AI engineering glossary · Prompt context engineering

What is outlines library?

Outlines library: An open-source Python library for guiding text generation with regular expressions, JSON Schemas and grammars, by restricting the tokens the model can pick at each step. It works with local open-weights models.

Level: advancedTopic: Prompt context engineering

Outlines library: an example

Use Outlines with a schema so a local model must output {"city": string, "pincode": 6-digit string}.

Related terms

More Prompt context engineering terms

Where you learn it

Outlines library is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.