# Structured outputs

DevFeed: [Structured outputs](<https://devfeed.tech/articles/structured-outputs-83411.md>)

Original publisher: [Read original article](<https://ollama.com/blog/structured-outputs>)

Published: 2024-12-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ollama](<https://devfeed.tech/sources/ollama.md>)

Topics: [JSON](<https://devfeed.tech/topics/json.md>), [Ollama](<https://devfeed.tech/topics/ollama.md>), [JSON Schema](<https://devfeed.tech/topics/json-schema.md>), [Pydantic](<https://devfeed.tech/topics/pydantic.md>), [NativeScript](<https://devfeed.tech/topics/nativescript.md>)

Tags: [javascript](<https://devfeed.tech/tags/javascript.md>), [json](<https://devfeed.tech/tags/json.md>), [json-schema](<https://devfeed.tech/tags/json-schema.md>), [ollama](<https://devfeed.tech/tags/ollama.md>), [python](<https://devfeed.tech/tags/python.md>)

## AI overview

Ollama adds structured outputs that constrain model responses to a JSON Schema. The article shows how to use the feature with Ollama's Python and JavaScript libraries, cURL, Pydantic, and Zod, including examples for extracting data from text and describing images.

## Source excerpt

Ollama now supports structured outputs making it possible to constrain a model's output to a specific format defined by a JSON schema. The Ollama Python and JavaScript libraries have been updated to support structured outputs.