====== Structured Outputs ====== ===== LangChain ===== * **Website**: [[https://www.langchain.com/]] * **GitHub**: [[https://github.com/langchain-ai/langchain]] * **Features**: * Offers `.with_structured_output()` method * PydanticOutputParser * StructuredOutputParser ===== Instructor ===== * **GitHub**: [[https://github.com/jxnl/instructor]] * **PyPI**: [[https://pypi.org/project/instructor/]] * **Features**: * Built on Pydantic * Facilitates generating structured output from LLMs ===== Marvin ===== * **Website**: [[https://www.askmarvin.ai/]] * **GitHub**: [[https://github.com/PrefectHQ/marvin]] * **Features**: * Tool for building reliable natural language interfaces * Supports structured output capabilities ===== BAML ===== * **Website**: [[https://www.baml.dev/]] * **GitHub**: [[https://github.com/baml-lang/baml]] * **Features**: * Domain-specific language for writing and testing LLM functions ===== Pydantic ===== * **Website**: [[https://docs.pydantic.dev/]] * **GitHub**: [[https://github.com/pydantic/pydantic]] * **Features**: * Often used with other libraries to define and validate structured output schemas ===== Magentic ===== * **GitHub**: [[https://github.com/jackmpcollins/magentic]] * **PyPI**: [[https://pypi.org/project/magentic/]] * **Features**: * Works with Pydantic to generate complex structured outputs from LLMs ===== llm-structured-output ===== * **GitHub**: [[https://github.com/KillianLucas/llm-structured-output]] * **PyPI**: [[https://pypi.org/project/llm-structured-output/]] * **Features**: * Constrains LLM generation to structured output * Includes function calling and JSON schema enforcement ===== LlamaIndex ===== * **Website**: [[https://www.llamaindex.ai/]] * **GitHub**: [[https://github.com/jerryjliu/llama_index]] * **Features**: * Supports both prompting and function calling for structured output ===== spacy-llm ===== * **GitHub**: [[https://github.com/explosion/spacy-llm]] * **PyPI**: [[https://pypi.org/project/spacy-llm/]] * **Features**: * Uses prompting for generating structured output ===== Outlines ===== * **GitHub**: [[https://github.com/outlines-dev/outlines]] * **PyPI**: [[https://pypi.org/project/outlines/]] * **Features**: * Employs constrained token sampling for structured output generation ===== Guidance ===== * **GitHub**: [[https://github.com/microsoft/guidance]] * **PyPI**: [[https://pypi.org/project/guidance/]] * **Features**: * Uses constrained token sampling for structured outputs