dottxt-ai/outlines ? reverse-engineered prompt
Reverse engineered prompt
Build me a Python library for structured outputs from language models, so I can give it a prompt plus a target type, and it reliably returns data that matches that shape. I want it to work with common model backends like Hugging Face, OpenAI style APIs, Ollama, and similar providers, without me having to rewrite my app when I switch models.
Make it easy to use with simple types like yes or no, numbers, and text, but also with more complex Pydantic models, enums, lists, and nested objects. The main goal is that the model output is valid and predictable instead of messy text that I have to clean up after the fact.
Please include a few real examples, like classifying sentiment, extracting fields from customer emails, and building structured reviews or tickets. If anything needs current model or provider details, look up the latest docs online and wire it up in a clean, modern way.
Are you gonna build this?
make sure you review the code using coderabbit