Use Pydantic for configuration
We have a few configuration classes in the python version like BackendConfig, OpenAIConfig, AzureOpenAIConfig etc. We perform operations like loading these configs from .env files using helper methods like utils.settings::openai_settings_from_dot_env etc. We also have a class named Verify that verifies config values like checking that a value is not None etc. Pydantic is a popular open-source library that is particularly used in such cases. All the above mentioned functionality is built into Pydantic. I propose that we use pydantic for our configuration and replace the Verify class and the helper functions like utils.settings::openai_settings_from_dot_env with pydantic functions.
What are your thoughts on this?
I want to chime in here and say that, based on other open source projects in the LLM space I've seen, using something like pydantic would align us more closely with community standards. When I wrote the initial Python port I tried to make minimal changes from the C# version, but the config classes and the Verify class (and the helpers I've written) are very un-pythonic.
In my opinion, it'd be great to move toward pydantic! (And, related, it may be nice to simplify configuration at some point... I feel like there are so many classes that hold so many of the same values, something like making a PromptTemplate has a lot of "ceremony" around it.)
thanks for the great feedback. Sharing a few notes for the sake of optimizing the port to python: we're redesigning the support for backend and we expect to be a substantial change. The goal is allowing any backend, removing the current first implementation that is very OpenAI centric. The work is still in progress and most probably it will involve how configuration is managed. So it might be worth waiting a couple of weeks until that's sorted out, in case there are reusable ideas, conf files, etc.
@awharrison-28 @mkarle FYI
quick update: work in progress
@dluc can you please update this issue on the latest status?
@awharrison-28 - can you please update target dates/close this issue as needed.
Completed.