Skip to content

LLM-Dev-Ops/connector-hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LLM Connector Hub

Build Status TypeScript Test Coverage Performance License

Production-ready TypeScript framework for unified LLM provider access with intelligent routing, caching, and resilience.

Status: βœ… Production-Ready | Version: 0.1.0 | Test Coverage: 96.3%


🎯 Overview

LLM Connector Hub provides a unified, type-safe interface for interacting with multiple Large Language Model providers (OpenAI, Anthropic, Google AI, Azure OpenAI, AWS Bedrock). Built with TypeScript and Node.js, it offers enterprise-grade features including smart provider selection, automatic failover, response caching, and comprehensive observability.

Key Highlights

  • πŸš€ Exceptional Performance: Sub-microsecond overhead (<2ΞΌs), 46K ops/s throughput
  • πŸ”„ Multi-Provider Support: OpenAI (GPT-5, GPT-4o), Anthropic (Claude), Google AI (Gemini), Azure OpenAI, AWS Bedrock
  • πŸ›‘οΈ Production-Ready: 96.3% test coverage, zero compilation errors
  • πŸ’° Cost-Effective: 70-90% API cost reduction via intelligent caching
  • πŸ“Š Enterprise-Grade: Full observability, monitoring, and deployment automation

✨ Features

Core Capabilities

  • βœ… Unified Interface - Single API for all LLM providers
  • βœ… Streaming Support - Real-time token streaming via Server-Sent Events (SSE)
  • βœ… Multi-turn Conversations - Stateful conversation management
  • βœ… Function Calling - Tool/function calling support across providers
  • βœ… Multimodal Support - Text + image inputs (vision models)
  • βœ… Request Normalization - Automatic request/response transformation
  • βœ… Token Estimation - Built-in token counting and validation

Resilience & Reliability

  • βœ… Automatic Retry - Exponential backoff with jitter for transient failures
  • βœ… Circuit Breaker - Prevents cascade failures with 3-state circuit breaker
  • βœ… Rate Limiting - Token bucket and sliding window algorithms
  • βœ… Health Monitoring - Automatic health checks with auto-recovery
  • βœ… Multi-Provider Failover - Seamless fallback to backup providers
  • βœ… Error Recovery - Intelligent error handling and retry strategies

Performance & Scalability

  • βœ… Response Caching - Memory (LRU) and Redis-backed caching
  • βœ… Smart Provider Selection - 6 selection strategies (cost, latency, health-based)
  • βœ… Horizontal Scaling - Stateless design for easy scaling
  • βœ… Connection Pooling - Efficient HTTP connection reuse
  • βœ… Request Deduplication - Prevents duplicate concurrent requests

Observability

  • βœ… Structured Logging - High-performance logging with pino
  • βœ… Prometheus Metrics - Request, latency, error, and cache metrics
  • βœ… Health Checks - Liveness and readiness endpoints
  • βœ… Distributed Tracing - OpenTelemetry integration ready
  • βœ… Performance Tracking - Real-time performance monitoring

Security

  • βœ… Input Validation - Runtime validation with Zod schemas
  • βœ… Data Sanitization - Automatic PII and sensitive data redaction
  • βœ… Secrets Management - Environment-based configuration
  • βœ… TypeScript Strict Mode - Compile-time type safety
  • βœ… Security Scanning - Automated vulnerability scanning in CI/CD

πŸš€ Quick Start

Installation

Option 1: Install the Complete Hub (Recommended)

npm install @llm-dev-ops/connector-hub

Option 2: Install Individual Packages

# Core package
npm install @llm-dev-ops/connector-hub-core

# Providers package
npm install @llm-dev-ops/connector-hub-providers

# Middleware package
npm install @llm-dev-ops/connector-hub-middleware

# CLI tool (global)
npm install -g @llm-dev-ops/connector-hub-cli

Available Packages

