Support external Hosts

Created on 29 December 2024, about 1 month ago

Problem/Motivation

We try to use an openAI compatible API. In OpenAiProvider the config-item `host` is supported - see code. But in OpenAiConfigForm the OpenAi-Client is loaded without custom host - see code so a choise of models is not possible.

Proposed resolution

  • Add UI for Host
  • Use \OpenAI::factory() like here.
Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany jan kellermann

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jan kellermann
  • 🇩🇪Germany marcus_johansson

    Regarding the code in the validation, that should be fixed for sure, since we offer it.

    The host conifg is mostly there for testing against spoof apis and for the initial users that were using it for Azure OpenAI. However for the later there is a real provider now.

    I don't think we want to expose the host in the GUI, because there is so much magic happening when the models are loaded that it would be unusable outside of OpenAI/Azure/OpenAI proxies. So opening up the setting in GUI might just lead to confusion and a lot of issues being created here why a specific provider X can't be used even if its OpenAI compatible. See here: https://git.drupalcode.org/project/ai_provider_openai/-/blob/1.0.x/src/P...

    I think the better solution is to create a generic provider for openai compatible providers, without all the magic we add in the OpenAI module to make it easy to use. WDYT?

Production build 0.71.5 2024