โ07-22-2025 12:27 PM
Hi,
I am looking for a resource that has examples of using Pydantic with a provisioned LLM on Databricks to get structured output.
I can find many examples of using Pydantic with LLMs, but not on the Databricks.
My use case is to extract text from images using one of the provisioned LLMs on Databricks into a structured format. For the LLM I would like to use Claude. Any help is greatly appreciated.
Regards,
Frank
โ07-22-2025 02:44 PM
Are you looking to use models on batch or in a more traditional framework like LangChain? If the latter, you could use the Pydantic Output Parser with databricks-langchain?:
databricks-langchain ยท PyPI
PydanticOutputParser โ ๐ฆ๐ LangChain documentation
โ07-23-2025 06:50 AM
Thanks for the reply. LangChain is a framework that relies on Pydantic per my understanding. I was trying to keep the number of frameworks to a minimum for my use case which is strictly to get a structured output. I am still learning so perhaps I am approaching this the wrong way?
โ07-23-2025 08:48 AM
I think it depends what your overall usecase is.
In the end, I wouldn't say LangChain is an unecasserily heavy framework, and it carries a lot of tools, docs, and examples which can help you upskill quickly. If you really want to keep it as minimal as possible, then use the openai library. However, as said, I'd personally recommend the LangChain links I've given above.
โ07-23-2025 09:13 AM
Thank you!
Passionate about hosting events and connecting people? Help us grow a vibrant local communityโsign up today to get started!
Sign Up Now