Llm Adapter Kit banner
Synaptic-Labs-AI Synaptic-Labs-AI

Llm Adapter Kit

AI community

Description

A universal TypeScript library for interacting with multiple LLM providers through a unified interface. Supports 600+ models across 8 major providers with built-in cost calculation, streaming, and adv

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

LLM Adapter Kit

A universal TypeScript library for interacting with multiple LLM providers through a unified interface. Supports 600+ models across 8 major providers with built-in cost calculation, streaming, and advanced features.

πŸš€ Features

  • Universal Interface: Single API for all LLM providers
  • 8 Major Providers: OpenAI, Anthropic, Google, Mistral, Groq, OpenRouter, Requesty, Perplexity
  • 600+ Models: Access to the latest models including GPT-4o, Claude 4, Gemini 2.5, Sonar
  • Cost Tracking: Built-in token counting and cost calculation
  • Streaming Support: Real-time response streaming
  • Advanced Features: Function calling, JSON mode, vision support
  • TypeScript First: Full type safety and IntelliSense support
  • Comprehensive Testing: Extensive test suite with real API validation

πŸ“¦ Installation

npm install llm-adapter-kit

πŸ”‘ Setup

  1. Copy the environment file:
cp .env.example .env
  1. Add your API keys to .env:
# Required: At least one provider
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_API_KEY=AIza...
MISTRAL_API_KEY=...

# Optional: Multi-provider aggregators
OPENROUTER_API_KEY=sk-or-...  # 400+ models
REQUESTY_API_KEY=...          # 150+ models
PERPLEXITY_API_KEY=pplx-...   # Web search & reasoning

🎯 Quick Start

import { OpenAIAdapter, AnthropicAdapter, GoogleAdapter, GroqAdapter, PerplexityAdapter } from 'llm-adapter-kit';

// Initialize adapters
const openai = new OpenAIAdapter();
const claude = new AnthropicAdapter();
const gemini = new GoogleAdapter();
const groq = new GroqAdapter();
const perplexity = new PerplexityAdapter();

// Basic text generation
const response = await openai.generate('Write a haiku about coding');
console.log(response.text);

// With options
const jsonResponse = await claude.generate('Return user data as JSON', {
  maxTokens: 100,
  temperature: 0.7,
  jsonMode: true
});

// Streaming
await gemini.generateStre