Problem/Motivation

LiteLLM host and api_key are usually environment-specific. A typical use case is to expose their values as environment variables and then map the envs to config in settings.php.
The settings form of the module always uses the non-overridden values to query for key data, resulting in errors on environments where the host or the key was overridden.

Steps to reproduce

Override the host configuration in settings.php, like: $config['ai_provider_litellm.settings']['host'] = getenv('LITELLM_HOST');. The keyInfo call used on LiteLlmAiConfigForm always uses the stored config, instead of the overridden ones.

Proposed resolution

Load the overridden configuration to call the keyInfo endpoint in the settings form.

Remaining tasks

implement it

User interface changes

none

API changes

none

Data model changes

none

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lussoluca created an issue. See original summary.

lussoluca’s picture

Issue summary: View changes

lussoluca’s picture

Assigned: lussoluca » Unassigned
Status: Active » Needs review
gxleano’s picture

Status: Needs review » Reviewed & tested by the community
gxleano’s picture

Look good to me, Luca!

Nice addition, thanks.

  • dan2k3k4 committed 95f2957c on 1.2.x authored by lussoluca
    [#3554855] fix: Use overridden config to query for key data on settings...
dan2k3k4’s picture

Status: Reviewed & tested by the community » Fixed

Merged

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

dan2k3k4’s picture

Status: Fixed » Closed (fixed)