Skip to content

Quick Start

Build AI agents with any LLM provider in minutes.

import { LLMist, Gadget, z } from 'llmist';
// 1. Define a tool (called "gadget" in llmist)
class HighScore extends Gadget({
description: 'Records a high score to the eternal leaderboard',
schema: z.object({
initials: z.string().length(3).describe('Player initials (3 characters)'),
score: z.number().int().positive(),
game: z.enum(['pac-man', 'galaga', 'donkey-kong', 'space-invaders']),
}),
}) {
execute(params: this['params']): string {
const { initials, score, game } = params;
// In a real arcade, this would write to NVRAM
return `${initials} scored ${score.toLocaleString()} on ${game}. A new challenger approaches!`;
}
}
// 2. Create and run agent
const answer = await LLMist.createAgent()
.withModel('sonnet')
.withGadgets(HighScore)
.askAndCollect('I got 999,999 on Pac-Man! My initials are AAA.');
console.log(answer); // "AAA scored 999,999 on pac-man. A new challenger approaches!"

For simple completions without tools:

const answer = await LLMist.complete('What is the capital of France?');
console.log(answer);

Use short aliases or full model names:

// Aliases (recommended)
.withModel('sonnet') // Anthropic Claude Sonnet
.withModel('haiku') // Anthropic Claude Haiku
.withModel('flash') // Google Gemini Flash
.withModel('gpt5') // OpenAI GPT-5
// Full names with provider prefix
.withModel('anthropic:claude-sonnet-4-5')
.withModel('openai:gpt-5')