Basic Usage
How System Prompts Work
The system prompt is prepended to your conversation, establishing context for the model:Examples
Customer Support Bot
Code Assistant
Creative Writer
JSON Output
Language Tutor
Best Practices
Be Specific
Set Boundaries
Control Output Format
Maintain Persona
Reusable System Prompts
Create a library of system prompts for different use cases:Tips
Keep it concise
Keep it concise
Long system prompts consume context window tokens. Be specific but brief.
Test variations
Test variations
Small changes in wording can significantly affect output. Test different phrasings.
Lower temperature for following instructions
Lower temperature for following instructions
Use
temperature: 0.3-0.5 when you need the model to strictly follow format instructions.Combine with stop sequences
Combine with stop sequences
Use
stopSequences to prevent the model from generating beyond your desired format.generate()
Learn more about generation options →