Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Suppose I’ve written code that calls the OpenAI API. Is there some library that helps me easily switch to a local/other LLM. I.e a library that (ideally) provides the same OpenAI interface for several models, or if not then at least the same interface.



There's the OpenedAI-API extension for text-generation-webui: https://github.com/oobabooga/text-generation-webui/tree/main...


Found a couple others that do something like this. Turns out I had bookmarked them a while ago.

https://github.com/r2d4/openlm

https://github.com/hyperonym/basaran


OpenLLM plan to provide an OpenAI-compatible API, which allows you to even use OpenAI's python client to talk to OpenLLM, user just need to change to Base URL to point to your OpenLLM server. This feature is working-in-progress.


Langchain offers abstraction across many LLMs, including OpenAI’s.


Langchain might be what you need.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: