ollama / ollama/ollama-python

:grey_question: Dealing with Structured Outputs (`pydantic`) :memo:

Open
#108 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.5k
Forks
1.2k
Avg merge
4m
Merged PRs (30d)
1

Description

❔ About

ollama-python is a very very convenient way to deal with local LLMs. Actually we can do a lot of stuff from the sdk facade, and I do now wonder if there are some code snippets to achieve Structured Outputs for SDK, or eventually around, see:

🎯 The question

Would there be a way to achieve this from sdk ?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ollama-python SDK facade and the linked LlamaIndex and LangChain Pydantic examples to determine what structured-output support is already exposed. There are no files or tests named in the issue. Done means documenting a confirmed SDK approach with a working Pydantic example, or narrowing the request into a concrete implementation scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.