The rapid proliferation of Large Language Model (LLM) providers--each exposing proprietary API formats--has created a fragmented ecosystem where applications become tightly coupled to individual vendors. Switching or bridging providers requires O(N2) bilateral adapters, impeding portability and multi-provider architectures. We observe that despite substantial syntactic divergence, the major LLM APIs share a common semantic core: the practical challenge is the combinatorial surface of syntactic variations, not deep semantic incompatibility. Based on this finding, we present LLM-Rosetta, an open-source translation framework built on a hub-and-spoke Intermediate Representation (IR) that captures the shared semantic core--messages, content parts, tool calls, reasoning traces, and generation controls--in a 9-type content model and 10-type stream event schema. A modular Ops-composition converter architecture enables each API standard to be added independently. LLM-Rosetta supports bidirectional conversion (provider-to-IR-to-provider) for both request and response payloads, including chunk-level streaming with stateful context management. We implement converters for four API standards (OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, and Google GenAI), covering the vast majority of commercial providers. Empirical evaluation demonstrates lossless round-trip fidelity, correct streaming behavior, and sub-100 microsecond conversion overhead--competitive with LiteLLM's single-pass approach while providing bidirectionality and provider neutrality. LLM-Rosetta passes the Open Responses compliance suite and is deployed in production at Argonne National Laboratory. Code is available at https://github.com/Oaklight/llm-rosetta.
Figures & tables
Aspect
OpenAI Chat
Anthropic
Google GenAI
OpenAI Responses
Message unit
messages[]
messages[]
contents[]
input[] items
System prompt
role in array
top-level param
role in array
instructions
Content model
string or parts
block array
parts[]
items with type
Tool calls
tool_calls[]
content block
functionCall
item with type
Streaming
delta chunks
event types
candidate deltas
response events
Reasoning
—
thinking
thought
reasoning item
Table 1: API format divergence across major LLM providers.
Feature
LangChain
LiteLLM
AI Gw.
Open R.
LLM-Rosetta
Provider-neutral IR
×
×
×
n/a
✓
Bidir. format conv.
×
×
×
n/a
✓
Lossless round-trip
×
×
×
n/a
✓
Streaming support
✓
✓
✓
✓
✓
App framework
✓
×
×
×
×
Providers ( ≥ 50)
✓
✓
✓
×
×
Table 2: Comparison of LLM-Rosetta with related approaches. × = not supported; n/a = not applicable (specification, not implementation).
Figure 1: Overview of the IR schema. Arrows indicate containment relationships.
Figure 2: Hub-and-spoke architecture of LLM-Rosetta . Each provider converter translates bidirectionally between its native format and the IR . Cross-provider translation composes two converters through the IR hub.
Category
OpenAI Chat
Anthropic
Google
Responses
Content parts
22
31
33
43
Messages
38
23
28
27
Tool defs/calls
25
28
31
46
Config/params
23
26
47
44
Full round-trip
31
41
51
40
Streaming
56
70
59
70
Table 3: Unit test counts per conversion category and provider. All tests pass in both strip and preserve metadata modes.
Payload
OpenAI Chat
Anthropic
Google
Responses
Simple text (req)
21
24
24
22
Multi-turn (req)
71
75
77
73
Tool calls (req)
44
46
46
44
Simple text (resp)
30
29
31
31
Tool calls (resp)
55
47
48
57
Table 4: Round-trip conversion overhead in microseconds (median over 1,000 iterations). “Req” denotes request round-trip (provider → IR → provider); “Resp” denotes response round-trip.
Payload
LiteLLM (µs)
LLM-Rosetta (µs)
Ratio
Simple text
28
24
0.8 ×
Multi-turn
34
76
2.2 ×
Tool calls
29
46
1.6 ×
Table 5: Cross-provider conversion latency: LiteLLM (one-directional, OpenAI Chat → Anthropic) vs. LLM-Rosetta (two-hop, OpenAI Chat → IR → Anthropic). Median over 1,000 iterations; LiteLLM v1.83.