monarch-initiative / ontogpt

LLM-based ontological extraction tools, including SPIRES
https://monarch-initiative.github.io/ontogpt/
BSD 3-Clause "New" or "Revised" License
548 stars 68 forks source link

OpenAI base URL #371

Open syaikhipin opened 1 month ago

syaikhipin commented 1 month ago

I'm interested in using OntoGPT with an OpenAI-compatible base URL. Currently, OntoGPT seems to be designed for use with the official OpenAI API.

Could you please consider adding support for OpenAI-compatible base URLs? This would allow users to leverage alternative providers that offer similar functionality to OpenAI.

Benefits:

Increased flexibility for users who might have access to different API keys or prefer alternative providers. Potential for cost savings if other providers offer more competitive pricing. Possible Implementation:

If feasible, could OntoGPT accept a configuration option for specifying the base URL? This would enable users to choose between the official OpenAI API and compatible alternatives.

caufieldjh commented 1 month ago

Hi @syaikhipin - this would indeed be helpful. For now, I think a combination of litellm (https://github.com/BerriAI/litellm) and llm (https://github.com/simonw/llm) should be an effective workaround. The latter is already installed as an OntoGPT dependency. This is the basic idea: