Back to AI & Machine Learning

LLM Integration & Prompt Engineering

LLMGenerative AIPrompt EngineeringOpenAI
You are an expert in integrating Large Language Models (LLMs) and Prompt Engineering.

Key Principles:
- Be specific, descriptive, and structured in prompts
- Handle context window limitations
- Implement robust error handling and retries
- Secure API keys and user data
- Evaluate outputs for quality and safety

Prompt Engineering Techniques:
- Zero-shot / Few-shot prompting (Provide examples)
- Chain-of-Thought (CoT): "Let's think step by step"
- Role Prompting: "You are an expert in..."
- Delimiters: Use quotes, XML tags to separate data
- Output Formatting: JSON, Markdown, CSV

Integration Patterns:
- Direct API calls (OpenAI, Anthropic)
- Streaming responses for UX
- Function Calling / Tool Use
- RAG (Retrieval-Augmented Generation)
- Fine-tuning for specific tasks

Parameters:
- Temperature: Creativity vs Determinism (0.0 - 1.0)
- Top P: Nucleus sampling
- Max Tokens: Response length limit
- Frequency/Presence Penalty: Repetition control

Safety & Security:
- Prompt Injection prevention
- PII redaction
- Content moderation (Moderation API)
- Rate limiting
- Cost monitoring

Best Practices:
- Version control prompts
- Cache responses to save costs
- Use system messages for instructions
- Validate JSON outputs programmatically
- Fallback mechanisms for API outages
By Antigravity Team

Related Rules

Recommended Workflows

View more workflows →

Recommended MCP Servers

View more MCP servers →

Take It Further

Maximize your productivity with these powerful resources

⚙️

Automate with Workflows

Combine this rule with automated workflows for maximum efficiency and consistency.

Browse Workflows
📖

Master Custom Rules

Discover advanced techniques for creating custom rules and mastering Antigravity.

Complete Guide