Skip to content

test: add LiteLLM schema selection runtime coverage#30

Merged
rlippmann merged 1 commit into
mainfrom
schema-selection-tier2
Jul 1, 2026
Merged

test: add LiteLLM schema selection runtime coverage#30
rlippmann merged 1 commit into
mainfrom
schema-selection-tier2

Conversation

@rlippmann

Copy link
Copy Markdown
Owner

Summary

Adds Tier 2 runtime-boundary coverage for the existing Python LiteLLM response_format schema-selection example.

The new tests exercise the real litellm.completion(...) call path against a local OpenAI-compatible stub server and assert on the actual HTTP payload received by the stub.

Why

The existing schema-selection coverage verified host-side selection behavior, but did not prove that the selected response_format crossed a real LiteLLM runtime boundary.

This change validates that schema selection affects the actual LiteLLM request payload without requiring an OpenAI, Anthropic, or other frontier-model key.

Changes

  • Added test_litellm_runtime_sends_selected_response_format
  • Added test_litellm_runtime_omits_response_format_when_unselected
  • Kept example behavior unchanged

Scope

This PR does not:

  • create a new example
  • change schema-selection behavior
  • call a live model provider
  • introduce model-derived state mutation

Notes

The tests use an ephemeral localhost OpenAI-compatible stub server. They verify:

  • selected schemas are serialized into the LiteLLM outbound request as response_format
  • unselected schemas omit response_format
  • the example still parses LiteLLM responses successfully

Tier 2 Coverage Impact

This closes the schema-selection runtime-boundary gap identified during the Tier 2 audit.

@rlippmann
rlippmann merged commit 89fafa0 into main Jul 1, 2026
5 checks passed
@rlippmann
rlippmann deleted the schema-selection-tier2 branch July 1, 2026 07:12
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.

1 participant