# llm-lib demo

A unified JavaScript library for OpenAI, Anthropic, and Gemini

## Configuration

Provider
Model
API Key (stored in localStorage)

## Prompt

System Prompt (optional) You are a helpful assistant. Be concise.
User Message What are the three laws of robotics? Explain each briefly.

## Response

Ready
Response will appear here...

## Usage

// Include the library import { LLM } from './llm-lib.js'; // Create an instance const llm = new LLM({ provider: 'openai', // 'openai' | 'anthropic' | 'gemini' apiKey: 'your-api-key', model: 'gpt-4.1', systemPrompt: 'You are helpful.' }); // Non-streaming const response = await llm.prompt('Hello!'); // Streaming for await (const chunk of llm.stream('Tell me a story')) { process.stdout.write(chunk); }