Skip to content

test(decisions): add hosted_vllm /v1/decisions and provider-400 translation cases - #45661

Merged
kerrylu-berri merged 1 commit into
mainfrom
litellm_hosted_vllm_decisions_translation_cases
Oct 9, 2026
Merged

kerrylu-berri merged 1 commit into
mainfrom
litellm_hosted_vllm_decisions_translation_cases

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • feat(decisions): add hosted_vllm provider #45501 added hosted_vllm to Decisions but its only TranslationTestCase covers /v1/systemone
  • /v1/decisions, the route with the actual translation logic, had no exact-literal case
  • vLLM's 400 for non-choice questions had no case either, since the runner always replied 200

How it solves it:

  • TranslationTestCase gets mock_provider_status_code (default 200), assert_translation passes it to Reply
  • QWEN3_0_6B_DECISIONS_TEST_CASE: OpenAI choice body in, exact vLLM /v1/systemone body out, OpenAI answer back
  • QWEN3_0_6B_PREDICATE_REJECTED_TEST_CASE: OpenAI predicate goes out as noul, vLLM's 400 comes back as LiteLLM's 400
  • Both provider replies captured from a real vLLM (CPU build of vllm main 702ce313f, Qwen/Qwen3-0.6B) with the exact bodies the cases pin

Linear ticket

Related to LIT-9367

Pre-Submission checklist

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Screenshots / Proof of Fix

Test-only PR, so the proof is the cases going red under mutation and green on the shipped code. Local integration rig (tests/integration/proxy_config.yaml, fake provider on :8191), tests/integration/translation/decisions/basic/test_decisions_basic_hosted_vllm.py

Before (05166e2, runner mutated)

Mutation 1: assert_translation ignores mock_provider_status_code and replies 200

  1. python tests/integration/run.py providers tests/integration/translation/decisions/basic/test_decisions_basic_hosted_vllm.py
  2. hosted_vllm/Qwen/Qwen3-0.6B-predicate_rejected fails: assert 500 == 400, LiteLLM turns the 200 error body into InternalServerError ... 1 validation error for DecisionsResponse. 1 failed, 2 passed

Mutation 2: BaseDecisionsConfig sends choice criteria under the key options

  1. Same command after restarting the proxy
  2. basic and decisions fail on the provider body: {'is_defect': {'type': 'choice', ..., 'options': {'yes': None, 'no': None}}} == {... 'criteria': ...}. 2 failed, 1 passed

After (37d3bab)

  1. Same command, mutations reverted
  2. 3 passed, and a second run against the same Redis also 3 passed (the no-cache flag holds)
  3. All six decisions bases plus tests/integration/providers/test_decisions_wire.py still pass with the runner change

Provider captures, exact expected_provider_request bodies sent to the real vLLM on 2026-10-09:

  1. choice: POST /v1/systemone -> 200 {"id":"decision-91ce41627dbf016f","object":"structured_decision",...,"answers":{"is_defect":{"type":"choice","choice":"yes","probabilities":{"yes":0.8670357477770336,"no":0.13296425222296632},"confidence":0.8669148648509282}},"usage":{"input_tokens":43,"output_tokens":1},...}
  2. noul: POST /v1/systemone -> 400 {"error":{"message":"unknown question type 'noul'; supported: ['choice']","type":"BadRequestError","param":null,"code":400}}

Type

✅ Test

Caveats (if any)

Low

  • The 400 case pins LiteLLM's wrapped error text, including model group 'hosted_vllm/Qwen/Qwen3-0.6B', so a change to proxy error wording fails it on purpose
  • No other decisions provider has a /v1/decisions case yet; same pattern applies if wanted

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

Link to Devin session: https://app.devin.ai/sessions/3d0a4b725c1d4d65968372a35704cdd2
Open in Devin Desktop: https://app.devin.ai/desktop/session/3d0a4b725c1d4d65968372a35704cdd2?variant=devin
Requested by: @kerry-berri


Note

Devin errored when opening this Pull Request as kerry-berri.
As a fallback, Devin opened this PR as itself.

…lation cases

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


kerry 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.

@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low impact] This test-only PR appears safe to merge

Summary

Adds two hosted_vllm translation cases and lets the fake provider return a chosen HTTP status

  • Hosted vLLM choice questions now have an exact /v1/decisions translation case.
  • Hosted vLLM predicate tests now check its 400 error translation.

devin-ai-integration[bot] explicitly acknowledged that the exact wrapped error text is pinned intentionally, so changes to that wording should fail the case

Reviews (1) · Last reviewed commit: "test(decisions): add hosted_vllm /v1/dec..." · Reviewed by Greptile

@kerrylu-berri
kerrylu-berri enabled auto-merge (squash) October 9, 2026 20:41
@kerrylu-berri
kerrylu-berri merged commit 097d018 into main Oct 9, 2026
81 checks passed
@kerrylu-berri
kerrylu-berri deleted the litellm_hosted_vllm_decisions_translation_cases branch October 9, 2026 20:43
@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants