New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

bridge-ai

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bridge-ai

Unified AI SDK for OpenAI, Gemini, Claude, Perplexity, and DeepSeek. Designed like AWS SDK v3.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
26
136.36%
Maintainers
1
Weekly downloads
 
Created
Source

🌉 Bridge AI SDK

npm version License: MIT

Bridge AI is a unified, type-safe SDK for interacting with multiple AI providers (OpenAI, Gemini, Claude, Perplexity, and DeepSeek). Designed with the elegance and modularity of AWS SDK v3, it provides a seamless interface whether you're building a simple bot or a complex multi-model application.

✨ Features

  • 🎯 Unified Interface: One SDK to rule them all. Switch providers by changing a single config line.
  • 🏗️ AWS SDK v3 Inspired: Familiar Client-Command pattern for modularity.
  • 🛡️ Type-Safe: Written in TypeScript with full type definitions.
  • 🚀 Environment Conscious: Automatically picks up API keys from environment variables.
  • ⚙️ Configurable: Define pre-instructions (system prompts) at the client level or per request.
  • 📦 Lightweight: Zero-dependency core (using official SDKs under the hood for reliability).

🚀 Installation

npm install @himanshu-mamgain/bridge-ai

🛠️ Quick Start

1. Set up your Environment Variables

Add your API keys to your .env file:

OPENAI_API_KEY=sk-...
GEMINI_API_KEY=...
ANTHROPIC_API_KEY=...
PERPLEXITY_API_KEY=...
DEEPSEEK_API_KEY=...

2. Basic Usage (TS/JS)

import { BridgeAIClient, ChatCommand } from '@himanshu-mamgain/bridge-ai';

// Initialize the client
const client = new BridgeAIClient({
  provider: 'openai', // or 'gemini', 'claude', 'perplexity', 'deepseek'
  preInstructions: 'You are a helpful coding assistant.'
});

// Use the Command Pattern (AWS SDK v3 Style)
const command = new ChatCommand({
  prompt: 'How do I use Bridge AI?'
});

const response = await client.send(command);
console.log(response.text);

📐 Advanced Configuration

Provider Specific Models

You can specify models and other parameters:

const client = new BridgeAIClient({
  provider: 'claude',
  apiKey: 'custom-key-override', // Optional: Overrides env var
  preInstructions: 'System prompt goes here'
});

const response = await client.chat({
  prompt: 'Write a story',
  temperature: 0.7,
  maxTokens: 500
});

🤝 Supported Providers

ProviderConfig NameDefault ModelEnv Variable
OpenAIopenaigpt-4-turbo-previewOPENAI_API_KEY
Google Geminigeminigemini-1.5-flashGEMINI_API_KEY
Anthropic Claudeclaudeclaude-3-5-sonnet-20240620ANTHROPIC_API_KEY
Perplexityperplexityllama-3-sonar-large-32k-onlinePERPLEXITY_API_KEY
DeepSeekdeepseekdeepseek-chatDEEPSEEK_API_KEY

📖 Documentation

For full documentation and advanced examples, visit our GitHub Pages.

📄 License

MIT © Himanshu Mamgain

Keywords

ai

FAQs

Package last updated on 28 Dec 2025

Related posts