MLServer icon indicating copy to clipboard operation
MLServer copied to clipboard

Add support for Pydantic V2

Open stephen37 opened this issue 1 year ago • 9 comments

MLServer only supports Pydantic V1, which is a problem for us as we would like to move to Pydantic V2 for all our services using Pydantic.

Do you think MLServer could support it?

stephen37 avatar Sep 28 '23 13:09 stephen37

Hey @stephen37 ,

That's a great suggestion - thanks for bringing it up.

Good news are that there's already some WIP to update to Pydantic V2. Although it's lower priority than other stuff, so it may take a while to complete.

adriangonz avatar Oct 03 '23 13:10 adriangonz

Nice to hear that, is there a specific branch where the work is happening? I am asking as I could share it with some of our engineers if they want to help as well for that.

stephen37 avatar Oct 05 '23 08:10 stephen37

Any updates on this? Also waiting for this one to be released 🙏

dolshevsk avatar Oct 23 '23 10:10 dolshevsk

Hi @adriangonz, any updates on this issue ? Unfortunately as much as we want to use seldon, we are currently blocked by adopting the mlserver due to this issue, would be great if this can be added soon 🙏

moefsadek avatar Jan 22 '24 21:01 moefsadek

Hey @moefsadek ,

I'm no longer working in Seldon, but @sakoush has taken over the reins of the MLServer project - so it may be worth checking with him on what's the status of this one.

adriangonz avatar Jan 22 '24 23:01 adriangonz

Hi @stephen37, @dolshevsk and @moefsadek -- We are currently working on the migration to Pydantic v2, and just need to finalize some dependency conflicts with other tools our runtimes depend on. We know about the speed improvements and the cool new features Pydantic v2 has to offer so we look forward to moving MLServer to it. We should have an update on this soon.

ramonpzg avatar Jan 24 '24 08:01 ramonpzg

Hey @ramonpzg , Thanks for the work you're putting into this 🙏 I was on my way straight to dependency hell today as well and the pydantic-v1-requirement of MLServer was also involved in that endeavor ;) Sorry that I have to ask again, but can you already share when we might expect this? Thanks again!

mkurovski1 avatar Mar 14 '24 17:03 mkurovski1

Hey @ramonpzg ! Would you consider something like this in the meantime? https://github.com/SeldonIO/MLServer/pull/1651

This would make MLServer compatible with both versions of Pydantic.

privatedumbo avatar Apr 01 '24 15:04 privatedumbo

@privatedumbo: Thank you for your suggestion! It's on our (my) radar to have a look at.

jesse-c avatar Apr 16 '24 09:04 jesse-c

I've merged in support for Pydantic v2. We don't have a timeline for the next release that will have it, but we're actively workin on it.

jesse-c avatar May 10 '24 15:05 jesse-c