Skip to content

Define and consume proxy-advertised request-parameter capabilities #5499

Closed

Description

@neubig

Summary

The SDK's LiteLLM proxy discovery consumes only the model_info object from each /v1/model/info entry. It ignores request-parameter capability information in litellm_params, including allowed_openai_params.

An authenticated query to the managed OpenHands proxy currently returns this redacted shape for deepseek-v4.1-flash:

{
  "model_name": "deepseek-v4.1-flash",
  "litellm_params": {
    "model": "openrouter/deepseek/deepseek-v4.1-flash",
    "allowed_openai_params": ["reasoning_effort"]
  },
  "model_info": {
    "supports_function_calling": true,
    "supports_reasoning": true,
    "supports_reasoning_effort": null,
    "max_input_tokens": 1000000,
    "max_output_tokens": 131072
  }
}

The SDK currently returns only current.get("model_info"), so it discards the proxy's authoritative declaration that reasoning_effort is allowed. Capability detection can then fall back to static LiteLLM registry data or model-name-specific logic even though the authenticated proxy entry already describes the accepted parameter.

This was exposed while reviewing #5181 / PR #5194. The metadata-free reproduction in #5181 proves fallback behavior, but it does not represent the authenticated managed-proxy path above.

Desired behavior

Define and consume a general, authoritative capability contract for LiteLLM proxy aliases. Prefer proxy-advertised supported request parameters over hardcoded model-name lists.

Potential approaches, in preferred order:

  1. Consume a canonical supported-parameters field exposed by LiteLLM, if available.
  2. Safely consume litellm_params.allowed_openai_params from /v1/model/info for capability decisions.
  3. Add explicit capability fields to model_info and consume them consistently.

Investigation requirements

  • Confirm whether allowed_openai_params in /v1/model/info is intended as a stable public LiteLLM contract.
  • Distinguish unavailable metadata (401, timeout, missing endpoint) from available metadata whose relevant fields the SDK ignores.
  • Determine whether capability metadata is key-scoped and retain only the minimal supported-parameter set needed by the client.
  • Preserve generic/self-hosted LiteLLM proxy compatibility; some proxies intentionally expose metadata without authentication.

Acceptance criteria

  • The SDK can derive supported request parameters for an alias from authoritative proxy metadata without hardcoding the alias or provider name.
  • Missing credentials, non-2xx responses, timeouts, malformed responses, and absent fields degrade safely to existing fallback behavior.
  • Proxy metadata remains authoritative for proxy aliases; discovery failure does not initiate an unrelated provider route.
  • Capability consumption does not accidentally enable unrelated features such as prompt cache keys or vision.
  • Focused tests cover authenticated metadata, absent metadata, and a declared parameter that static LiteLLM registry data does not know.
  • The implementation documents whether the chosen field is a stable LiteLLM contract; if not, it links an upstream LiteLLM issue.

Non-goals


This issue was created by an AI agent (OpenHands) on behalf of Graham Neubig.

Activity

  1. self-assigned this
    on Oct 9, 2026
  2. added
    ready-for-dev
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready-for-dev

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions