nicobailon/pi-prompt-template-model
Pi extension: Add model frontmatter to prompt templates for automatic model switching
What it solves
It eliminates the manual effort of switching AI models, loading specific skill contexts, or adjusting thinking levels when performing different tasks. Instead of manually configuring the agent for every new request, users can define these settings once in a prompt template and trigger them via a slash command.
How it works
The extension adds new frontmatter fields (model, skill, thinking) to prompt templates. When a slash command is executed, the system automatically:
- Switches to the specified model (with support for provider-specific IDs and fallback lists).
- Injects the requested skills (contextual knowledge or tools) directly into the prompt.
- Sets the model's thinking level (e.g., low, medium, high).
- Restores the previous session settings once the task is complete.
It also supports advanced execution flows, such as delegating tasks to subagents, running prompts in parallel, looping executions, and a "Best-of-N" compare flow where multiple models generate candidates that are then reviewed and applied.
Who it’s for
Developers and power users of the pi agent environment who want to create specialized, self-contained "agent modes" for specific workflows like debugging, deep analysis, or code review.
Highlights
- Automatic Model Management: Switches models and thinking levels on the fly and restores the original session state afterward.
- Skill Injection: Bypasses the need for the agent to manually find and load skills, injecting them directly into the context.
- Subagent Delegation: Ability to hand off tasks to separate subagents with optional context forking and parallel execution.
- Best-of-N Comparison: A sophisticated pipeline that runs multiple worker models in parallel, uses reviewers to evaluate outputs, and an optional final applier to merge the best result.
- Dynamic Prompting: Supports argument substitution (e.g.,
$1,$@) and model-specific conditional blocks within the prompt body.
Related
- Project
- Project
- Project
- Project
- Project