---
title: "LiteLLM Prompt Management (GitOps)"
url: "/docs/proxy/native_litellm_prompt"
canonical_url: "https://docs.litellm.ai/docs/proxy/native_litellm_prompt"
type: "docs"
last_updated: "2026-10-08"
summary: "Store prompts as .prompt files in your repository and use them directly with LiteLLM. No external services required."
related:
  - "/docs/proxy/custom_prompt_management"
  - "/docs/proxy/prompt_management"
---
# LiteLLM Prompt Management (GitOps)

> Index of all LiteLLM docs: https://docs.litellm.ai/llms.txt


Store prompts as `.prompt` files in your repository and use them directly with LiteLLM. No external services required.

## Supported Integrations

- **File System**: Store `.prompt` files locally
- **BitBucket**: Store `.prompt` files in BitBucket repositories with team-based access control
- **Gitlab**: Store `.prompt` files in Gitlab repositories with team-based access control
## Quick Start

**SDK**

**1. Create a .prompt file**

Create `prompts/hello.prompt`:

```yaml nolint
---
model: gpt-5.6-terra
temperature: 0.7
---
System: You are a helpful assistant.

User: {{user_message}}
```

**2. Use with LiteLLM**

```python
import litellm

# Set the global prompt directory
litellm.global_prompt_directory = "prompts/"

response = litellm.completion(
    model="dotprompt/gpt-5.6-terra",
    prompt_id="hello",
    prompt_variables={"user_message": "What is the capital of France?"}
)
```

**BITBUCKET**

**1. Create a .prompt file in BitBucket**

Create `prompts/hello.prompt` in your BitBucket repository:

```yaml nolint
---
model: gpt-5.6-terra
temperature: 0.7
---
System: You are a helpful assistant.

User: {{user_message}}
```

**2. Configure BitBucket access**

```python
import litellm

# Configure BitBucket access
bitbucket_config = {
    "workspace": "your-workspace",
    "repository": "your-repo",
    "access_token": "your-access-token",
    "branch": "main"
}

# Set global BitBucket configuration
litellm.set_global_bitbucket_config(bitbucket_config)
```

**3. Use with LiteLLM**

```python
response = litellm.completion(
    model="bitbucket/gpt-5.6-terra",
    prompt_id="hello",
    prompt_variables={"user_message": "What is the capital of France?"}
)
```

**GITLAB**

**1. Create a .prompt file in a gitlab repo**

Create `prompts/hello.prompt` in your gitlab repository:

```yaml nolint
---
model: gpt-5.6-terra
temperature: 0.7
---
System: You are a helpful assistant.

User: {{user_message}}
```

**2. Configure Gitlab access**

```python
import litellm

# Configure gitlab access
gitlab_config = {
    "project": "your-group/your-repo",  # project path or numeric project id
    "access_token": "your-access-token",
    "branch": "main"
}

# Set global gitlab configuration
litellm.set_global_gitlab_config(gitlab_config)
```

**3. Use with LiteLLM**

```python
response = litellm.completion(
    model="gitlab/gpt-5.6-terra",
    prompt_id="hello",
    prompt_variables={"user_message": "What is the capital of France?"}
)
```

**PROXY**

**1. Create a .prompt file**

Create `prompts/hello.prompt`:

```yaml nolint
---
model: gpt-5.6-terra
temperature: 0.7
---
System: You are a helpful assistant.

User: {{user_message}}
```

**2. Setup config.yaml**

```yaml
model_list:
  - model_name: my-dotprompt-model
    litellm_params:
      model: dotprompt/gpt-5.6-terra
      prompt_id: "hello"
      api_key: os.environ/OPENAI_API_KEY

litellm_settings:
  global_prompt_directory: "./prompts"
  # Or use BitBucket for team-based prompt management
  global_bitbucket_config:
    workspace: "your-workspace"
    repository: "your-repo"
    access_token: "your-access-token"
    branch: "main"
  # Or use Gitlab for team-based prompt management
  global_gitlab_config:
    project: "your-group/your-repo"  # project path or numeric project id
    access_token: "your-access-token"
    branch: "main"
```

**3. Start the proxy**

```bash
litellm --config config.yaml --detailed_debug
```

**4. Test it!**

```bash
curl -L -X POST 'http://0.0.0.0:4000/v1/chat/completions' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
    "model": "my-dotprompt-model",
    "messages": [{"role": "user", "content": "IGNORED"}],
    "prompt_variables": {
        "user_message": "What is the capital of France?"
    }
}'
```

### .prompt File Format

`.prompt` files use YAML frontmatter for metadata and support Jinja2 templating:

```yaml nolint
---
model: gpt-5.6-terra                    # Model to use
temperature: 0.7                # Optional parameters
max_tokens: 1000
input:
  schema:
    user_message: string        # Input validation (optional)
---
System: You are a helpful {{role}} assistant.

User: {{user_message}}
```

### Advanced Features

**Multi-role conversations:**

```yaml nolint
---
model: gpt-5.6-terra
temperature: 0.3
---
System: You are a helpful coding assistant.

User: {{user_question}}
```

**Dynamic model selection:**

```yaml nolint
---
model: "{{preferred_model}}"  # Model can be a variable
temperature: 0.7
---
System: You are a helpful assistant specialized in {{domain}}.

User: {{user_message}}
```

### API Reference

For prompt integrations, use these parameters:

**File System (dotprompt):**
```
model: dotprompt/<base_model>     # required (e.g., dotprompt/gpt-5.6-terra)
prompt_id: str                    # required - the .prompt filename without extension
prompt_variables: Optional[dict]  # optional - variables for template rendering
```

**BitBucket:**
```
model: bitbucket/<base_model>     # required (e.g., bitbucket/gpt-5.6-terra)
prompt_id: str                    # required - the .prompt filename without extension
prompt_variables: Optional[dict]  # optional - variables for template rendering
bitbucket_config: Optional[dict]  # optional - BitBucket configuration (if not set globally)
```

**Gitlab:**
```
model: gitlab/<base_model>        # required (e.g., gitlab/gpt-5.6-terra)
prompt_id: str                    # required - the .prompt filename without extension
prompt_variables: Optional[dict]  # optional - variables for template rendering
gitlab_config: Optional[dict]     # optional - Gitlab configuration (if not set globally)
```

**Example API calls:**

```python
# File system integration
response = litellm.completion(
    model="dotprompt/gpt-5.6-terra",
    prompt_id="hello",
    prompt_variables={"user_message": "Hello world"},
    messages=[{"role": "user", "content": "This will be ignored"}]
)

# BitBucket integration
response = litellm.completion(
    model="bitbucket/gpt-5.6-terra",
    prompt_id="hello",
    prompt_variables={"user_message": "Hello world"},
    bitbucket_config={
        "workspace": "your-workspace",
        "repository": "your-repo",
        "access_token": "your-token"
    }
)

# Gitlab integration
response = litellm.completion(
    model="gitlab/gpt-5.6-terra",
    prompt_id="hello",
    prompt_variables={"user_message": "Hello world"},
    gitlab_config={
        "project": "a/b/<repo_name>",
        "access_token": "your-access-token",
        "base_url": "gitlab url",
        "prompts_path": "src/prompts", # folder to point to, defaults to root
        "branch":"main"  # optional, defaults to main
    }
)
```

## Related pages

- [Custom Prompt Management](https://docs.litellm.ai/docs/proxy/custom_prompt_management.md)
- [Prompt Management](https://docs.litellm.ai/docs/proxy/prompt_management.md)
