Repository navigation
Description
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:
- Consume a canonical supported-parameters field exposed by LiteLLM, if available.
- Safely consume
litellm_params.allowed_openai_paramsfrom/v1/model/infofor capability decisions. - Add explicit capability fields to
model_infoand consume them consistently.
Investigation requirements
- Confirm whether
allowed_openai_paramsin/v1/model/infois 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
- Hardcoding DeepSeek or any other model family in the general metadata layer.
- Changing the output-token default policy tracked in [Bug]: output-cap defaults and explicit reasoning overrides are mishandled #5181.
- Making network discovery mandatory for LLM construction.
This issue was created by an AI agent (OpenHands) on behalf of Graham Neubig.
Activity