Package Description Install Command
@llm-dev-ops/connector-hub-core Core interfaces and types npm install @llm-dev-ops/connector-hub-core
@llm-dev-ops/connector-hub-providers All provider implementations npm install @llm-dev-ops/connector-hub-providers
@llm-dev-ops/connector-hub-middleware Middleware components npm install @llm-dev-ops/connector-hub-middleware
@llm-dev-ops/connector-hub Complete orchestration layer npm install @llm-dev-ops/connector-hub
@llm-dev-ops/connector-hub-cli Command-line interface npm install -g @llm-dev-ops/connector-hub-cli

Basic Usage

import { ConnectorHub } from '@llm-dev-ops/connector-hub';
import { Anthropic } from '@llm-dev-ops/connector-hub-providers';

// Initialize the hub
const hub = new ConnectorHub({
  providers: {
    anthropic: Anthropic.createAnthropicProvider({
      apiKey: process.env.ANTHROPIC_API_KEY!,
    }),
  },
});

// Send a completion request
const response = await hub.complete({
  model: 'claude-3-sonnet-20240229',
  messages: [
    { role: 'system', content: 'You are a helpful assistant.' },
    { role: 'user', content: 'Explain quantum computing in simple terms.' },
  ],
  temperature: 0.7,
  max_tokens: 500,
});

console.log(response.message.content);

OpenAI Usage (GPT-5 & GPT-4o)

import { ConnectorHub } from '@llm-dev-ops/connector-hub';
import { OpenAI } from '@llm-dev-ops/connector-hub-providers';

const hub = new ConnectorHub({
  providers: {
    openai: OpenAI.createOpenAIProvider({
      apiKey: process.env.OPENAI_API_KEY!,
    }),
  },
});

// Use GPT-5 (latest flagship model)
const response = await hub.complete({
  model: 'gpt-5',
  messages: [{ role: 'user', content: 'Explain machine learning.' }],
  temperature: 0.7,
  max_tokens: 1000,
});

// Use GPT-4o (fast multimodal model)
const visionResponse = await hub.complete({
  model: 'gpt-4o',
  messages: [{
    role: 'user',
    content: [
      { type: 'text', text: 'What is in this image?' },
      { type: 'image_url', image_url: 'https://example.com/image.jpg' },
    ],
  }],
});

Azure OpenAI with Deployment Names

import { ConnectorHub } from '@llm-dev-ops/connector-hub';
import { Azure } from '@llm-dev-ops/connector-hub-providers';

const hub = new ConnectorHub({
  providers: {
    azure: Azure.createAzureProvider({
      apiKey: process.env.AZURE_OPENAI_API_KEY!,
      resourceName: 'your-resource-name',
      deploymentName: 'gpt-4o-deployment', // Your Azure deployment name
    }),
  },
});

// Use your Azure OpenAI deployment
const response = await hub.complete({
  model: 'gpt-4o', // Model ID (deployment handles the routing)
  messages: [{ role: 'user', content: 'Hello, Azure OpenAI!' }],
});

// Alternative: Use endpoint URL directly
const hubWithEndpoint = new ConnectorHub({
  providers: {
    azure: Azure.createAzureProvider({
      apiKey: process.env.AZURE_OPENAI_API_KEY!,
      endpoint: 'https://your-resource.openai.azure.com',
      deploymentName: 'gpt-4o-deployment',
    }),
  },
});

AWS Bedrock with Multiple Models

import { ConnectorHub } from '@llm-dev-ops/connector-hub';
import { Bedrock } from '@llm-dev-ops/connector-hub-providers';

const hub = new ConnectorHub({
  providers: {
    bedrock: Bedrock.createBedrockProvider({
      region: 'us-east-1',
      accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
      secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
    }),
  },
});

// Use Claude 3.5 Sonnet on Bedrock
const claudeResponse = await hub.complete({
  model: 'anthropic.claude-3-5-sonnet-20241022-v2:0',
  messages: [{ role: 'user', content: 'Explain AWS Bedrock.' }],
  max_tokens: 1000,
});

