FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Instructor Has a Free Library That Forces LLMs to Return Structured Data
How-ToProgramming Languages

Instructor Has a Free Library That Forces LLMs to Return Structured Data

via Dev.to PythonAlex Spinov3h ago

LLMs return strings. Your application needs objects. Instructor patches OpenAI's client to return validated, typed data structures using Pydantic models. No more parsing JSON from markdown blocks. What Instructor Gives You for Free Structured extraction — LLM outputs validated against Pydantic/Zod schemas Automatic retries — if validation fails, it re-prompts with the error Streaming — partial objects stream as they're generated Multiple providers — OpenAI, Anthropic, Google, Mistral, Ollama, LiteLLM Python & TypeScript — first-class support for both Lightweight — patches existing clients, not a framework Quick Start (Python) pip install instructor openai import instructor from openai import OpenAI from pydantic import BaseModel client = instructor . from_openai ( OpenAI ()) class User ( BaseModel ): name : str age : int email : str user = client . chat . completions . create ( model = " gpt-4o-mini " , response_model = User , messages = [{ " role " : " user " , " content " : " Extract

Continue reading on Dev.to Python

Opens in a new tab

Read Full Article
0 views

Related Articles

Red Rooms makes online poker as thrilling as its serial killer
How-To

Red Rooms makes online poker as thrilling as its serial killer

The Verge • 2h ago

Don’t Know What Project to Build? Here Are Developer Projects That Actually Make You Better
How-To

Don’t Know What Project to Build? Here Are Developer Projects That Actually Make You Better

Medium Programming • 3h ago

Why Most Developers
Stay Broke
How-To

Why Most Developers Stay Broke

Medium Programming • 5h ago

Building a Simple Lab Result Agent in .NET (Microsoft Agent Framework + Ollama)
How-To

Building a Simple Lab Result Agent in .NET (Microsoft Agent Framework + Ollama)

Medium Programming • 6h ago

“You don’t need to learn programming anymore” — Reality Check from a CTO
How-To

“You don’t need to learn programming anymore” — Reality Check from a CTO

Medium Programming • 7h ago

Discover More Articles