Skip to content

Optimize Templates

An optimize template is a saved rewrite style. It holds a prompt that tells the model how to rewrite whatever text you feed it — turn this into a business email, fix only the grammar, make it sound like a message to a friend. Optimize always runs with exactly one template selected.

Optimize templates are not conversation starters, and they are not personas. A template rewrites text you already have; a persona shapes how the assistant talks to you in a chat. Templates apply to Optimize mode only — you cannot pick an optimize template inside an Assistant chat, and the persona dropdown in the chat composer does not list them.

Open Settings → Optimize and scroll to Templates. Every template you have — the ones that ship with Pia and the ones you write — is a row in a list, with a panel beside it, the way Routines and Personas already work.

Pick a template to read its prompt in that panel, and edit it in place rather than in a pop-up window.

There is no separate “Templates” page in the sidebar. If you are looking for where to create a rewrite style, it is inside the Optimize settings section.

Pia comes with six built-in optimize templates, each marked with a Built-in badge:

Template What it does to your text
Clarity & Grammar Fixes errors and improves readability, keeping your meaning and length. This is the default.
Grammar & Spelling Fix Fixes only grammar, spelling and punctuation. It deliberately does not rephrase or restyle.
Business Email Rewrites casual text as formal business correspondence, with salutation and closing.
Community Article Rewrites the text as a friendly, readable blog or community post.
Message to Friend Rewrites formal text as a warm, casual message.
C# Code Prompt Restructures requirements into a prompt for generating C#/.NET code.
  1. Open Settings → Optimize and scroll to Templates
  2. Click Add Template — the Edit Template dialog opens
  3. Fill in the fields described below
  4. Click Save

The Edit Template dialog has three boxes and one button:

  • Template Name — what the template is called in the picker.
  • Style Description — a plain-language description of the tone, style and structure you want. This box is what Generate Prompt reads. It is not what gets sent to the model when you run the template.
  • Generate Prompt — asks the AI to turn your Style Description into an actual instruction, and writes the result into the Generated Prompt box.
  • Generated Prompt — the instruction that is actually sent to the model every time you run this template. This is the field that does the work.

Generated Prompt is sent to the model. Style Description is not.

Style Description exists only so that Generate Prompt has something to work from, and so you can remind yourself later what you were going for. When you run an optimize template on some text, Pia sends the Generated Prompt plus your text — nothing else from the dialog.

An optimize template needs a Template Name and a Generated Prompt. Those two are what Pia enforces, and a template with both will save.

Style Description is the one that surprises people. It carries a * in the dialog, because filling it in is the normal path — it is the only thing Generate Prompt reads. But it is not what the save is checked against: you can leave Style Description empty and still save, as long as you typed the Generated Prompt yourself.

Try to save without a name or without a generated prompt and Pia refuses. Depending on your version that is either a greyed-out Save button with a hint reading “Fill in the fields marked * to enable Save”, or an error when you click Save reading “Generated prompt is required. Describe your style and click ‘Generate Prompt’.” Either way the fix is the same — fill in the missing box. Nothing you have typed is lost.

You do not have to press Generate Prompt. The Generated Prompt box is an ordinary editable text box — type or paste your own instruction into it and save. The hint under the box, “You can edit the generated prompt manually”, means exactly that, and it applies whether or not you ever pressed the button.

Editing an AI-generated prompt afterwards is also fine. Pia does not regenerate or overwrite the Generated Prompt on save; whatever is in the box when you click Save is what the template will use.

Generate Prompt makes one AI request, so it does spend tokens. It runs on the persona the Assistant is currently set to, falling back to your Optimize-mode provider. There is no picker of its own, so the Assistant’s choice is the one that decides — keep it on a persona routed to a private model and your drafts stay there too. If no provider can be resolved, the button cannot complete and Pia reports that no AI provider is configured.

While the request is running the button shows Generating… and the Generated Prompt box is read-only. It becomes editable again as soon as the text arrives.

Advanced…, beside Generate Prompt, starts from the same single sentence and then asks the few things Pia cannot work out on its own — the tone to hit, a sample to rewrite — and fills the editor in from your answers. Everything it produces lands as an ordinary draft you can change before saving.

You can drag a mail or a document straight onto any box it asks you to fill in, so a sample you already have need not be pasted by hand. Word, Excel, PDF, Outlook messages and plain text files all work.

A template you create carries a description of its own, shown under its name in the list the way the built-ins’ descriptions are. Fill it in when you create the template, or add it later by editing one.

The default optimize template is the one Optimize starts with, and the one the Optimize hotkey and Fast Path use when they capture text from another app.

To change it, find the template you want in Settings → Optimize → Templates and click Set Default. The Default badge moves to it. Only one optimize template can be the default at a time.

If you have never set a default, Pia uses Clarity & Grammar — it is set as the default when Pia first runs, so the hotkey always has a template to work with even on a fresh install.

Click View Prompt on any template card to read the full instruction that template sends to the model, in a read-only viewer. This works on built-in templates too.

Reading a built-in’s prompt is a good starting point for your own optimize template. To build on one, Duplicate the built-in that is closest to what you want and edit the copy.

  • Edit — opens a template you created in the panel beside the list, with the fields filled in.
  • Duplicate — makes a copy you can change. This is the way to start from a built-in.
  • Delete — removes a template you created, after a confirmation.

Two templates cannot be deleted:

  • Built-in templates. They offer View Prompt, Duplicate and Set Default, but not Edit or Delete. Pia tells you so if you try. To get a variant of a built-in, Duplicate it and edit the copy.
  • Whichever template is currently the default. Set a different template as the default first, then delete the one you no longer want.

Optimize templates appear in one flat list and cannot be reordered, grouped, or foldered. The only position that is yours to control is which one is the Default.

Your optimize templates sync across your devices along with your choice of default template when Cloud Sync is on, and they are end-to-end encrypted before upload on plans that include E2EE. Built-in templates are not synced — every copy of Pia already has them.

  • Optimize — running a template on your text, and the Optimize hotkey
  • Personas — the equivalent idea for Assistant chats
  • AI Providers — setting the provider Optimize uses