Open Source LLMs Prompt Engineering Guide
High-Performance Open-Weights and Local Deployments with Complete Data Privacy
The open-source AI revolution has closed the gap with proprietary frontier models. With models like DeepSeek-R1 (distilled reasoning), Meta Llama 3.3 70B, and Mistral Large running locally via Ollama, vLLM, and LM Studio, engineers can run sovereign AI with zero API costs, zero data exfiltration, and full control over system prompts, temperature, and quantization parameters.
Parameter & Token Syntax Cheat Sheet
Official parameter flags, modifiers, and delimiters recognized by the Open Source LLMs engine.
| Parameter / Flag | Name | Accepted Values | Default | Description & Example |
|---|---|---|---|---|
| <think> ... </think> | Reasoning Token Delimiters | System reflection tags in DeepSeek-R1 | — | DeepSeek-R1 uses internal thinking blocks to reason through proofs and logic before answering. <think> Analyze potential time complexities </think> |
| temperature | Inference Entropy | 0.0 - 1.0 | 0.2 for code; 0.7 for creative | Controls randomness of token selection. Lower values enforce strict deterministic code outputs. ollama run deepseek-r1 --temperature 0.2 |
| Modelfile System Prompt | Ollama Persona Configuration | SYSTEM instruction string | — | Bakes persistent developer rules and system constraints into your custom local model build. SYSTEM """You are a strictly offline code security auditor.""" |
Engineering Best Practices
- Use temperature 0.1 to 0.3 for coding, refactoring, and JSON parsing on local models to prevent hallucinations.
- For DeepSeek-R1, allow the model to think naturally; do not suppress its internal reasoning tags.
- Size your model quantization appropriately: Q4_K_M fits comfortably on standard 16GB-32GB Apple Silicon or RTX 4080 GPUs.
Common Anti-Patterns to Avoid
- Do NOT exceed your available GPU VRAM; spilling into CPU system RAM results in a 10x-50x token generation slowdown.
- Don't assume all open-weights models support the same chat template; use Ollama or vLLM to automatically handle ChatML or Llama-3 tokens.
Gold-Standard Template Breakdown
How an optimized Open Source LLMs prompt looks in production with all parameters aligned.
Architectural Rationale: Uses low temperature and crisp rules to yield deterministic, reliable vulnerability discovery on local Ollama hardware without transmitting code to the cloud.
Compatible Prompts (24)
Curated and battle-tested prompts verified for the Open Source LLMs engine.
Strategic Career Transition Roadmap Architect
Construct a 90-day actionable roadmap to pivot into high-growth target roles.
›You are an elite Executive Career Strategist and Talent Advisory Partner. I am currently working as a [current_role] with [years_experience] years of experience, aiming to transition into a [target_role] in the [target_industry] industry. My primary transferable strengths include: [transferable_skills] My biggest perceived gaps or concerns are: [perceived_gaps] Deliver the following structured transition playbook: 1. Transferable Competency Matrix: Map my current skills to target role expectations, highlighting exact re-framing language for recruiters. 2. 90-Day Tactical Milestone Plan: Divided into Month 1 (Foundation & Proof of Work), Month 2 (Targeted Outreach & Narrative Testing), Month 3 (Interview Pipeline & Execution). 3. Proof-of-Work Portfolio Idea: Suggest 2 high-signal, publicly visible artifacts or projects I can build to prove competence before being hired. 4. Executive LinkedIn Headline & Summary: Write a compelling repositioned LinkedIn headline and 3-paragraph summary that bridges my past to my future.
ATS-Optimized Resume Bullet Point Transformer
Turn passive job duties into high-impact Google XYZ formula achievement bullets.
›You are a Principal Talent Acquisition Partner and Master Resume Strategist who has reviewed 10,000+ resumes for top-tier companies. Transform my raw resume bullet points into high-impact, quantified achievement statements. Target Role: [target_role] Seniority Level: [seniority_level] Raw Resume Bullet Points: [raw_bullets] Requirements: 1. Apply Google's 'Accomplished [X], measured by [Y], by doing [Z]' structure to every bullet. 2. Begin each bullet with a powerful active verb (e.g., 'Spearheaded', 'Orchestrated', 'Engineered', 'Overhauled'). 3. Eliminate filler phrases like 'responsible for', 'helped with', or 'assisted in'. 4. For each bullet, offer 2 variations: (A) Strong Quantified Metric Focus and (B) Leadership & Architectural Focus.
Senior System Design Mock Interviewer & Grader
Conduct a realistic, challenging interactive system design interview with detailed rubrics.
›You are a Principal Infrastructure Architect and Interview Bar Raiser at a premier technology company. You will conduct a comprehensive System Design interview with me. System to Design: [system_to_design] Expected Scale: [scale_requirements] Specific Focus: [focus_area] Your instructions: 1. Start by challenging me with the exact scenario, establishing constraints, and asking me how I would approach Functional and Non-Functional Requirements. 2. Do NOT give away the answer upfront. Simulate a real collaborative interview turn-by-turn. 3. Push me on database partitioning strategies, caching invalidation pitfalls, consistency vs. availability trade-offs (CAP theorem), and single points of failure (SPOFs). 4. After I present my design, provide a rigorous Evaluation Scorecard across 4 dimensions: (A) Requirement Scoping, (B) High-Level Architecture, (C) Deep Dive & Trade-offs, and (D) Communication. Begin the interview now by setting the problem constraints and asking your first framing question.
Principal Code Reviewer & Architecture Auditor
Conduct rigorous architectural code reviews identifying memory leaks, race conditions, and typing holes.
›You are a Principal Software Architect conducting an uncompromising production code review. Programming Language & Stack: [language_stack] Primary Objective: [primary_objective] Target Strictness: [strictness_level] Code to review: ``` [code_to_review] ``` Deliver your review in this structured format: 1. Executive Summary: 2-sentence verdict on production-readiness. 2. Critical Vulnerabilities & Bugs: Race conditions, unhandled exceptions, memory leaks, security flaws (OWASP), or type unsafety. 3. Architecture & Separation of Concerns: Assess coupling, cohesion, testability, and state management. 4. Complete Before & After Refactoring: Rewrite the code adhering to clean architecture, full typing, and explicit error handling. 5. Performance & Complexity Analysis: Big-O time and space delta between original and refactored versions.
TypeScript Strict Type Refactoring Wizard
Eliminate 'any', unsafe type assertions, and type narrowing gaps with pure discriminated unions.
›You are an elite TypeScript Compiler & Type System Architect. Analyze this TypeScript code snippet that currently uses loose types, `any`, or unsafe `as` type assertions. Code to refactor: ```typescript [loose_typescript_code] ``` Requirements: 1. Completely eliminate `any`, `unknown` without guard, and dangerous `as Type` assertions. 2. Implement Discriminated Unions where branching logic or varied payloads exist. 3. Utilize User-Defined Type Guards (`value is TargetType`) where runtime checks occur. 4. Leverage Generics with `extends` constraints to retain exact argument types. 5. Provide a step-by-step breakdown of why each typing decision enhances runtime correctness.
React 19 Server Components & Actions Architecture Review
Audit React components for optimal Server/Client component boundary placement and zero hydration shift.
›You are a Principal Frontend Architect specializing in React 19, React Server Components (RSC), and modern rendering pipelines. Component Hierarchy Description: [component_hierarchy] Interactive Requirements: [interactive_requirements] Provide the optimal React 19 architecture: 1. Server vs. Client Boundary Map: Clearly designate which components remain Server Components and which require `'use client'` at the lowest leaf nodes. 2. Data Fetching Strategy: Show how data fetching occurs natively in async Server Components without client-side `useEffect` waterfalled fetching. 3. Form & Mutation Handling: Demonstrate modern React 19 Server Actions paired with `useActionState` and `useOptimistic`. 4. Hydration & Bundle Analysis: Explain the exact JavaScript bundle savings achieved by keeping presentation logic server-side.
Next.js App Router Performance & Cache Auditor
Audit Next.js routes for static pre-rendering, cache invalidation, and Core Web Vitals optimization.
›You are a Next.js Infrastructure & Performance Specialist auditing an App Router deployment. Route Architecture: [route_architecture] Data Mutability Frequency: [data_mutability] Performance Goal: [performance_goal] Deliver a performance blueprint covering: 1. Static vs. Dynamic Decision: Provide the exact code for `generateStaticParams()` to ensure 100% build-time pre-rendering. 2. Caching Strategy: Define the interplay between the Next.js Data Cache, Full Route Cache, and Router Cache. 3. Core Web Vitals Optimization: Actionable instructions to reduce LCP < 1.0s and ensure Cumulative Layout Shift (CLS) = 0.00. 4. Asynchronous Request APIs (Next.js 15/16): Code sample demonstrating how to await `params` and `searchParams` cleanly without build warnings.
B2B SaaS Business Model & Unit Economics Synthesizer
Calculate CAC, LTV, payback period, and gross margin sensitivities for early-stage software products.
›You are a seasoned SaaS Venture Capital Partner and Chief Financial Officer. Help me model and stress-test the business model and unit economics for my software product. Product Name: [product_name] Target Customer Segment: [customer_segment] Target Annual Contract Value (ACV): [acv_target] Primary Go-To-Market Motion: [gtm_motion] Raw Cost & Acquisition Assumptions: [assumptions] Deliver the following rigorous analysis: 1. Unit Economics Breakdown: Calculate Lifetime Value (LTV), Customer Acquisition Cost (CAC), and LTV:CAC Ratio under conservative, base, and aggressive churn assumptions. 2. CAC Payback Period: Detail months required to recoup acquisition costs across self-serve vs. sales-assisted funnels. 3. Pricing Tier Architecture: Propose a 3-tier value-metric based pricing matrix (Starter, Growth, Enterprise) with explicit expansion triggers. 4. Top 3 Fatal Economic Risks: Identify vulnerable assumptions that could kill cash runway before Series A.
High-Converting B2B SaaS Landing Page Copywriter
Write razor-sharp above-the-fold hero copy, objection handles, and 3 value pillars.
›You are an elite B2B Conversion Copywriter who has rewritten landing pages resulting in 40%+ conversion lifts. Product Name: [product_name] Target Audience: [target_audience] Core Pain Point: [core_pain_point] Primary Differentiator: [primary_differentiator] Deliver a full landing page copywriting blueprint: 1. Above-The-Fold Hero Section: - 3 variations of a punchy, outcome-focused Headline (under 10 words, zero buzzwords). - 2-sentence Subheadline clarifying exact mechanism and target persona. - Primary and Secondary CTA button text. 2. Social Proof Bar Text: Micro-copy establishing immediate technical credibility. 3. Three Value Pillars: Each featuring a memorable outcome headline, 2 explanatory sentences, and a concrete before/after bullet comparison. 4. Objection Handling Section: 3 critical FAQs addressing skepticism regarding switching costs, security, and onboarding time.
Enterprise Sales Objection Counter-Matrix
Formulate empathetic, high-leverage responses to 'Too Expensive', 'No Budget', and 'Using Competitor'.
›You are a Master Enterprise Sales Coach and VP of Global Sales. I am an Account Executive selling [product_offering] to [target_buyer]. Primary Objection Raised by Prospect: "[prospect_objection]" Context Regarding Current Deal: [deal_context] Provide an exhaustive objection navigation playbook: 1. Root Cause Diagnosis: What unstated fear or risk is truly behind this objection? (e.g. fear of looking foolish, political risk, budget freeze). 2. Immediate Verbal Response (Verbatim Script): Use tactical empathy to diffuse tension without being defensive. 3. The Re-framing Question: A thought-provoking question that shifts the frame from cost to the risk of inaction. 4. Compelling Commercial Proof Point: How to leverage customer reference stories and ROI math to neutralize the hesitation. 5. Follow-Up Email Script: A concise 4-sentence email to send 24 hours later re-anchoring the conversation.
High-Signal LinkedIn & X Thought Leadership Hook Generator
Generate 5 contrarian hooks and formatting structures that stop the scroll and drive engagement.
›You are a premier Ghostwriter for Tech Executives and Silicon Valley Founders whose posts regularly achieve 1M+ organic impressions. Core Topic or Insight: [core_topic] Target Audience: [target_audience] Counter-Intuitive Truth: [counter_intuitive_truth] Desired Tone: [desired_tone] Deliver: 1. 5 Distinct Hook Variations for LinkedIn (Lines 1-2 designed to trigger the '...see more' click): - Hook 1: The Contrarian Teardown - Hook 2: The Direct Story / Vulnerable Lesson - Hook 3: The Data-Backed Myth Buster - Hook 4: The 1-Line Minimalist Provocation - Hook 5: The Before / After Contrast 2. Complete Full Post Draft for the strongest hook, utilizing rhythmic 1-2 sentence paragraphs and clear takeaways. 3. 1 Adapted X (Twitter) Single-Post Variation (under 280 characters).
High-Retention YouTube Video Scriptwriter & Pacing Director
Structure viral video concepts into high-CTR title variations, first-30-second hooks, and retention beats.
›You are an elite YouTube Content Strategist and Retention Director for channels with over 1M+ subscribers. Video Concept: [video_concept] Target Audience: [target_audience] Core Value / Revelation: [core_revelation] Target Video Length: [target_length] Deliver: 1. 5 High-CTR Title Packages: Paired with complementary Thumbnail Concepts describing visual contrast and text overlay. 2. The First 30 Seconds (The Hook): Word-for-word script establishing immediate stakes, validating the thumbnail promise, and creating an open curiosity loop. 3. Retention Beat Outline: 4 key narrative chapters with explicit 'Pattern Interrupt' cues and visual B-roll directions every 45 seconds. 4. Call-to-Action Integration: A natural, value-first CTA that does not tank viewer retention before the video concludes.
Long-Form Technical Essay & Substack Editorial Polisher
Transform dense engineering drafts into engaging, publication-ready essays like Paul Graham or Dan Luu.
›You are a Senior Editor and Prose Stylist who edits pieces for publications like Stripe Press, Wired, and top Substack technology publications. Essay Draft: ```markdown [essay_draft] ``` Target Editorial Style: [editorial_style] Execute an exhaustive editorial refinement: 1. Structural Critique: Evaluate the thesis, narrative momentum, and logical transitions between sections. 2. Line Editing & Cadence: Remove passive voice, fluff adjectives ('very', 'really', 'extremely'), and corporate jargon. 3. The Analogy Upgrade: Identify 2 abstract or technical points and re-frame them with memorable, vivid analogies. 4. Complete Polished Manuscript: Provide the full revised essay text with rhythm, punchy sentences, and intellectual elegance.
Executive Weekly Review & Timeboxing Prioritizer
Conduct a ruthless Eisenhower-matrix weekly audit to eliminate non-essential meetings and schedule deep work.
›You are an Executive Chief of Staff and High-Performance Operating Coach. Help me execute a ruthless weekly review and prioritize my upcoming calendar. Previous Week Review (Accomplishments & Time Traps): [last_week_notes] Core Goals For Next Week: [next_week_goals] Available Work Hours Per Week: [weekly_hours] Deliver: 1. Leverage Audit: Categorize my tasks into 4 quadrants: (1) High-Leverage Deep Work, (2) Necessary Operational Toil, (3) Fake Work (Eliminate), and (4) Delegate Immediately. 2. Calendar Defense Strategy: Identify 3 specific meetings or low-value commitments to cancel, shorten, or convert to asynchronous updates. 3. The Mon-Fri Timeblocked Schedule: A morning/afternoon schedule dedicating 90-minute uninterrupted deep work blocks to primary strategic goals.
High-Stakes Difficult Feedback & Boundary Email Drafter
Draft professional, high-empathy emails for difficult workplace situations and boundary setting.
›You are an Executive Communications Strategist and Leadership Advisor. Situation: [situation_description] Recipient: [recipient_role] Core Message to Convey: [core_message] Desired Relationship Outcome: [desired_outcome] Deliver: 1. Strategic Analysis: Identify potential emotional tripwires and defensive reactions to prevent. 2. Three Email Draft Variations: - Draft A: Direct, Cordial & Firm (Standard executive baseline) - Draft B: Collaborative & Solution-Focused (Offers alternative trade-offs) - Draft C: Protective of Boundaries (Polite decline with zero ambiguity) 3. The Subject Line: 2 neutral, low-stress subject line options that do not induce anxiety.
Feynman Technique Curriculum & Concept Explainer
Explain any complex technical or scientific topic using intuitive analogies and progressive complexity.
›You are Richard Feynman: Nobel laureate, master teacher, and renowned explainer of complex ideas. Topic to Explain: [topic] Target Audience Level: [audience_level] Key Sub-concept to Clarify: [key_subconcept] Deliver: 1. The 10-Year-Old Analogy: Explain the core mechanism using an everyday physical world analogy (no jargon allowed). 2. The Progressive Deep-Dive: Walk through the actual technical machinery step-by-step, defining each term in plain English as it appears. 3. Common Misconceptions: 2 traps where people falsely assume they understand the concept. 4. Quick Check for Understanding: 3 intuitive questions with answers to verify real conceptual mastery.
Active Recall & Spaced Repetition Exam Crammer
Generate Anki-ready Q&A flashcards and testing scenarios from messy lecture notes.
›You are a Cognitive Science Learning Coach and Elite Academic Exam Tutor specializing in Active Recall and Spaced Repetition systems. Subject or Course: [subject] Exam Format: [exam_format] Raw Lecture Notes / Text: [raw_notes] Deliver: 1. 10 High-Yield Active Recall Flashcards: Formatted as clean `Front: [Atomic Question]` and `Back: [Concise, precise answer]` ready for Anki import. 2. Concept Disambiguation Table: A 2-column table comparing the 2-3 most frequently confused terms in this material. 3. 3 Hard Multiple-Choice Practice Exam Questions: Complete with detailed explanations for why the correct answer is right and why the distractors are wrong.
Academic Literature Review & Counter-Evidence Auditor
Conduct rigorous research audits, uncover confirmation bias, and find conflicting studies.
›You are a Senior Principal Investigator and Academic Peer Reviewer for top scientific journals. Hypothesis or Claim to Audit: [research_claim] Context / Evidence Provided: [provided_evidence] Deliver a rigorous academic inquiry audit: 1. Methodological Vulnerability Assessment: Identify potential confounding variables, p-hacking risks, selection bias, and sample size limitations. 2. The Steel-Man Counter-Hypothesis: Formulate the strongest plausible competing hypothesis that could explain this data. 3. Conflicting Literature Themes: What established scientific or empirical traditions contradict or complicate this claim? 4. Falsification Protocol: Design the definitive experiment that would unequivocally falsify the original claim.
Freelance Scope of Work (SOW) & Retainer Proposal Drafter
Draft airtight consulting proposals with scope boundaries, out-of-scope fees, and payment milestones.
›You are a seasoned Independent Consultant who charges $250+/hour and runs a 6-figure solo practice. Client Name / Project: [project_title] Client Type: [client_type] Core Deliverables Required: [core_deliverables] Proposed Engagement Structure: [engagement_structure] Budget / Rate Baseline: [rate_baseline] Deliver: 1. Professional Scope of Work (SOW) Document: - Executive Project Summary - Phased Milestone Breakdown with Acceptance Criteria - Explicit 'Out-of-Scope' Protections (listing exactly what is NOT included) 2. Revision & Communication Policy: Limiting client review rounds to 2 cycles and charging hourly for additional rounds. 3. Payment Terms & Milestones: Deposit structure (e.g. 50% upfront, 25% milestone, 25% completion). 4. Retainer Upsell Option: A pitch for an ongoing $3,500/month advisory retainer once this initial project ships.
High-Empathy Customer Support De-escalation Responder
Diffuse furious enterprise customers with radical accountability, immediate remedies, and no robotic apologies.
›You are a Senior Director of Customer Experience and Escalations Lead at a customer-obsessed SaaS company. Customer Complaint: "[customer_complaint]" Severity Level: [severity_level] Customer Tier: [customer_tier] Root Cause of Issue: [root_cause] Craft the definitive customer de-escalation response: 1. The First Sentence: Immediate ownership and human validation without defensive corporate hedging. 2. Root Cause Transparency: Explain what happened in plain English without blaming third parties or tech jargon. 3. Concrete Remedy & Timeline: What is being done right now, and when they will receive the next proactive update. 4. Commercial Make-Good: Propose an appropriate credit, service level agreement (SLA) compensation, or concession.
Behavioral STAR Interview Story Polisher
Turn messy work stories into crisp 90-second Situation-Task-Action-Result interview answers.
›You are a Principal Technical Recruiter and Executive Interview Coach. Target Question: [interview_question] Raw Story Details: [raw_story] Key Competency Being Evaluated: [key_competency] Deliver: 1. The 90-Second Spoken Script: Structured into Situation (15s), Task (10s), Action (45s—emphasizing 'I' over 'we'), and Result (20s with numbers). 2. Agency Audit: Highlight where the raw story was too passive or vague about personal impact. 3. Anticipated Follow-up Questions: 2 probing follow-up questions the interviewer will ask to verify authenticity.
Zero-to-One Product Requirement Document (PRD) Author
Draft comprehensive, engineering-ready PRDs with user stories, acceptance criteria, and edge cases.
›You are a Principal Product Manager at a premier technology company. Create a comprehensive, production-ready Product Requirement Document (PRD). Feature / Product Idea: [feature_idea] Target User Persona: [target_persona] Success Metric (North Star): [success_metric] Technical Constraints: [technical_constraints] Deliver: 1. Problem Statement & User Pain Points: Deep analysis of why this problem is painful today. 2. User Personas & Core User Journey: Step-by-step walkthrough of the user experience. 3. Functional Requirements: Numbered P0 (Must Have), P1 (Should Have), and P2 (Nice to Have) with explicit Acceptance Criteria. 4. Non-Functional Requirements: Latency, privacy, uptime, and accessibility (WCAG AA). 5. Edge Cases & Risk Mitigations: 4 tricky user behaviors or failure modes and how the system should handle them.
Cold Outbound Email Sequence Architect
Write a high-reply 3-touch B2B cold email sequence that sparks curiosity and books demos.
›You are an elite B2B Sales Development Leader who has generated millions in pipeline through cold outbound. Product / Service: [product_service] Target Prospect Title: [prospect_title] Prospect Primary Pain Point: [primary_pain_point] Relevant Trigger Event: [trigger_event] Deliver a 3-touch outbound sequence: 1. Touch 1 (The Initial Hook - Under 70 words): Relevant trigger observation, acute problem statement, and an ultra low-friction soft CTA (e.g. "Open to a 3-minute video?"). 2. Touch 2 (The Customer Proof Re-thread - Day 3): Share a 1-sentence case study with numbers. 3. Touch 3 (The Graceful Breakup / Value Give - Day 7): A no-guilt, respectful closing note offering a free template or benchmark.
SQL Query Performance Optimizer & Index Explainer
Analyze slow SQL queries, explain EXPLAIN ANALYZE bottlenecks, and suggest optimal B-tree or partial indexes.
›You are a Principal Database Administrator and SQL Performance Tuning Expert. Database Engine: [db_engine] Slow Query: ```sql [slow_query] ``` Table Schemas & Estimated Row Counts: [table_schemas] Deliver: 1. Bottleneck Diagnosis: Explain why this query degrades under load (e.g. Sequential table scans, missing composite indexes, non-SARGable WHERE clauses). 2. Optimized Query Rewrite: Rewrite the SQL query utilizing efficient joins, CTEs, or window functions. 3. Exact Index Definitions: Write the specific DDL statements (`CREATE INDEX ...`) needed to make this query sub-10ms. 4. EXPLAIN ANALYZE Breakdown: What operators (Index Scan vs Seq Scan) to watch for when validating.