llmwire - v2.2.0
    Preparing search index...

    llmwire

    One wire to every LLM. Zero dependencies, real streaming, tool calling, structured output and typed errors across OpenAI, Anthropic, Gemini, Ollama, LM Studio and any OpenAI-compatible API. Node 18+, Bun, Deno, Workers, browsers.

    npm install llmwire
    
    import { aiFactory } from 'llmwire';

    const res = await aiFactory.process({ prompt: 'Hello', modelId: 'gpt-4o' });
    if (!res.success) console.error(res.errorInfo?.code, res.errorInfo?.hint);

    for await (const c of aiFactory.processStream({ prompt: 'Hi' }))
    if (c.type === 'text') process.stdout.write(c.text);

    Local models need no key: modelId: 'llama3.2' reaches Ollama. Cloud is one env var: OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY.

    • Examples — ten small projects: PR summarizer, weather bot, receipt → JSON, streaming endpoint, agents, memory, MCP, search, cron digest
    • Guide — streaming, messages and images, tools, structured output, errors, retries, agents, MCP, CLI
    • API reference — every entry: llmwire, llmwire/core, llmwire/agent, llmwire/mcp, providers
    • Migrating 1.x → 2.0
    • Architecture · Changelog · Contributing
    • llms.txt — the short version, for models