Repository navigation
feat: update Morph model support - #39242
skeptrunedev wants to merge 4 commits into
Conversation
Greptile SummaryThe PR expands Morph model catalog metadata and forwards additional OpenAI-compatible chat parameters.
Confidence Score: 4/5The PR should not merge until Morph tool parameters are gated for the existing v3 models that declare tool calling unsupported. The native Morph adapter now forwards Files Needing Attention: litellm/llms/morph/chat/transformation.py, model_prices_and_context_window.json, tests/llm_translation/test_morph.py
|
| Filename | Overview |
|---|---|
| litellm/llms/morph/chat/transformation.py | Expands parameter forwarding, but unconditionally enables tool parameters for two models whose metadata declares tools unsupported. |
| model_prices_and_context_window.json | Adds current Morph pricing and capability metadata while retaining explicit no-tool capabilities for the existing v3 models. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the Morph catalog updates from the primary model metadata file. |
| tests/llm_translation/test_morph.py | Adds model and mapping coverage, but the supported-parameter test codifies unconditional tool support for morph-v3-large despite its catalog capabilities. |
Reviews (1): Last reviewed commit: "feat: update Morph model support" | Re-trigger Greptile
| "tool_choice", | ||
| "tools", |
There was a problem hiding this comment.
Tool capability gating is bypassed
When callers supply tools or tool_choice for morph-v3-fast or morph-v3-large, this model-agnostic list forwards those fields despite both models declaring tool calling unsupported, causing invalid requests to reach the Morph API and be rejected upstream.
Knowledge Base Used: Provider adapters and capabilities
There was a problem hiding this comment.
Fixed in 0aadfe1. get_supported_openai_params now withholds tools and tool_choice when the registry entry sets supports_function_calling: false (morph-v3-fast, morph-v3-large), so LiteLLM raises UnsupportedParamsError or drops them under drop_params. Models not yet in the registry still pass tools through. Coverage is in tests/test_litellm/llms/morph/chat/test_morph_chat_transformation.py (ccf2b45).
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merge litellm_internal_staging and address PR review and CI failures: - Withhold tools/tool_choice for Morph models whose registry entry sets supports_function_calling to false (morph-v3-fast, morph-v3-large). Models missing from the registry still pass tools through. - Set morph-v3 max_tokens to max_output_tokens (131072) so test_max_tokens_consistency passes. - Keep the updated Morph model info tests that upstream removed. Claude-Session: https://claude.ai/code/session_01LDxX4kpF7ajmSNbhzPsqNT
tests/llm_translation is outside the coverage-reporting unit shards, so add registry-gating tests under tests/test_litellm/llms/morph. Claude-Session: https://claude.ai/code/session_01LDxX4kpF7ajmSNbhzPsqNT
|
skeptrune seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
TLDR
Problem this solves:
How it solves it:
User Flow
Before: a developer can call a current Morph model, but LiteLLM lacks its metadata and drops supported request parameters
POST https://api.morphllm.com/v1/chat/completionsthrough LiteLLM withmodel: "morph/morph-dsv4flash"response_formatare not forwarded by the Morph provider configAfter: the same request routes with current metadata and supported OpenAI parameters
POST https://api.morphllm.com/v1/chat/completionsthrough LiteLLM withmodel: "morph/morph-dsv4flash"response_format, sampling controls, and token limits reach the providerRelevant issues
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
Before (3dac3f7)
jq 'has("morph/morph-kimik3")' model_prices_and_context_window.jsonfalseAfter (81c3598)
truelitellm.completioncall tomorph/morph-dsv4flashreturnsmorph litellm okuv run pytest tests/llm_translation/test_morph.py -qpasses 8 testsuv run pytest tests/test_litellm/test_model_prices_schema.py -qpasses 21 testsType
New Feature
Caveats (if any)
Final Attestation