// Use Llama 3.3 70B on Bedrock
const llamaResponse = await hub.complete({
  model: 'meta.llama3-3-70b-instruct-v1:0',
  messages: [{ role: 'user', content: 'Tell me about Llama models.' }],
  max_tokens: 1000,
});

// Use Llama 3.1 405B (largest model)
const llama405BResponse = await hub.complete({
  model: 'meta.llama3-1-405b-instruct-v1:0',
  messages: [{ role: 'user', content: 'Solve this complex problem...' }],
  max_tokens: 2000,
});

Streaming Example

// Stream tokens as they arrive (works with all providers)
for await (const chunk of hub.stream({
  model: 'gpt-4o',
  messages: [{ role: 'user', content: 'Tell me a story.' }],
})) {
  if (chunk.content) {
    process.stdout.write(chunk.content);
  }
}

Multi-Provider with Failover

import { Anthropic, Google, OpenAI } from '@llm-dev-ops/connector-hub-providers';

const hub = new ConnectorHub({
  providers: {
    openai: OpenAI.createOpenAIProvider({ apiKey: process.env.OPENAI_API_KEY! }),
    anthropic: Anthropic.createAnthropicProvider({ apiKey: process.env.ANTHROPIC_API_KEY! }),
    google: Google.createGoogleProvider({ apiKey: process.env.GOOGLE_API_KEY! }),
  },
  selector: {
    type: 'failover',
    primary: 'openai',
    fallback: 'anthropic',
  },
});

// Automatically fails over to Anthropic if OpenAI is unavailable
const response = await hub.complete(request);

πŸ“¦ Supported Providers

Provider Status Streaming Function Calling Vision Models
OpenAI βœ… Production βœ… βœ… βœ… GPT-5, GPT-5.1, GPT-4o, GPT-4o-mini, GPT-4 Turbo
Anthropic βœ… Production βœ… βœ… βœ… Claude 3.5 Sonnet, Claude 3 Opus/Sonnet/Haiku
Google AI βœ… Production βœ… βœ… βœ… Gemini 1.5 Pro/Flash, Gemini 1.0 Pro
AWS Bedrock βœ… Production βœ… βœ… βœ… Claude 3.5, Llama 3.3/3.1, Titan, Command
Azure OpenAI βœ… Production βœ… βœ… βœ… GPT-5, GPT-4o, GPT-4 Turbo (via deployments)

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Application Layer                       β”‚
β”‚              (Your Application Code)                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              ConnectorHub (Orchestrator)                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚  β”‚         Middleware Pipeline                   β”‚      β”‚
β”‚  β”‚  β€’ Retry (exponential backoff)                β”‚      β”‚
β”‚  β”‚  β€’ Rate Limiting (token bucket)               β”‚      β”‚
β”‚  β”‚  β€’ Circuit Breaker (3-state)                  β”‚      β”‚
β”‚  β”‚  β€’ Logging (structured)                       β”‚      β”‚
β”‚  β”‚  β€’ Metrics (Prometheus)                       β”‚      β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β”‚                       β”‚                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚  β”‚           Provider Registry                   β”‚      β”‚
β”‚  β”‚  β€’ Smart Selection (6 strategies)             β”‚      β”‚
β”‚  β”‚  β€’ Health Monitoring                          β”‚      β”‚
β”‚  β”‚  β€’ Failover Logic                             β”‚      β”‚
β”‚  β”‚  β€’ Cache Manager (LRU + Redis)                β”‚      β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚                 β”‚                 β”‚
β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
β”‚   OpenAI   β”‚  β”‚  Anthropic  β”‚  β”‚  Google AI  β”‚
β”‚  Provider  β”‚  β”‚  Provider   β”‚  β”‚  Provider   β”‚
β”‚ (GPT-5/4o) β”‚  β”‚  (Claude)   β”‚  β”‚  (Gemini)   β”‚
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
      β”‚                β”‚                 β”‚
