← Latest papers
🤖 AI

LLM-Rosetta: A Hub-and-Spoke Intermediate Representation for Cross-Provider LLM API Translation

LLM-Rosetta is an open-source, hub-and-spoke intermediate representation framework that enables lossless, bidirectional translation between major LLM API providers, effectively solving the O(N2)O(N^2) adapter problem by mapping diverse syntactic formats to a unified semantic core with minimal overhead.

Original authors: Peng Ding

Published 2026-04-13
📖 5 min read🧠 Deep dive

Original authors: Peng Ding

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a traveler visiting four different countries: OpenAI, Anthropic, Google, and OpenAI's new "Responses" service.

In each country, the locals speak a slightly different dialect of the same language. They all want to talk about "messages," "tools," and "thinking," but they write their sentences differently.

  • In OpenAI, you might say, "Here is a list of messages."
  • In Anthropic, you might say, "Here is a list of content blocks."
  • In Google, you might say, "Here are parts of a conversation."

If you want to build a travel app that works in all four countries, you currently face a nightmare. To make your app work everywhere, you have to build a specific translator for every single pair of countries.

  • OpenAI \leftrightarrow Anthropic
  • OpenAI \leftrightarrow Google
  • Anthropic \leftrightarrow Google
  • ...and so on.

If there are 100 countries, you need thousands of translators. This is the O(N2)O(N^2) problem: the work grows explosively as you add more countries.

Enter LLM-Rosetta: The Universal "Hub"

The authors of this paper, led by Peng Ding, realized that despite the different dialects, everyone is actually saying the same things. They all talk about:

  1. Who is speaking? (System, User, Assistant)
  2. What is being said? (Text, Images, Audio)
  3. What tools are being used? (Calculators, Search engines)
  4. How should we think? (Reasoning steps)

They built LLM-Rosetta, a tool that acts like a universal currency exchange or a central train station.

Instead of building a direct road between every pair of countries, they built a central hub (the "Intermediate Representation" or IR).

  1. The Spoke: You take your specific request (e.g., from OpenAI) and translate it once into the Universal Language (the Hub).
  2. The Hub: The Hub understands the core meaning perfectly. It doesn't care about the weird formatting of the original country.
  3. The Spoke: The Hub then translates that Universal Language into the specific dialect of the destination country (e.g., Google).

Now, if you want to add a 5th country (like a new AI provider), you don't need to rewrite all your old translators. You just build one new translator from that country to the Hub. The math changes from a messy explosion (N2N^2) to a simple addition (NN).

How It Works (The "Ops" Kitchen)

The paper describes a clever way to build these translators called "Ops-Composition."

Imagine a kitchen where you need to cook a meal for four different cultures. Instead of one chef trying to remember four different recipes at once, you have four specialized stations:

  • The Content Station: Handles the food (text, images, files).
  • The Message Station: Handles the order of the meal (who speaks first).
  • The Tool Station: Handles the utensils (calculators, code).
  • The Config Station: Handles the temperature and timing (how fast to think, how creative to be).

When you need to translate from OpenAI to Google, you just swap out the "OpenAI Chef" for the "Google Chef" at each station. The rest of the kitchen stays the same. This makes the system modular, easy to fix, and easy to test.

The "Live Stream" Challenge

One of the hardest parts of talking to AI is that it doesn't reply all at once; it "streams" words one by one, like a live video feed. Different providers send these "chunks" of data in different ways.

  • OpenAI might send a "start" signal, then "text," then "end."
  • Google might send the whole sentence so far, then the next part.

LLM-Rosetta acts like a live subtitle translator. It watches the incoming stream, normalizes it into the "Universal Language" (10 standard event types), and then re-streams it in the format the destination expects. It keeps track of the "state" so that if a tool call starts in one chunk and finishes in another, the translation doesn't get confused.

Why Is This a Big Deal?

  1. It's Lossless: You can send a message from OpenAI to the Hub and back to OpenAI, and it will look exactly the same (down to the tiny metadata details), just like translating a book to French and back to English without losing a single plot point.
  2. It's Fast: The translation happens in less than 100 microseconds (that's 0.0001 seconds). It's so fast that it doesn't slow down your app at all.
  3. It's Already Working: This isn't just theory. It's currently being used at Argonne National Laboratory to help researchers switch between different AI models without rewriting their code.

The Bottom Line

LLM-Rosetta is the Rosetta Stone for AI. It realized that while AI companies speak different "dialects," they all share the same "grammar." By creating a universal middleman, it frees developers from being locked into one company. You can now build an app that talks to OpenAI today, and if you want to switch to Google tomorrow, you just flip a switch. The app doesn't need to be rebuilt; it just needs a new translator for the Hub.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →