
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@amux.ai/llm-bridge
Advanced tools
Core IR (Intermediate Representation) and adapter interfaces for Amux
@amux.ai/llm-bridge is the core package of Amux that provides:
pnpm add @amux.ai/llm-bridge
# or
npm install @amux.ai/llm-bridge
# or
yarn add @amux.ai/llm-bridge
import { createBridge } from '@amux.ai/llm-bridge'
import { openaiAdapter } from '@amux.ai/adapter-openai'
import { anthropicAdapter } from '@amux.ai/adapter-anthropic'
const bridge = createBridge({
inbound: openaiAdapter,
outbound: anthropicAdapter,
config: {
apiKey: process.env.ANTHROPIC_API_KEY,
baseURL: 'https://api.anthropic.com'
}
})
// Send request in OpenAI format, get response in OpenAI format
// But actually calls Anthropic API under the hood
const response = await bridge.chat({
model: 'gpt-4',
messages: [{ role: 'user', content: 'Hello!' }]
})
for await (const chunk of bridge.chatStream({
model: 'gpt-4',
messages: [{ role: 'user', content: 'Tell me a story' }],
stream: true
})) {
console.log(chunk)
}
The IR is the central data structure that all adapters convert to/from:
Every adapter implements the LLMAdapter interface:
interface LLMAdapter {
inbound: {
parseRequest(request: unknown): Promise<LLMRequestIR>
parseResponse(response: unknown): Promise<LLMResponseIR>
parseStream(chunk: string): Promise<LLMStreamEvent | null>
parseError(error: unknown): LLMErrorIR
}
outbound: {
buildRequest(ir: LLMRequestIR): unknown
buildResponse(ir: LLMResponseIR): unknown
}
capabilities: AdapterCapabilities
getInfo(): AdapterInfo
}
The Bridge orchestrates the conversion flow:
createBridge(options)Create a new bridge instance.
Options:
inbound - Inbound adapter instanceoutbound - Outbound adapter instanceconfig - Configuration object
apiKey - API key for the outbound providerbaseURL - Base URL for the outbound provider (optional)timeout - Request timeout in milliseconds (optional)headers - Additional HTTP headers (optional)Returns: Bridge instance
bridge.chat(request)Send a chat completion request.
Parameters:
request - Request object in inbound adapter formatReturns: Promise<Response> - Response in inbound adapter format
bridge.chatStream(request)Send a streaming chat completion request.
Parameters:
request - Request object in inbound adapter format with stream: trueReturns: AsyncIterable<string> - Server-Sent Events stream
This package is written in TypeScript and provides full type definitions.
import type {
LLMRequestIR,
LLMResponseIR,
LLMAdapter,
Bridge
} from '@amux.ai/llm-bridge'
Contributions are welcome! Please see our Contributing Guide.
MIT © isboyjc
FAQs
Core IR and adapter interfaces for Amux
We found that @amux.ai/llm-bridge demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.