-
Notifications
You must be signed in to change notification settings - Fork 24
Added support for OpenRouter & Generic Models #203
Conversation
Hi, thanks for the idea and I like the Was just creating an API key for openrouter, was running the example you pushed and got this error:
does it work for you? btw, this should fix the codestyle issues in the pipeline:
or to run the entire quality pipeline locally:
|
Could you add var_dump($data) just before line 54 in src/Bridge/OpenRouter/Client.php and run again? Inside the if statement just before the "throw new". Could be a bunch of different errors (auth, out of credits, servers down, etc...). I am working on a better way to report errors to the user (for all providers), I will make it a separate pull request. Yes I will run the linter, thanks for the heads up. |
You are right, just tried it again with The error handling is something to improve in general. I would love to also have a more generalistic approach, but also the error responses depend on the specific model and platform. so a combination could be worth exploring 🤔 like a better default error handling and an extension point per platform/model that enables bridges to fine-tune specifics of error handling. |
So, all in all, thanks for the PR, happy to merge once the pipeline is green :) 👍 |
Should be good to merge now 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rglozman! 👍
I'm currently working on an integration for Hugging Face and I think `$version` is misleading since this could also use quite different Models of one family. Looking more into the direction of `GenericModel` what we saw already with #203 https://github.com/php-llm/llm-chain/blob/main/src/Bridge/OpenRouter/GenericModel.php WDYT @OskarStark @DZunke
Added support for OpenRouter which hosts over 300 models. This includes support for models from every provider into one easy to use API.
I created an example using Gemini (free model hosted by google), updated the .env, and the README.