Skip to main content
The LLM module lets you call language models directly — no agents, no memory, no tools. Use it when you need a single LLM call for tasks like classification, data extraction, translation, or content generation.

When to Use LLM vs Agent

Basic Usage

With System Prompt

Use a system prompt to control the LLM’s behavior:

With Messages

For multi-turn prompts or few-shot examples:

Streaming

For real-time output (long responses, content generation):

Available Models

See LLM Providers for all supported providers and configuration options.

Structured Output

Force responses into valid JSON format using responseFormat:
For schema-validated JSON:
See Structured Output for full provider support details.

Thinking / Reasoning

Enable extended thinking for complex tasks:
Or use reasoning models that think natively:
See Reasoning for all provider options.

Real-World Example: Intent Classifier Tool

A common pattern is using LLM Standalone inside a tool to classify intent before the agent decides what to do:
tools/classify-intent.ts

Real-World Example: Pre-Processing in main.ts

Use LLM Standalone to pre-process or enrich input before passing it to your agent:
main.ts

Real-World Example: Content Generation

Generate structured content without needing an agent:
tools/generate-email.ts

Next Steps

Agents

When you need memory and tools

Tools

Use LLM inside tools

Media Processing

Process audio and images

Best Practices

Tips for effective agents