feat: updating gateway integration#97
Conversation
|
| Filename | Overview |
|---|---|
| frontend/src/pages/configurations/Integrations.tsx | Adds LLM Gateway modal; the base_url mutation sends null instead of "" when cleared, so the backend preserves the old value and the user cannot clear the URL from the UI. |
| app/services/ai/llm_gateway_settings.py | Implements org-level gateway settings persistence; base_url clear semantics rely on empty-string sentinel that the frontend does not send, causing the UI clear action to be silently ignored. |
| app/services/ai/llm_gateway.py | New module implementing gateway resolution, key handling, and LiteLLM call wrapping for Bifrost and LiteLLM Proxy; well-structured with correct fallback-to-direct logic. |
| app/services/optimization/gepa_service.py | Routes both batch and reflection LiteLLM calls through the gateway, correctly passing model as routing_model so native-path (Gemini) providers get the OpenAI-compatible routing override. |
| app/api/v1/routes/aiproviders.py | Extends create endpoint to store a gateway-managed sentinel when passthrough_provider_keys is false and no API key is supplied; response correctly exposes the gateway_managed flag. |
| app/services/ai/transcription_service.py | Switches to resolve_litellm_api_key for credential resolution and allows null api_key through the GOOGLE STT path so the gateway can handle auth; previously flagged import bug is fixed. |
Comments Outside Diff (1)
-
frontend/src/pages/configurations/Integrations.tsx, line 1940-1948 (link)Cannot clear org base URL from UI — change silently ignored
When a user opens the modal with an existing
base_url, clears the field, and saves, the frontend sendsbase_url: null(because"".trim() || null === null). Inset_org_settings, the receivingbase_url=Nonehits theelif "base_url" in existing:branch and restores the old value, so the clear is silently discarded.virtual_keyandmaster_keyboth have dedicatedclear_*boolean flags to sidestep this ambiguity;base_urlhas no equivalent. Sending""instead ofnullwould work — the backend already handles an empty string as a clear operation (trimmed = ""→payload["base_url"] = None).
Reviews (5): Last reviewed commit: "fix: updating gepa tests" | Re-trigger Greptile
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
What Changed?
Briefly describe what this PR changes.
Why?
Explain the problem this solves and why this approach was chosen.
How to Test?
List clear steps for reviewers to verify the change.
Release Label
Select one semantic version bump intent for this PR:
major- breaking change, next release bumps major versionminor- backward-compatible feature, next release bumps minor versionfix- backward-compatible bug fix, next release bumps patch versionIf you do not have permission to apply labels, mention the intended release label here and a maintainer will set it.
Checklist
CONTRIBUTING.mdguide.