@jaypie/llm
Large language model abstraction with multi-provider support.
Overview
Section titled “Overview”@jaypie/llm provides a unified interface for working with large language models, including:
- Multi-provider support (OpenAI, Anthropic)
- Tool calling and function execution
- Structured output generation
- Conversation history management
- Multi-turn reasoning
Installation
Section titled “Installation”npm install @jaypie/llmKey Features
Section titled “Key Features”LLM Interface
Section titled “LLM Interface”Unified interface for multiple LLM providers:
import { Llm } from "@jaypie/llm";
const llm = new Llm("gpt-4o");const response = await llm.send("What is the capital of France?");Tool Calling
Section titled “Tool Calling”Execute functions during LLM conversations:
import { Llm, toolkit } from "@jaypie/llm";
const llm = new Llm("gpt-4o");const response = await llm.operate("What's the weather in Paris?", { tools: [toolkit.weather], turns: 12,});Structured Outputs
Section titled “Structured Outputs”Generate structured data with natural schema syntax:
const response = await llm.send("Extract user information", { format: { name: String, age: Number, email: String },});Built-in Tools
Section titled “Built-in Tools”Pre-configured tools for common tasks:
time- Get current timeweather- Get weather informationrandom- Generate random numbersroll- Roll dice
API Documentation
Section titled “API Documentation”API documentation will be generated from TypeScript definitions.
Related Packages
Section titled “Related Packages”- @jaypie/core - Core utilities
- @jaypie/aws - AWS integrations
- @jaypie/testkit - Testing utilities