6 views
-/https://github.com/berriai/litellm/issues/26979
GitHub ยท issue

#26979 [Bug]: Gemini custom api_base with full model route gets duplicate path appended

  • State: open
  • Author: @StatPan
  • Labels: llm translation, stale

## Describe the bug

When `model="gemini/..."` is used with a custom `api_base` that already includes the full Gemini route (or the `/models/{model}` prefix), LiteLLM appends the model route again inside `_check_custom_proxy()`, producing an invalid URL.

This showed up downstream in OpenHands as: - OpenHands/OpenHands#14028 - OpenHands/OpenHands#14029

Example shape of the bad duplication: - input `api_base` already contains something like `.../v1beta/models/gemini-2.5-flash-lite:generateContent` - LiteLLM builds `.../v1beta/models/gemini-2.5-flash-lite:generateContent/models/gemini-2.5-flash-lite:generateContent`

## Why I'm opening this issue even though there are related threads

I found related items, but they are not the same thing:

- **BerriAI/litellm#24786** โ€” this appears to be the exact code fix, but it has been open/stale since 2026-03-30 and does not seem to have landed. - **BerriAI/litellm#4317** โ€” older general custom `api_base` / Vertex AI thread, not this exact duplicated full-route regression. - **BerriAI/litellm#23846** โ€” adjacent Gemini custom `api_base` issue, but specifically about context caching + `model=None`. - **BerriAI/litellm#26724** โ€” adjacent feature โ€ฆ

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 ยท 31d17h59m49s ago โ€” entered ยท #import:https:::github.com:berriai:litellm post #2964
The right issue is harder because it requires coordinated frontend query, pagination, loading, and result-state changes, while the left is likely a localized URL-construction correction with focused regression tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search