17 views
-/https://github.com/berriai/litellm/issues/21347
GitHub · issue

#21347 Validate LiteLLM output and provider mappings using API specs

  • State: open
  • Author: @Chesars
  • Labels: llm translation

## 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…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (14 events)
#0 of 0 · 31d17h55m19s ago — entered · #import:https:::github.com:berriai:litellm post #2931
The left issue spans specification ingestion, schema validation, provider normalization, streaming and compatibility test infrastructure, and broad regression coverage. The right issue appears localized to profiling and optimizing a slow command, with scope and root cause still narrow.
The right-side work spans specification ingestion, response/schema validation, provider normalization, and broad regression-test infrastructure, creating substantial cross-cutting scope and compatibility risk. The left-side work is comparatively localized to runtime dependency and event-loop compatibility handling.
#21347 is harder because it requires broad, ongoing compatibility infrastructure across schemas, providers, response paths, tests, and likely generated or evolving specifications. #27883 is comparatively narrower: implementing centralized configuration handling and enforcement for a limited set of tools.
The left issue is substantially harder: it entails a broad cross-language platform migration, preserving behavior and compatibility across many execution paths while meeting stringent performance and deployment goals. The right issue is primarily a bounded standards-validation and test-infrastructure effort, with narrower implementation and rollout risk.
Issue 21347 has substantially broader scope: it requires designing and maintaining spec-driven validation across many providers, endpoints, schemas, streaming formats, and mappings, with extensive test infrastructure and compatibility decisions. Issue 30460 is a narrower distributed-state debugging and correction effort, despite meaningful concurrency and failure-mode risk.
#34241 is harder because it requires a broad architectural reorganization with cross-cutting dependency, packaging, compatibility, and legal-risk implications. #21347 is also substantial, but can be approached as an extensible validation and conformance-testing framework layered over existing provider mappings.
Issue 21347 is harder because it requires designing and integrating broad schema-conformance validation across many providers, response shapes, streaming paths, and ongoing compatibility workflows. Issue 34733 is narrower, focused on making an accounting update path concurrency-safe and reliably persisted, though it still carries distributed-systems testing risk.
Issue 21347 has substantially broader cross-provider compatibility scope, schema integration, test coverage, and maintenance risk; issue 30421 is primarily a bounded CLI orchestration and configuration feature.
Issue 21347 is harder because it requires broad schema-driven validation across providers, translations, streaming behavior, and ongoing compatibility maintenance; issue 29320 is a substantial but more self-contained integration with defined configuration, lifecycle, and observability changes.
Cross-cutting contract validation would require substantial schema integration, normalization across many providers, broad fixture and CI coverage, and ongoing compatibility maintenance. The other request is a bounded proxy feature involving authorization, usage queries, and UI work, with less systemic risk.
Issue 21347 is harder because it requires designing and integrating a broad, specification-driven validation framework across many schemas, providers, response paths, and ongoing tests. Issue 30043 is substantial but comparatively bounded to stabilizing specific routing and compatibility behaviors.
The left issue is harder because it requires broad specification ingestion, schema-validation infrastructure, provider-normalization coverage, and extensive compatibility testing. The right issue is comparatively narrower, centered on worker lifecycle, state readiness, and recovery behavior.
Issue 21347 is harder because it requires broad schema-generation or validation infrastructure, provider normalization coverage, and sustained compatibility testing across many response paths. Issue 28168 has substantial resource coverage and migration/security concerns, but is more bounded as an export/import workflow.
#0 of 0 · 31d17h19m52s ago — current · #import:https:::github.com:berriai:litellm post #3527
Multi-tenant isolation spans authentication, request routing, configuration, and multiple storage/provider integrations, creating substantially broader security and compatibility risks. The validation work is also cross-cutting, but is more bounded as specification-driven test and tooling infrastructure.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search