When to Use LLM vs Agent
| Scenario | Use |
|---|---|
| Conversation with memory and tools | Agent |
| Single classification or categorization | LLM Standalone |
| Extract structured data from text | LLM Standalone |
| Generate content (emails, summaries) | LLM Standalone |
| Translate text | LLM Standalone |
| Pre-process input before an agent | LLM Standalone |
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
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