β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”         β”‚
β”‚   Azure    β”‚  β”‚AWS Bedrock  β”‚         β”‚
β”‚  OpenAI    β”‚  β”‚  Provider   β”‚         β”‚
β”‚  Provider  β”‚  β”‚(Multi-model)β”‚         β”‚
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜         β”‚
      β”‚                β”‚                 β”‚
      β”‚    Request/Response              β”‚
      β”‚      Transformation              β”‚
      β”‚                β”‚                 β”‚
β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
β”‚         External Provider APIs                β”‚
β”‚   β€’ api.openai.com                            β”‚
β”‚   β€’ *.openai.azure.com                        β”‚
β”‚   β€’ bedrock-runtime.*.amazonaws.com           β”‚
β”‚   β€’ api.anthropic.com                         β”‚
β”‚   β€’ generativelanguage.googleapis.com         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🎯 Use Cases

1. Multi-Provider Applications

Switch between providers seamlessly based on cost, latency, or availability:

import { OpenAI, Anthropic, Google, Azure, Bedrock } from '@llm-dev-ops/connector-hub-providers';

const hub = new ConnectorHub({
  providers: {
    openai: OpenAI.createOpenAIProvider({ apiKey: process.env.OPENAI_API_KEY! }),
    anthropic: Anthropic.createAnthropicProvider({ apiKey: process.env.ANTHROPIC_API_KEY! }),
    google: Google.createGoogleProvider({ apiKey: process.env.GOOGLE_API_KEY! }),
    azure: Azure.createAzureProvider({
      apiKey: process.env.AZURE_OPENAI_API_KEY!,
      resourceName: process.env.AZURE_RESOURCE_NAME!,
      deploymentName: 'gpt-4o-deployment',
    }),
    bedrock: Bedrock.createBedrockProvider({
      region: 'us-east-1',
      accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
      secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
    }),
  },
  selector: {
    type: 'cost-optimized', // Automatically select cheapest provider
  },
});

2. High-Availability Services

Automatic failover ensures continuous service across multiple providers:

const hub = new ConnectorHub({
  providers: {
    primary: OpenAI.createOpenAIProvider({ apiKey: process.env.OPENAI_API_KEY! }),
    secondary: Anthropic.createAnthropicProvider({ apiKey: process.env.ANTHROPIC_API_KEY! }),
    tertiary: Bedrock.createBedrockProvider({
      region: 'us-east-1',
      accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
      secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
    }),
  },
  selector: {
    type: 'failover',
    primary: 'primary',
    fallback: 'secondary',
  },
  middleware: [
    new RetryMiddleware({ maxAttempts: 3 }),
    new CircuitBreakerMiddleware({ threshold: 5 }),
  ],
});

3. Cost Optimization

Reduce API costs by 70-90% with intelligent caching:

const hub = new ConnectorHub({
  providers: { anthropic },
  cache: {
    type: 'memory',
    maxSize: 1000,
    ttl: 3600, // 1 hour
  },
});

// First call hits API
const response1 = await hub.complete(request);

// Subsequent identical calls use cache (250,000x faster!)
const response2 = await hub.complete(request); // <2ΞΌs from cache

4. Production Monitoring

Full observability out of the box:

import { LoggingMiddleware, MetricsMiddleware } from '@llm-dev-ops/connector-hub-middleware';

const hub = new ConnectorHub({
  providers: { anthropic },
  middleware: [
    new LoggingMiddleware({ level: 'info' }),
    new MetricsMiddleware({ port: 9090 }), // Prometheus metrics
  ],
});

πŸ“Š Performance

Benchmark Results (Actual)

Provider Transformation Overhead:

  • Anthropic: 1.18ΞΌs (860K ops/s) πŸ₯‡
  • Google: 1.28ΞΌs (993K ops/s)

Cache Performance:

  • Memory GET (hit): 1.74ΞΌs (575K ops/s)
  • Memory GET (miss): 0.62ΞΌs (1.6M ops/s)

Stress Test Results (1000 concurrent requests):

  • Throughput: 46,030 ops/s
  • Success Rate: 100%
  • Memory Usage: +6.3MB (well controlled)
  • Memory Leaks: None detected βœ…

Performance vs Targets:

