Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

llm-structured-output

Skill by sickn33

Gets typed JSON, enums and objects from LLM responses instead of free-text parsing. Covers OpenAI response_format, Anthropic tool_use and Google Gemini responseSchema for developers building pipelines.

  • Score 89
  • 51k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install llm-structured-output

Built from the published package, never by AI.

git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/llm-structured-output ~/.claude/skills/llm-structured-output

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install llm-structured-output in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill extracts typed, validated data from LLM API responses instead of parsing free text. It covers three main approaches: OpenAI's response_format with JSON Schema, Anthropic's tool_use block used for extraction, and Google's responseSchema in Gemini. It also covers local models that use GBNF grammars or constrained decoding.

The skill guides schema design, including field descriptions, system prompts and validation with Pydantic or Zod. It includes a retry loop for validation failures, capped at three attempts, and guidance on logging. It is aimed at developers building pipelines where LLM output feeds code, such as database writes, API calls or UI rendering. Examples show Python and TypeScript code for each approach.

Written from the project's SKILL.md and checked against it.

What it can do

  • OpenAI Structured OutputsUses response_format with json_schema and strict mode for schema-conformant output.
  • Anthropic tool_use extractionForces a single tool so the data comes back in the tool_use content block.
  • Gemini responseSchemaSets a JSON Schema and application/json MIME type for Gemini responses.
  • Pydantic and Zod schemasDefines models in Python or TypeScript and converts Zod schemas with zodResponseFormat.
  • Validation and retry loopValidates output in application code and retries failed extractions up to three times.
  • Local constrained decodingDescribes GBNF grammars and the --json-schema flag for llama.cpp and vLLM.

What you need

  • Access to OpenAI, Anthropic or Google Gemini APIs
  • Pydantic for Python or Zod for TypeScript

Try asking

  • Extract sentiment, topics and purchase intent from these reviews as JSON.
  • Pull vendor, total and line items from this invoice text into a typed object.
  • Build a Pydantic model for event details and parse this text into it.

Good to know

  • Examples use historical model IDs and need verification before deployment.
  • Strict output support and schema subsets differ by provider and API.
  • Not for free-form text generation or calling real external tools.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/llm-structured-output/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md16 KB

Alternatives to llm-structured-output

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

llm-structured-output: common questions

Does this skill call external tools or APIs?

No. The source says it uses Anthropic's tool_use only as a structured output method, not for actual tool orchestration.

Is JSON mode enough to get reliable output?

The source says json_object mode without a schema only guarantees valid JSON syntax, not schema conformance. It recommends json_schema with a full schema definition.

Can I trust a schema-valid LLM result?

The source says a schema-valid value is untrusted data. It should not authorize a database write or external call without checks in application code.

How do I install llm-structured-output?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is llm-structured-output free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is llm-structured-output safe to use?

It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to llm-structured-output?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

llm-structured-output Install

Add to stack

Loading.