Amux

Installation

Install Amux and get started

Prerequisites

  • Node.js 18 or higher
  • Package manager: pnpm, npm, yarn, or bun

Check your Node.js version with node --version. Amux requires Node.js 18+.

Install Packages

Install the core package and the adapters you need:

pnpm add @amux.ai/llm-bridge @amux.ai/adapter-openai @amux.ai/adapter-anthropic

Available Packages

PackageSizeDescription
@amux.ai/llm-bridge~15KBCore package (required)
@amux.ai/adapter-openai~8KBOpenAI adapter
@amux.ai/adapter-anthropic~8KBAnthropic adapter
@amux.ai/adapter-deepseek~6KBDeepSeek adapter
@amux.ai/adapter-moonshot~6KBMoonshot adapter
@amux.ai/adapter-zhipu~6KBZhipu adapter
@amux.ai/adapter-qwen~6KBQwen adapter
@amux.ai/adapter-google~7KBGoogle Gemini adapter

Only install the adapters you need. The packages are tree-shakable, so unused code won't be included in your bundle.

Environment Setup

Create a .env file for your API keys:

# .env
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
DEEPSEEK_API_KEY=sk-...

Never commit .env files to version control. Add .env to your .gitignore.

TypeScript Configuration

Amux includes full TypeScript definitions. Ensure your tsconfig.json includes:

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true
  }
}

Verify Installation

Create a test file to verify everything works:

// test.ts
import { createBridge } from '@amux.ai/llm-bridge'
import { openaiAdapter } from '@amux.ai/adapter-openai'

console.log('✓ Amux installed successfully!')
console.log('✓ OpenAI adapter:', openaiAdapter.name, 'v' + openaiAdapter.version)

Run it:

tsx test.ts

You should see:

✓ Amux installed successfully!
✓ OpenAI adapter: openai v1.0.0

Next Steps

On this page