Repository navigation
fix(friendliai): sync serverless catalog with the models API - #33501
robust-WJL wants to merge 2 commits into
Conversation
Greptile SummaryThis PR adds 6 current FriendliAI serverless models (GLM-5.2, GLM-5.1, DeepSeek-V3.2, MiniMax-M2.5, Qwen3-235B, gemma-4-31B) to both JSON catalog files, but the patch was applied twice — every model key appears twice in each file.
Confidence Score: 3/5Not safe to merge as-is: the duplicate-key issue causes the second block to silently override the first, and the second gemma entry is missing two capability flags. Every model introduced by this PR ends up defined twice in each catalog file. Python's JSON parser takes the last occurrence, so the entire first block is silently discarded. More critically, the surviving second copy of Both
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds 6 new FriendliAI serverless models, but each entry is duplicated — all 6 keys appear twice. The second (winning) occurrence of friendliai/google/gemma-4-31B-it is also missing supports_parallel_function_calling and supports_tool_choice. |
| litellm/model_prices_and_context_window_backup.json | Mirror of the primary JSON with the same two problems: all 6 model keys are duplicated, and the second friendliai/google/gemma-4-31B-it entry omits supports_parallel_function_calling and supports_tool_choice. |
Reviews (1): Last reviewed commit: "Add FriendliAI serverless (Model API) mo..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f26b2128e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
6d1355f to
aaefb8c
Compare
aaefb8c to
94e4b45
Compare
|
Hi Team. Resolved the duplicated keys. I don't think OSV Scan failure is related to my PR, but happy to adjust if anything is needed! |
|
Hi LiteLLM team. Any updates regarding this? Let me know if I should submit the request to different channel / fix anything else. |
The catalog carried only meta-llama-3.1-70b-instruct and meta-llama-3.1-8b-instruct. Both are retired; neither is served by https://api.friendli.ai/serverless/v1/models anymore, so their pricing and 8k context windows were the only FriendliAI data litellm exposed. Every field is taken from that endpoint, which is public and unauthenticated: pricing.input, pricing.output and pricing.input_cache_read map onto the token costs, context_length onto max_input_tokens, max_completion_tokens onto max_output_tokens and max_tokens, and functionality.tool_call, functionality.parallel_tool_call and functionality.structured_output onto the capability flags. Qwen3-235B-A22B-Instruct-2507 reports a deprecation_date of 2026-08-05 and carries it through. tests/test_litellm/test_friendliai_model_metadata.py pins the lineup, asserts the retired keys stay absent, and asserts the root JSON and the bundled backup never drift apart for this provider
94e4b45 to
daa43de
Compare
|
Heads up on overlap with #34703, so this does not read as a duplicate. Both PRs touch the FriendliAI region of the cost map, but they are doing different jobs. #34703 teaches One practical note for whoever merges first. #34703 seeds only They will conflict textually since they add overlapping keys in the same place. Whichever lands first, I will rebase the other and repost the verification output. I would suggest this one first, since it makes the committed data correct immediately and the cron in #34703 will then just keep reproducing the same values. Also worth flagging while this is open: CLA is signed now, and I have retargeted this from |
supports_reasoning was guesswork on my part, so I probed each model against the serverless endpoint instead and set the flag from what came back. gemma-4-31B-it and DeepSeek-V3.2 return no reasoning_content by default but do return it under chat_template_kwargs.enable_thinking, so both are reasoning capable. K-EXAONE-236B-A23B, GLM-5.1, GLM-5.2 and MiniMax-M2.5 return it without being asked. Qwen3-235B-A22B-Instruct-2507 returns byte-identical output with thinking on and off and ships no thinking markers in its published chat template, so it does not get the flag; it is the non-thinking half of the Qwen3-235B pair. gemma-4-31B-it also keeps supports_vision: it answers a base64 image prompt correctly, whereas the non-vision models on this endpoint reject the same payload with "This model does not support image/video inputs" The metadata test now pins the reasoning flag per model
|
@krrish-berri we'd love to see this get in! |
|
@krrish-berri Hi team. Any progress on this? We have some internal requirement to resolve this catalog problem before Mid August, so would love to get it done before that. Let me know if this PR needs any adjustments. |
|
Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level |
TLDR
Problem this solves:
friendliai/meta-llama-3.1-70b-instructandfriendliai/meta-llama-3.1-8b-instruct; both are retired and neither is served byhttps://api.friendli.ai/serverless/v1/modelsanymoreHow it solves it:
tests/test_litellm/test_friendliai_model_metadata.py, which pins the lineup, keeps the retired keys from coming back, and asserts the root JSON and the bundled backup never drift apart for this providerRelevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)osv-scanfails on this branch at the "Scan lockfiles" step. It is unrelated to this PR, which touches two JSON files and one new test file and no lockfile; the same job reports a Node 20 runner deprecation notice. Happy to look at it if you would rather it be green firstScreenshots / Proof of Fix
api.friendli.ai/serverless/v1/modelsis public and needs no auth, so the data in this PR can be checked against the source directly:Output on this branch:
I will follow up with live proxy logs showing a real completion and its logged cost against
friendliai/zai-org/GLM-5.2Type
Bug Fix
Changes
Seven entries, one per model the serverless endpoint returns. Field mapping, all of it read from that endpoint:
pricing.inputinput_cost_per_tokenpricing.outputoutput_cost_per_tokenpricing.input_cache_readcache_read_input_token_costcontext_lengthmax_input_tokensmax_completion_tokensmax_output_tokens,max_tokensfunctionality.tool_callsupports_function_callingfunctionality.parallel_tool_callsupports_parallel_function_callingfunctionality.structured_outputsupports_response_schemadeprecation_datedeprecation_datesupports_reasoningis not something the models endpoint reports, so rather than guess it I probed each model and set the flag from what came back.google/gemma-4-31B-itanddeepseek-ai/DeepSeek-V3.2return noreasoning_contentby default but do return it underchat_template_kwargs.enable_thinking, so both get the flag.LGAI-EXAONE/K-EXAONE-236B-A23B,zai-org/GLM-5.1,zai-org/GLM-5.2andMiniMaxAI/MiniMax-M2.5return it unprompted.Qwen/Qwen3-235B-A22B-Instruct-2507returns byte-identical output with thinking on and off and publishes no thinking markers in its chat template, so it does not get the flag; it is the non-thinking half of the Qwen3-235B pair. The transcript is in a comment belowsupports_visionongoogle/gemma-4-31B-itis likewise verified rather than assumed: it answers a base64 image prompt correctly, while non-vision models on this endpoint reject the identical payload withThis model does not support image/video inputssupports_prompt_cachingis set on exactly the four models that quote a cache read price.Qwen/Qwen3-235B-A22B-Instruct-2507reportsdeprecation_date2026-08-05T00:00:00Zand carries it through as2026-08-05, matching theYYYY-MM-DDform already used across this fileBoth retired llama entries are removed rather than left with a
deprecation_date. They are not merely scheduled for retirement, they are already absent from the endpoint, so keeping their pricing would keep serving cost data for models that cannot be calledKeys are inserted in the same ASCII order the surrounding file uses, and each entry keeps the file's alphabetical field order
QA runbook
The tests read both JSON files off disk and need no network and no provider credentials:
I checked they fail when the data regresses rather than only passing on the happy path. Reverting
zai-org/GLM-5.2to a 1000000 context fails 2, re-adding either retired llama key fails 3, droppingcache_read_input_token_costfrom the backup copy alone fails 2, flippingsupports_function_callingto false ongoogle/gemma-4-31B-itfails 2, addingsupports_reasoningtoQwen/Qwen3-235B-A22B-Instruct-2507fails 2, and dropping it fromgoogle/gemma-4-31B-itfails 2Final Attestation