AI & JSON — LLM Output, Schemas & Agents
Getting reliable JSON from LLMs, structured outputs, function calling, validation, and AI agent tooling.
How Constrained Decoding Forces Valid JSON: XGrammar, Outlines & GBNF
The mechanism under 'JSON mode': how a JSON Schema becomes a grammar that masks illegal tokens at generation time, why XGrammar beats retries, and where constrained decoding still bites.
Vercel AI SDK Structured Output: Type-Safe JSON with generateObject & Zod
Get type-safe JSON from LLMs with the Vercel AI SDK's generateObject and streamObject — validated against a Zod schema, with automatic retries.
Pydantic AI: Type-Safe Structured Output and Agents in Python
Pass a Pydantic BaseModel as output_type and Pydantic AI returns validated, typed JSON from any LLM — retrying automatically when a field is wrong.
OpenAI Responses API vs Chat Completions: What Changes in Your JSON
How OpenAI's Responses API changes your JSON vs Chat Completions: typed items, an output array, structured outputs in text.format, and server-side state.
Structured JSON from Local LLMs with Ollama
Use Ollama's format parameter to force any local LLM's output to match a JSON Schema — reliable, type-safe JSON via constrained decoding, often faster.
Google Gemini Structured Output: responseSchema and JSON Mode
Constrain Google Gemini to a JSON Schema with responseMimeType and responseSchema. Learn the request shape, propertyOrdering, enums, and OpenAI differences.
RAG JSON Formats Explained: Documents, Chunks, Vectors & Citations
Every JSON shape in a retrieval-augmented generation pipeline — documents, chunks, embeddings, vector queries, retrieved matches and cited answers — with copy-ready examples for each stage.
JSON for AI & LLM Engineering: Every Response Shape You'll Parse
A field guide to the JSON behind modern AI apps — OpenAI and Claude responses, tool calling, MCP, embeddings, RAG, agents, structured output and more, each with a copy-ready example.
Preparing Fine-Tuning Data: The JSONL Format Explained
Fine-tuning an LLM means formatting examples as JSONL. Learn the chat message schema, validation, common errors, and how to build a clean training file.
Computer Vision JSON: COCO Format, Bounding Boxes & Annotations
The JSON behind object detection and image annotation — COCO format, bounding box conventions, and how tools like YOLO and Label Studio structure vision data.