Skip to content

Regression: pgAdmin 4.9.15 breaks custom LLM endpoints (LiteLLM, self‑hosted models, proxies) #9936

@bn-jlarota

Description

@bn-jlarota

Version: pgAdmin 4.9.15
Related commit: https://github.com/pgadmin-org/pgadmin4/commit/24485fe9649860dcb632bb8029d4fa8efbafbc04
Related issue: https://github.com/pgadmin-org/pgadmin4/issues/9900

Summary

The fix for #9900 introduced a hardcoded allow‑list of LLM provider URLs, which breaks all custom OpenAI‑compatible endpoints, including:

  • LiteLLM

This is a regression from 4.9.14, where custom endpoints worked correctly.

It only allows these hardcoded urls: https://github.com/pgadmin-org/pgadmin4/blob/master/web/config.py#L1055-L1066:

# Allowed LLM API URLs
# A list of scheme://host:port entries that LLM API requests are allowed
# to connect to. Only URLs matching an entry in this list will be permitted.
# This prevents SSRF attacks via user-controlled API URL fields.
# Set to an empty list to disable URL restriction (not recommended).
# Add entries for custom providers (LiteLLM, LM Studio, corporate proxies).
ALLOWED_LLM_API_URLS = [
    'https://api.anthropic.com:443',
    'https://api.openai.com:443',
    'http://localhost:11434',     # Ollama default
    'http://localhost:12434',     # Docker Model Runner default
]

To Reproduce

Steps to reproduce the behavior:

  1. Go to AI>AI Configuration
  2. Select OpenAI as Default Provider
  3. Go to AI>OpenAI
  4. API Key File: Configure the path of your API key file
  5. API URL: Configure your custom LiteLLM URL
  6. Model: Configure your preferred Model

Expected behavior

The AI Assistant should work without errors as it was working before on PgAdmin 4.9.14

Error message

It defaults to OpenAI

Additional context

Add any other context about the problem here.

CC @dpage

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions