#21347 Validate LiteLLM output and provider mappings using API specs
## Summary
LiteLLM's core value proposition is: call any LLM provider, get OpenAI-compatible output. Today, this compatibility is verified indirectly — through integration tests that make real API calls and check specific fields manually. There is no systematic validation that the output format matches the OpenAI specification.
## OpenAI publishes their full API spec
OpenAI maintains an OpenAPI 3.1.0 specification (~75,000 lines YAML) at [openai/openai-openapi](https://github.com/openai/openai-openapi) with every endpoint's request and response schemas, including: - All field names, types, required/optional markers - Enum values (e.g., `finish_reason`: `stop`, `length`, `tool_calls`, `content_filter`, `function_call`) - Nested object structures (streaming chunks, tool calls, usage, etc.)
LiteLLM does not use this spec anywhere.
## Why this matters — real example
PR #19558 merged code that passes Vertex AI/Gemini finish reasons (`malformed_function_call`, `finish_reason_unspecified`) directly to users. This was flagged during review:
> @krrishdholakia: "isn't this bad, since it breaks openai consistency?"
The OpenAI SDK throws `literal_error` — the entire response is lost, i…