fix: fetch the audio model catalogues for Eden AI services - #438
Open
MVS-source wants to merge 1 commit into
Open
MVS-source wants to merge 1 commit into
MVS-source wants to merge 1 commit into
Conversation
Signed-off-by: Victor M. SMITH <72023257+MVS-source@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.