JSPM

@inferlane/sdk

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 7
    • Score
      100M100P100Q45824F
    • License MIT

    Multi-provider LLM proxy SDK with smart routing, streaming, and cost optimization

    Package Exports

    • @inferlane/sdk
    • @inferlane/sdk/estimate
    • @inferlane/sdk/ingest
    • @inferlane/sdk/langchain
    • @inferlane/sdk/openai
    • @inferlane/sdk/vercel-ai

    Readme

    @inferlane/sdk

    TypeScript SDK for the InferLane API. Route, schedule, and optimize AI inference across providers.

    Install

    npm install @inferlane/sdk

    Quick Start

    import { InferLane } from '@inferlane/sdk';
    
    const il = new InferLane({ apiKey: 'il_...' });
    
    // Route to cheapest provider
    const response = await il.dispatch({
      prompt: 'Explain quantum computing',
      routing: 'cheapest',
    });
    
    // Schedule for later
    await il.schedule({
      prompt: 'Generate weekly report',
      model: 'claude-sonnet-4',
      scheduleType: 'RECURRING',
      cronExpression: '0 9 * * 1',
    });
    
    // Check savings
    const savings = await il.savings({ period: '30d' });
    console.log(`Saved $${savings.totalSaved}`);

    Subpath Exports

    import { ... } from '@inferlane/sdk';           // Core SDK
    import { ... } from '@inferlane/sdk/openai';     // OpenAI-compatible client
    import { ... } from '@inferlane/sdk/ingest';     // Usage ingestion
    import { ... } from '@inferlane/sdk/estimate';   // Cost estimation
    import { ... } from '@inferlane/sdk/vercel-ai';  // Vercel AI SDK integration
    import { ... } from '@inferlane/sdk/langchain';  // LangChain integration

    API Reference

    dispatch(options) — Send a prompt

    schedule(options) — Schedule a prompt

    triage(options) — Classify a prompt

    savings(options) — View cost savings

    models() — List available models

    health() — Provider health status

    License

    MIT