Repository navigation
test(together_ai): move request-shape checks to the mapped file, drop the live ones - #41360
Merged
Merged
Conversation
…trol Together moved openai/gpt-oss-20b off serverless, so three tests started failing with a 400 model_not_available from the live API. None of them was really testing Together: they cover provider-prefix parsing, prompt shaping and streaming, all litellm side. Mock the transport and assert those, so the tests answer to our code instead of a vendor catalog.
Contributor
Greptile SummaryThis test-only PR removes three brittle Together AI live tests pinned to an unavailable model and moves request-shape coverage into the mocked transformation suite.
Confidence Score: 5/5The PR appears safe to merge because the remaining live tests select eligible models dynamically and the moved request-shape assertions run through a mocked transport. No new actionable issues remain, and all previous findings were resolved by deleting the affected helpers or replacing the coarse type with a concrete validated model. Important Files Changed
Reviews (3): Last reviewed commit: "refactor(test): validate cost-map entrie..." | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
… the live ones Together moved openai/gpt-oss-20b off serverless and three tests in test_completion.py died on a live 400. None of them needed Together to be up: streaming is already covered live by tests/e2e/llm_translation/test_together_ai_e2e.py, which picks its model from the cost map instead of pinning one, and the other two are request-shape questions. Delete all three and assert the two shapes in the mapped transformation file: the provider prefix is stripped without eating the rest of a slashed model name, and custom role wrappers never reach the request.
…r_ai_serverless_model
tests/e2e/llm_translation/test_together_ai_e2e.py registers its model with the full registry key, so a slashed together_ai/<vendor>/<model> goes through the prefix strip on every e2e run and an over-strip would fail against the real API. The unit assertion was a second copy of that. The roles check stays, since nothing in e2e exercises it.
`together_ai/openai/gpt-oss-20b` was hardcoded in two live tests and is no longer served, so both failed on a vendor catalog change rather than on anything litellm did. Both call sites now resolve the cheapest non-deprecated together_ai chat entry at runtime, filtered on the capabilities the tests actually exercise, mirroring what tests/e2e/llm_translation/test_together_ai_e2e.py already does. The selector lives in tests/_live_test_helpers.py so both lanes share one implementation.
CI runs these lanes as `python -m pytest` from the repo root, so the root is already on sys.path and `tests._live_test_helpers` imports without help. The insert only tripped the TQ003 test-quality budget.
Contributor
Author
The selector read raw cost-map dicts as `Mapping[str, Any]`. It now validates each together_ai entry into a frozen Pydantic model and takes the two capabilities as keyword booleans, so nothing in the helper is coarsely typed or stringly addressed.
Contributor
Author
yuneng-berri
enabled auto-merge
September 16, 2026 21:39
yucheng-berri
approved these changes
Sep 16, 2026
3 of 5 tasks
yuneng-berri
disabled auto-merge
September 16, 2026 22:57
yuneng-berri
enabled auto-merge
September 16, 2026 22:57
This was referenced Sep 17, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
How it solves it:
User Flow
This is a test-only change. No runtime behavior changes, so there is no end user flow to describe
Relevant issues
Affected release
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
This PR only touches test files, so there is nothing to exercise against a live proxy: runtime behavior is identical before and after. The failure was the live vendor call itself, so the proof is the red run, plus a mutation check that the replacement assertions actually bite
Before (c64b821)
the three tests fail against Together
uv run pytest tests/local_testing/test_completion.py::test_completion_custom_provider_model_name tests/local_testing/test_completion.py::test_customprompt_together_ai tests/local_testing/test_completion.py::test_completion_together_ai_stream -qAfter (8c046e1)
the three are gone and the file still collects
uv run pytest tests/local_testing/test_completion.py --collect-only -qthe mapped file carries the two request-shape assertions
uv run pytest tests/test_litellm/llms/together_ai/chat/test_together_ai_chat_transformation.py -qthe new prefix assertion catches an over-strip
"model": model,to"model": model.split("/")[-1],inlitellm/llms/openai/chat/gpt_transformation.pyuv run pytest tests/test_litellm/llms/together_ai/chat/test_together_ai_chat_transformation.py -qType
✅ Test
Caveats (if any)
Medium
test_custom_role_wrappers_never_reach_the_requestpinsrolesbeing ignoredLow
tests/e2e/llm_translation/test_together_ai_e2e.pycovers it three ways against the live APIFinal Attestation