Vibeleaderboard
Index / tool
Visit github.com
Category
AI Tools
Rank
No. 1080Tools index
Pricing
Open Source
Type
TOOL
GitHub
328 stars
Date

About

Universal LLM input-format adapter with built-in observability and error handling — swap models without rewriting prompts.

What it does

LLM Bridge normalizes request bodies and SSE event streams into an intermediate representation, then renders them for OpenAI Chat, OpenAI Responses, Anthropic, or Google. It also carries multimodal content, tool calls, reasoning settings, structured output, and provider errors across those translations. An optional request handler can modify normalized requests before forwarding them.

Why it's ranked here

The scope is unusually complete for a small TypeScript library. Request conversion, streaming, tool lifecycles, multimodal content, structured output, error normalization, and telemetry share one model. The package also has no declared runtime dependencies. The main reservation is precision: token and cost telemetry includes explicit approximations, while model prices depend on a remote dataset.

What's good

The intermediate model creates one place to inspect or alter requests before converting them back. Provider-specific fields can be retained for reconstruction. Streaming has parsers and emitters for every listed format, including OpenAI Responses. Error records preserve provider context and raw input. The empty runtime dependency list keeps adoption friction low.

Tradeoffs

Token counts use character ratios and fixed estimates for images, audio, video, documents, and tool calls. Unknown models receive zero costs and capabilities. Price lookup contacts an external GitHub-hosted dataset and falls back to defaults on failure. The forwarding handler removes the content-type header from the caller-provided header object. Google and OpenAI Responses errors do not receive equally complete parsing coverage.

How to use it well

Use it inside a TypeScript proxy, gateway, or request-processing layer that must inspect prompts and support several provider wire formats. Keep the normalized representation as the boundary for transforms, then translate only at ingress and egress. Treat token and cost data as operational estimates. It does not replace provider credentials, model selection policy, a hosted gateway, or a command-line client.

Technical notes+

src/index.ts re-exports helpers, handlers, errors, models, types, tools, and streaming surfaces. src/models/index.ts dispatches four provider formats through a typed universal body. src/handler.ts detects a provider, normalizes and edits the request, performs a fetch, computes observability data, and translates SSE through provider-specific parser and emitter selection. src/models/helpers.ts uses approximate token accounting and fetches model pricing from an AgentOps GitHub dataset with a 24-hour in-memory cache. src/errors/parser.ts normalizes OpenAI, Anthropic, and Google errors. package.json declares public npm packaging, CommonJS and ES module entry points, TypeScript declarations, no runtime dependencies, and provider SDKs only as development dependencies.

Observed

License
MIT
Primary language
TypeScript
Install surface
Public npm package installed with npm install llm-bridge
Interface
TypeScript library with request translation, SSE streaming, error, helper, and observability exports
Provider formats
OpenAI Chat Completions, OpenAI Responses, Anthropic Claude, and Google Gemini
Module packaging
CommonJS and ES module entry points with TypeScript declarations
Runtime dependencies
The package declares an empty dependencies object
Published contents
The package manifest limits published files to dist

Read from README.md, package.json, src/index.ts, src/handler.ts, src/tools/index.ts, src/types/index.ts, src/errors/index.ts, src/models/index.ts, src/errors/types.ts, src/errors/utils.ts, src/helpers/index.ts, src/errors/parser.ts, src/helpers/utils.ts, src/models/helpers.ts, src/streaming/index.ts.

What it can do

  • Adapt prompts between different LLM input formats

    Prompt in one LLM formatPrompt converted to target LLM format

  • Switch between LLM models without rewriting prompts

    Existing prompt and target model specificationModel response using adapted prompt format

  • Monitor LLM API calls and responses

    LLM requests and responsesObservability data and metrics

  • Handle LLM API errors automatically

    Failed LLM API requestsError recovery responses or fallback handling

  • Standardize prompts across multiple LLM providers

    Raw prompt textStandardized prompt format compatible with multiple models

Tags

llmtypescriptinteropobservabilitysdk

Tech Stack

Node.jsTypeScript

Comments (0)

No comments yet

Editorially curated, with community endorsements as a secondary signal. Corrections welcome.