litellm - ✅(Solved) Fix [Bug]: /model_group/info returns mode: "chat" for Azure text-embedding-3-small (should be "embedding") [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#24658Fetched 2026-04-08 01:37:24
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×3cross-referenced ×1referenced ×1

PR fix notes

PR #24729: fix(router): derive mode from litellm model map when db model_info lacks it

Description (problem / solution / changelog)

Problem

Fixes #24658

The /model_group/info endpoint returns mode: "chat" for Azure text-embedding-3-small (and other Azure embedding models) even though the LiteLLM UI correctly shows them as embedding models.

Root cause

In Router._set_model_group_info(), when model_info is not found in the router cache, the code constructs a fallback ModelMapInfo with:

db_model_info = model.get("model_info", {})
mode = db_model_info.get("mode", "chat")   # ← always "chat" unless the user explicitly
                                             #   set mode in their config.yaml model_info

User config entries rarely include an explicit mode key, so this always falls through to "chat" — even for embedding models.

Fix

When db_model_info does not have an explicit mode, call litellm.get_model_info(model=litellm_model, custom_llm_provider=llm_provider) to derive the mode from LiteLLM's built-in model map before falling back to "chat":

mode = db_model_info.get("mode", None)

if mode is None:
    try:
        _map_info = litellm.get_model_info(
            model=litellm_model,
            custom_llm_provider=llm_provider if llm_provider else None,
        )
        mode = _map_info.get("mode", "chat") if _map_info else "chat"
    except Exception:
        mode = "chat"

With this change, text-embedding-3-small resolves to mode: "embedding" via the litellm model map. All other models retain their existing behaviour (litellm map lookup falls back to "chat" on any exception).

Checklist

  • My PR is focused on a single issue
  • I have read the LiteLLM contribution guidelines
  • DCO signed

Changed files

  • litellm/router.py (modified, +15/-2)

Code Example

{
  "model_group": "xxx/azure_ai/text-embedding-3-small",
  "providers": ["azure"],
  "mode": "chat",
  ...
}
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

When an Azure text-embedding-3-small model is added to LiteLLM, the model info UI correctly shows mode: "embedding". However, the /model_group/info endpoint returns mode: "chat" for this model.

This causes downstream consumers that rely on /model_group/info to determine model capabilities to incorrectly categorize the model as a chat model instead of an embedding model.

Expected: /model_group/info should return mode: "embedding" for text-embedding-3-small, consistent with the model info UI.

Observed: /model_group/info returns mode: "chat".

All vertex_ai and bedrock embedding models return the correct mode: "embedding". This issue appears specific to Azure-provisioned embedding models where providers: ["azure"].

Steps to Reproduce

  1. Add an Azure text-embedding-3-small deployment to LiteLLM (provider: azure)
  2. Check the model info in LiteLLM UI → shows mode: "embedding"
  3. Call GET /model_group/info
  4. Observe: mode: "chat"

Relevant log output

{
  "model_group": "xxx/azure_ai/text-embedding-3-small",
  "providers": ["azure"],
  "mode": "chat",
  ...
}

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.81.14-stable

Twitter / LinkedIn details

No response

extent analysis

Fix Plan

To fix the issue, we need to update the /model_group/info endpoint to correctly return mode: "embedding" for Azure-provisioned embedding models.

  • Update the model_group_info function to check the provider and model name:
def model_group_info(model_group):
    # ... existing code ...
    if "azure" in model_group.providers and "text-embedding" in model_group.name:
        return {"mode": "embedding", ...}
    # ... existing code ...
  • Alternatively, add a specific check for the text-embedding-3-small model:
def model_group_info(model_group):
    # ... existing code ...
    if model_group.name == "text-embedding-3-small" and "azure" in model_group.providers:
        return {"mode": "embedding", ...}
    # ... existing code ...

Verification

To verify the fix, follow the steps to reproduce the issue and check that the /model_group/info endpoint returns mode: "embedding" for the Azure text-embedding-3-small model.

Extra Tips

  • Make sure to test the fix with different Azure-provisioned embedding models to ensure the solution is not specific to text-embedding-3-small.
  • Consider adding a test case to the LiteLLM test suite to prevent regressions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - ✅(Solved) Fix [Bug]: /model_group/info returns mode: "chat" for Azure text-embedding-3-small (should be "embedding") [1 pull requests, 1 participants]