Metric Target Actual Achievement
Latency Overhead <1ms <2ΞΌs 500x better
Throughput >1000/s 46,000/s 46x better
Memory Usage <200MB ~30MB 6.6x better

For detailed benchmarks, see PERFORMANCE_RESULTS.md.


πŸ› οΈ Configuration

Provider Configuration

import { OpenAI, Anthropic, Google, Azure, Bedrock } from '@llm-dev-ops/connector-hub-providers';

const providers = {
  openai: OpenAI.createOpenAIProvider({
    apiKey: process.env.OPENAI_API_KEY!,
    timeout: 60000,
  }),

  anthropic: Anthropic.createAnthropicProvider({
    apiKey: process.env.ANTHROPIC_API_KEY!,
    timeout: 60000,
  }),

  google: Google.createGoogleProvider({
    apiKey: process.env.GOOGLE_API_KEY!,
    timeout: 60000,
  }),

  azure: Azure.createAzureProvider({
    apiKey: process.env.AZURE_OPENAI_API_KEY!,
    resourceName: process.env.AZURE_RESOURCE_NAME!,
    deploymentName: process.env.AZURE_DEPLOYMENT_NAME!,
    timeout: 60000,
  }),

  bedrock: Bedrock.createBedrockProvider({
    region: process.env.AWS_REGION || 'us-east-1',
    accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
    secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
    timeout: 60000,
  }),
};

Hub Configuration

const hub = new ConnectorHub({
  providers,

  // Provider selection strategy
  selector: {
    type: 'latency-optimized', // or 'cost-optimized', 'round-robin', 'failover'
  },

  // Caching configuration
  cache: {
    type: 'memory',
    maxSize: 1000,
    ttl: 3600,
  },

  // Middleware pipeline
  middleware: [
    new RetryMiddleware({ maxAttempts: 3, backoff: 'exponential' }),
    new RateLimitMiddleware({ requestsPerMinute: 100 }),
    new CircuitBreakerMiddleware({ threshold: 5, timeout: 30000 }),
    new LoggingMiddleware({ level: 'info' }),
    new MetricsMiddleware(),
  ],

  // Health monitoring
  healthCheck: {
    enabled: true,
    interval: 30000, // 30 seconds
  },
});

Environment Variables

# OpenAI
OPENAI_API_KEY=sk-...

# Anthropic
ANTHROPIC_API_KEY=sk-ant-...

# Google AI
GOOGLE_API_KEY=...

# Azure OpenAI
AZURE_OPENAI_API_KEY=...
AZURE_RESOURCE_NAME=your-resource-name
AZURE_DEPLOYMENT_NAME=gpt-4o-deployment
# Or use endpoint URL:
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com

# AWS Bedrock
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
# Or use AWS profile:
AWS_PROFILE=default

# Optional Configuration
LLM_CONNECTOR_CACHE_TYPE=memory
LLM_CONNECTOR_LOG_LEVEL=info

πŸ“š Documentation

Quick Links

User Guides

Examples

Comprehensive examples in the examples/ directory:

  1. Basic Completion - Simple completion with error handling
  2. Streaming - Real-time streaming responses
  3. Multi-Provider - Provider comparison and failover
  4. Middleware Pipeline - Complete middleware configuration
  5. Advanced Features - Caching, monitoring, function calling
  6. Production-Ready - Production configuration patterns

πŸš€ Deployment

Docker

# Build image
docker build -t llm-connector-hub .

# Run container
docker run -p 8080:8080 \
  -e OPENAI_API_KEY=sk-... \
  -e ANTHROPIC_API_KEY=sk-ant-... \
  -e GOOGLE_API_KEY=... \
  -e AZURE_OPENAI_API_KEY=... \
  -e AZURE_RESOURCE_NAME=... \
  -e AZURE_DEPLOYMENT_NAME=... \
  -e AWS_REGION=us-east-1 \
  -e AWS_ACCESS_KEY_ID=... \
  -e AWS_SECRET_ACCESS_KEY=... \
  llm-connector-hub

