The point is that you don’t need a framework for that; the APIs are already similar enough that it should be obvious how to abstract over them using whatever approach is natural in your programming language of choice.
I have a consumer app that swaps between the 5 bigs and wholeheartedly agree, except, God help you if you're doing Gemini. I somewhat regret hacking it into the same concepts as everyone else.
I should have built stronger separation boundaries with more general abstractions. It works fine, I haven't had any critical bugs / mistakes, but it's really nasty once you get to the actual JSON you'll send.
Google's was 100% designed by a committee of people who had never seen anyone else's API, and if they had, they would have dismissed it via NIH. (disclaimer: ex-Googler, no direct knowledge)
Using Llama Index for this via the `llama_index.core.base.llms.base.BaseLLM` interface. Using config files to describe the args to different models makes swapping models literally as easy as:
LiteLLM seemed to be the best approach for what I needed - simple integration with different models (mainly OpenAI and the various Bedrock models) and the ability to track costs / limit spending. It's working really well so far.
Use a consistent argument structure and make a simple class or function for each provider that translates that to the specific API calls. They are very similar APIs. Maybe select the function call based on the model name.
riwsky|1 year ago
refulgentis|1 year ago
I should have built stronger separation boundaries with more general abstractions. It works fine, I haven't had any critical bugs / mistakes, but it's really nasty once you get to the actual JSON you'll send.
Google's was 100% designed by a committee of people who had never seen anyone else's API, and if they had, they would have dismissed it via NIH. (disclaimer: ex-Googler, no direct knowledge)
pveierland|1 year ago
me_vinayakakv|1 year ago
They have the concept of providers [2] and switching between them is easy as changing parameters of a function[3]
[1]:https://sdk.vercel.ai/docs/introduction
[2]: https://sdk.vercel.ai/docs/foundations/providers-and-models
[3]: https://sdk.vercel.ai/docs/ai-sdk-core/overview#ai-sdk-core
spdustin|1 year ago
https://www.litellm.ai/
ponywombat|1 year ago
emporas|1 year ago
ilaksh|1 year ago
Havoc|1 year ago
nosefurhairdo|1 year ago
skeledrew|1 year ago
hyperliner|1 year ago
[deleted]