In LiteLLM, the dotprompt integration is a prompt management option that lets you load, version, and render reusable prompt templates written in Google’s .prompt file format (or inline content). [1, 2]
.prompt files and reference them by prompt_id through the LiteLLM Proxy. [1, 2, 3] How It Works
- File format.
.promptfiles combine YAML frontmatter (for metadata, default model settings, and parameters liketemperature) with Handlebars-style template syntax (e.g.,{{variable}}) for dynamic message formatting. [2, 4] - Decoupled from models. LiteLLM separates where a prompt comes from (
prompt_integration: dotprompt) from which LLM executes the request (model), letting you swap underlying models or update prompts independently. [3] - Loading options. You can load
.promptfiles locally from disk usingprompt_integration: "dotprompt", or fetch them directly from remote Git repositories usingbitbucketorgitlabintegrations for team-based version control. [1]
Basic Configuration Example
config.yaml), register a .prompt file under the prompts section: [1] prompt_id: "coding_assistant" along with any template variables, LiteLLM automatically renders the .prompt file into standard OpenAI-format messages and routes the request to the target LLM. [3, 5] config.yaml are static and require a proxy restart when edited; if you need to update prompts dynamically at runtime without restarts, use LiteLLM's /prompts API endpoints instead.) [1] - Whether you want an example of a
.promptfile structure (frontmatter + Handlebars variables) - How you plan to call the prompt (Python SDK, cURL, or OpenAI client)
- If you're hosting prompts locally or in GitLab/Bitbucket

