Repository navigation
fix: fetch the audio model catalogues for Eden AI services - #438
Conversation
There was a problem hiding this comment.
Hey there, we appreciate your enthusiasm and effort for making this connection happen! However, as already mentioned in #398, it is getting difficult for us to keep adding special cases/modifications for other services that are not 100% compliant with the OpenAI API specification. We can merge this special case in the meantime, but in the long term, we would prefer that you modify your API so that, e.g., all of the audio models are retrievable from /models too and not from any custom endpoints like /audio/transcriptions/models. Also, we will remove the mention of the EU endpoint from the README.md in a separate PR as Mistral and IONOS offer similar services too.
Signed-off-by: Victor M. SMITH <72023257+MVS-source@users.noreply.github.com>
db17b27 to
dde0457
Compare
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
The problem
When a service points at Eden AI, the transcription and speech model selectors in the admin settings stay empty, while the text one fills normally.
Eden AI keeps one catalogue per modality.
GET /v3/modelsreturns the text models, around 1100 of them, and no audio model at all. Speech to text and text to speech have their own endpoints:GET /v3/audio/transcriptions/models, 65 models todayGET /v3/audio/speech/models, 15 models todaygetModels()only readsmodels, so those two are never seen and the audio selectors have nothing to offer. The calls themselves are fine:audio/transcriptionsandaudio/speechappended to the service URL are real Eden AI routes, so once a model id is set, transcription and speech both work.An admin can work around it today by typing the ids by hand, since
ModelSelectoris taggable, but nothing says so and the empty list reads as broken.The change
Same shape as #404, which fixed the mirror image of this for OpenRouter, where the default listing filtered out non-LLM models. There the remedy was a query parameter, here it is two extra requests.
ServiceConfig::isUsingEdenAi(), alongside the existing OpenRouter, Mistral and IONOS detections, matching the global endpoint and the European one.getModels()merges the two audio catalogues when the service is Eden AI.Why the European endpoint is detected too
Eden AI serves
https://api.eu.edenai.run/v3next to the global endpoint. It exposes only models cleared for processing in the EU and refuses anything served elsewhere, which is what instances with GDPR constraints point at. The detection covers both hosts, and the audio catalogues there really are different: 6 transcription models and 5 speech models instead of 65 and 15. Matching only the global host would have left empty selectors in front of exactly the admins who care most about where their audio is processed.I also added Eden AI to the list of OpenAI-compatible services in the README, next to IONOS and Plusserver, with a line about that endpoint.
Testing
Verified directly against the live endpoints, which need no credentials:
GET /v3/modelsreturns 1100 models and not one of them is an audio modelGET /v3/audio/transcriptions/modelsreturns 65 entries, each carrying anid, so they passisModelListValid()GET /v3/audio/speech/modelsreturns 15 entries, same shapeI added a unit test for the URL detection, covering both hosts, mixed case and a negative case.
What I did not run: PHP is not installed on the machine I wrote this on, so php-cs-fixer, psalm and phpunit have not been run locally and I am relying on CI for them. I matched the surrounding formatting by hand. Tell me what CI flags and I will turn it around quickly.
Disclosure
I work at Eden AI. This came from a Nextcloud admin who hit the empty selectors and worked out the cause himself before reporting it.