llm-structured-output

Featured

Get reliable JSON, enums, and typed objects from LLMs using response_format, tool_use, and schema-constrained decoding across OpenAI, Anthropic, and Google APIs.

AI & Automation 39,350 stars 6386 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# LLM Structured Output ## What This Skill Does Extract typed, validated data from LLM API responses instead of parsing free-text. This skill covers the three main approaches: OpenAI's `response_format` with JSON Schema, Anthropic's `tool_use` block for structured extraction, and Google's `responseSchema` in Gemini. You will learn when each approach works, when it breaks, and how to build retry logic around schema validation failures that every production system encounters. ## When to Use This Skill - The user needs to extract structured data (JSON objects, arrays, enums) from an LLM response - The user is building a pipeline where LLM output feeds directly into code (database writes, API calls, UI rendering) - The user asks about `response_format`, `json_mode`, `json_object`, or `json_schema` in OpenAI - The user asks about using Anthropic's `tool_use` or `tool_result` blocks for data extraction (not for actual tool execution) - The user asks about Zod schemas with `zodResponseFormat()` from the `openai` npm package - The user needs to parse LLM output into Pydantic models using `instructor`, `marvin`, or manual validation - The user is getting malformed JSON, missing fields, or wrong types from LLM responses and needs a fix - The user asks about `controlled generation`, `constrained decoding`, or `grammar-based sampling` in local models Do NOT use this skill when: - The user wants free-form text generation (summaries, essays, chat) - The user is asking about Zod for fo...

Details

Author
sickn33
Repository
sickn33/antigravity-awesome-skills
Created
4 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Data & Documents Solid

structured-data

JSON-LD schema markup and validation.

1,160 Updated today
a5c-ai
AI & Automation Listed

schema-generator

Generates JSON-LD structured data, llms.txt, and robots.txt snippets for AEO/GEO (answer engine and generative engine optimization). Converts aeo-geo-2026 reference recommendations into executable templates. Use when user asks about schema markup, JSON-LD templates, structured data, AEO 실행, GEO 구현, llms.txt, citation capsule, FAQPage, HowTo, OpinionArticle, or 구조화 데이터.

3 Updated today
Yoodaddy0311
Data & Documents Listed

gemini-structured-output

Get validated JSON out of Gemini using a Pydantic model - convert the model to responseSchema, set responseMimeType, then parse and validate the response, with a salvage parser for JSON wrapped in prose. Use for gemini structured output, gemini json schema, pydantic to gemini, or responseSchema.

0 Updated 3 days ago
barobaonguyen
AI & Automation Solid

instructor

Extract structured data from LLM responses with Pydantic validation, retry failed extractions automatically, parse complex JSON with type safety, and stream partial results with Instructor - battle-tested structured output library

175,435 Updated today
NousResearch
Data & Documents Listed

json-to-llm-context

Turn JSON or PostgreSQL jsonb payloads into compact readable context for LLMs. Use when a user wants to compress JSON, reduce token usage, summarize API responses, or convert structured data into model-friendly text without dumping raw paths.

335 Updated today
aiskillstore