Skip to content

fix: fetch the audio model catalogues for Eden AI services - #438

Open
MVS-source wants to merge 1 commit into
nextcloud:mainfrom
MVS-source:feat/edenai-audio-catalogues
Open

MVS-source wants to merge 1 commit into
nextcloud:mainfrom
MVS-source:feat/edenai-audio-catalogues

Conversation

@MVS-source

Copy link
Copy Markdown

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/models returns 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 today
  • GET /v3/audio/speech/models, 15 models today

getModels() only reads models, so those two are never seen and the audio selectors have nothing to offer. The calls themselves are fine: audio/transcriptions and audio/speech appended 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 ModelSelector is 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.
  • A failure on either audio catalogue is logged and skipped rather than raised. The text models have already been retrieved at that point and are usable on their own, so an outage on one catalogue does not take text generation down with it.

Why the European endpoint is detected too

Eden AI serves https://api.eu.edenai.run/v3 next 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/models returns 1100 models and not one of them is an audio model
  • GET /v3/audio/transcriptions/models returns 65 entries, each carrying an id, so they pass isModelListValid()
  • GET /v3/audio/speech/models returns 15 entries, same shape
  • the EU endpoint returns 6 and 5 on the same two routes

I 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.

Signed-off-by: Victor M. SMITH <72023257+MVS-source@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant