Towards Data Science

Pydantic + OpenAI: The Cleanest Way to Get Structured Outputs from LLMs

How to stop parsing JSON by hand and start trusting your model's output The post Pydantic + OpenAI: The Cleanest Way to Get Structured Outputs from LLMs appeared first on Towards Data Science .

Towards Data Science
Aug 31

Your LLM Can Return Perfect JSON and Still Be Wrong

The article discusses insights gained from a deeper examination of Structured Outputs when dealing with messy, incomplete data. It highlights that even when a large language model returns perfectly formatted JSON, the content can still be incorrect. The author reflects on the implications of this observation for data science practices.

By Benjamin Nweke
Towards Data Science
Sep 1

Your JSON Is Valid but Your Data Is Wrong: Five Failure Modes LLM Structured Outputs Won't Catch

The article discusses five failure modes that can slip through constrained decoding in large language models, explaining why these errors are not detected by schema validators. It highlights that even when JSON output is syntactically valid, the underlying data can still be incorrect. The post serves as a warning that relying solely on schema validation is insufficient for ensuring correct structured outputs from LLMs.

By Mostafa Ibrahim
Towards Data Science
Sep 28

How to Make Your Own JEV Model from an Open LLM

The article explains how to transform a small open‑source Qwen LLM into a fast, single‑pass text classifier by replacing its language‑modeling head with a JEV model. It provides a step‑by‑step guide to swapping the head, enabling the LLM to perform classification tasks efficiently. The process leverages the flexibility of open‑source models to create a lightweight, high‑performance classifier.

By Anubhab Banerjee
Simon Willison
Nov 14

datasette-llm 0.1a11

The release of datasette-llm 0.1a11 introduces support for OpenAI‑compatible endpoints, allowing Datasette to use locally hosted LLMs such as those run with LM Studio, Ollama, or llama.cpp. Users can configure Datasette to connect to these models via a simple JSON configuration and run the server with uvx, enabling a local Datasette Agent powered by the chosen model. The update expands the plugin’s flexibility by enabling integration with any LLM that follows the OpenAI web protocol.

Simon Willison
Sep 7

llm 0.35

The article announces the release of llm version 0.35, which introduces a new OpenAI model named gpt-6-astra for GPT-6 Astra. It highlights the addition of this model to the llm library and tags the release with openai, llm, and gpt-6-astra.

Towards Data Science
Aug 20

How to Fine-Tune an LLM: An End-to-End Guide

The article "How to Fine-Tune an LLM: An End-to-End Guide" offers a practical, hands‑on walkthrough for fine‑tuning large language models in real‑world scenarios. It covers the entire process from data preparation to deployment, providing readers with actionable steps to adapt LLMs to specific tasks. The guide is aimed at practitioners looking to implement fine‑tuning in a structured, end‑to‑end manner.

By Sam Black
Simon Willison
Oct 6

llm-openai-decisions 0.1a0

Simon Willison announces the release of the llm-openai-decisions 0.1a0 plugin, which interfaces with OpenAI’s new Jev-style Decisions API. The plugin, inspired by llm-typesafe, supports image and text input and offers the same three question types (yes/no, choices, scores) as Jev, with pricing at 10¢ per million input tokens. Installation is simple via `llm install llm-openai-decisions`, and an example query demonstrates image-based evaluation.