supermemoryai/llm-bridge

Interoperability between input formats of various LLMs, with observability, error handling, etc. built in.

What it solves

Building applications that support multiple LLM providers (like OpenAI, Anthropic, and Google) is difficult because each provider uses different API formats, streaming protocols, and tool-calling structures. LLM Bridge acts as a universal translation layer that normalizes these requests and responses, allowing developers to write code once and deploy it across different AI models without losing data.

How it works

LLM Bridge uses a universal intermediate format to map provider-specific APIs. You can convert an incoming request from any supported provider into this universal format using toUniversal, and then export it to any other provider's format using fromUniversal. The library handles the complexities of mapping multimodal content, tool calls, structured outputs, and streaming events (SSE) between these different systems while ensuring zero data loss through a reconstruction mechanism.

Who it’s for

This library is designed for developers building AI-powered applications, proxies, or middleware who need to support multiple LLM providers simultaneously or switch between them easily without rewriting their core integration logic.

Highlights

  • Perfect Translation: Bidirectional conversion between OpenAI, Anthropic, Google, and OpenAI Responses API formats.
  • Zero Data Loss: Preserves all original fields for perfect request reconstruction.
  • Full Streaming Support: Includes parsers and emitters to handle Server-Sent Events (SSE) across different providers.
  • Advanced Features: Native support for tool calling, multimodal inputs (images/documents), structured outputs, and extended thinking blocks.
  • Type Safety: Built with TypeScript for strict type checking and robust error handling.

Related

  • Project
  • Project
  • Project
  • Project