Dealing with Structured Outputs (pydantic) 📝 #63

Open
opened 2026-02-15 16:27:48 -05:00 by yindo · 0 comments
Owner

Originally created by @adriens on GitHub (Mar 30, 2024).

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 ?

Originally created by @adriens on GitHub (Mar 30, 2024). # :grey_question: 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: - [Llama Index](https://docs.llamaindex.ai/en/stable/module_guides/querying/structured_outputs/) - [Query Engine with Pydantic Outputs](https://docs.llamaindex.ai/en/stable/examples/query_engine/pydantic_query_engine/) - [LLM Pydantic Program](https://docs.llamaindex.ai/en/stable/examples/output_parsing/llm_program/) - [LLM Structured Output for Function Calling with Ollama](https://www.youtube.com/watch?v=_-FrUReljTQ) - [Langchain Ollama Functions](https://js.langchain.com/docs/integrations/chat/ollama_functions) - [OllamaFunctions python](https://python.langchain.com/docs/integrations/chat/ollama_functions) # :dart: The question Would there be a way to achieve this from sdk ?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#63