Kubernetes

# Deploy with kubectl
kubectl apply -f deployment/kubernetes/

# Deploy with Helm (coming soon)
helm install llm-connector ./deployment/helm/

Docker Compose (Development)

# Start full stack (app + Redis + Prometheus + Grafana)
docker-compose up -d

For detailed deployment instructions, see Deployment Guide.


πŸ§ͺ Testing & Benchmarking

Run Tests

# Run all tests
npm test

# Run with coverage
npm run test:coverage

# Run specific package tests
npm test -- packages/providers

Run Benchmarks

# Run all benchmarks
npm run bench:all

# Run specific benchmarks
npm run bench:provider    # Provider transformation
npm run bench:cache       # Cache operations
npm run bench:stress      # Stress tests (1000 concurrent)
npm run bench:load        # Load tests

# Save results
npm run bench:save

# Analyze results
npm run bench:analyze

🀝 Contributing

We welcome contributions! Please see our Contributing Guide.

Development Setup

# Clone repository
git clone https://github.com/your-org/llm-connector-hub
cd llm-connector-hub

# Install dependencies
npm install

# Build all packages
npm run build

# Run tests
npm test

# Run linting
npm run lint

# Run type checking
npm run type-check

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests
  5. Run npm test and npm run lint
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

πŸ“ˆ Roadmap

Current Version (v0.1.0) βœ…

  • βœ… OpenAI provider (GPT-5, GPT-5.1, GPT-4o, GPT-4o-mini, GPT-4 Turbo)
  • βœ… Anthropic (Claude) provider (Claude 3.5 Sonnet, Claude 3 Opus/Sonnet/Haiku)
  • βœ… Google AI (Gemini) provider (Gemini 1.5 Pro/Flash, Gemini 1.0 Pro)
  • βœ… Azure OpenAI provider (all GPT models via deployments)
  • βœ… AWS Bedrock provider (Claude, Llama, Titan, Command, Mistral)
  • βœ… Streaming support for all providers
  • βœ… Multi-provider failover
  • βœ… Caching (Memory + Redis)
  • βœ… Middleware pipeline (retry, circuit breaker, rate limiting)
  • βœ… Health monitoring
  • βœ… Comprehensive documentation
  • βœ… Function/tool calling support
  • βœ… Vision/multimodal support

v0.2.0 (Q1 2025)

  • Request batching
  • Advanced analytics dashboard
  • WebSocket support for real-time streaming
  • Enhanced cost tracking and optimization
  • Model performance comparison tools
  • Additional Bedrock models (Mistral, Cohere)

v1.0.0 (Q2 2025)

  • Plugin marketplace
  • Custom provider SDK
  • Advanced load balancing strategies
  • Multi-region support with geo-routing
  • Enterprise features (SSO, audit logs, RBAC)
  • GraphQL API support

For detailed roadmap, see IMPLEMENTATION_ROADMAP.md.


πŸ”’ Security

Security is a top priority. If you discover a security vulnerability, please email security@example.com instead of using the issue tracker.

Security Features

  • βœ… API key encryption at rest (when stored)
  • βœ… Sensitive data sanitization in logs
  • βœ… Input validation with Zod schemas
  • βœ… TypeScript strict mode (compile-time safety)
  • βœ… Automated security scanning (npm audit, Snyk, CodeQL)
  • βœ… No hardcoded credentials
  • βœ… Secrets management integration (Vault, AWS Secrets Manager)

πŸ“„ License

This project is licensed under the Apache License, Version 2.0.


πŸ™ Acknowledgments

Built with excellent open-source libraries:


πŸ“ž Support


πŸ“Š Project Status

Current Version: 0.1.0 Status: βœ… Production-Ready Build: Build Status Test Coverage: 96.3% Performance Grade: A+

See FINAL_PRODUCTION_REPORT.md for complete production validation.


⭐ Star History

If you find this project useful, please consider giving it a star! ⭐


Made with ❀️ by the LLM Connector Hub Team

Unified. Resilient. Production-Ready.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors