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-anthropicAvailable Packages
| Package | Size | Description |
|---|---|---|
@amux.ai/llm-bridge | ~15KB | Core package (required) |
@amux.ai/adapter-openai | ~8KB | OpenAI adapter |
@amux.ai/adapter-anthropic | ~8KB | Anthropic adapter |
@amux.ai/adapter-deepseek | ~6KB | DeepSeek adapter |
@amux.ai/adapter-moonshot | ~6KB | Moonshot adapter |
@amux.ai/adapter-zhipu | ~6KB | Zhipu adapter |
@amux.ai/adapter-qwen | ~6KB | Qwen adapter |
@amux.ai/adapter-google | ~7KB | Google 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.tsYou should see:
✓ Amux installed successfully!
✓ OpenAI adapter: openai v1.0.0