Skip to content

Author and compile a PromptPack

Write your prompts in YAML, compile them to the pack.json that a PromptPack resource reads from its ConfigMap, and publish the pack.

  • packc, PromptKit’s compiler
  • kubectl access to the namespace you are deploying into

Step 1: write the prompt and the arena config

Section titled “Step 1: write the prompt and the arena config”

packc compile does not read a pack file. It reads an arena config and compiles every prompt the config lists into one pack. Create this layout:

config.arena.yaml
providers/openai-gpt4o-mini.provider.yaml
prompts/support.yaml

config.arena.yaml lists the prompts. The arena schema also requires providers and defaults, so list one provider file and a default (the values here are illustrative, and packc does not write them into the pack):

apiVersion: promptkit.altairalabs.ai/v1alpha1
kind: Arena
metadata:
name: customer-service
spec:
prompt_configs:
- id: support
file: prompts/support.yaml
providers:
- file: providers/openai-gpt4o-mini.provider.yaml
defaults:
temperature: 0.7

prompts/support.yaml holds the prompt:

apiVersion: promptkit.altairalabs.ai/v1alpha1
kind: PromptConfig
metadata:
name: support
spec:
task_type: support
version: 1.0.0
description: General support
system_template: |
You are a helpful customer service agent for {{company_name}}.
Be professional, empathetic, and solution-oriented.
variables:
- name: company_name
type: string
required: true
allowed_tools:
- get_order_status
parameters:
temperature: 0.7
max_tokens: 1024

The runtime offers the model only the tools a prompt lists. allowed_tools compiles to the prompt’s tools array in pack.json. A ToolRegistry tool that no prompt lists is not offered. Drop allowed_tools if the agent uses no tools.

Terminal window
packc compile --config config.arena.yaml --output pack.json --id customer-service

--id becomes the pack’s id, which must start with a lowercase letter and contain only lowercase letters, digits and hyphens. The pack’s version is the prompt’s version. packc validates the result against the PromptPack schema before it writes pack.json. The controller validates it again when you apply the resource in Step 4. See schema validation.

Terminal window
kubectl create configmap my-prompts --from-file=pack.json

The ConfigMap must hold a pack.json key and live in the namespace of the PromptPack.

Save this as promptpack.yaml:

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: PromptPack
metadata:
name: customer-service
spec:
packName: customer-service
version: "1.0.0"
source:
type: configmap
configMapRef:
name: my-prompts
Terminal window
kubectl apply -f promptpack.yaml

A published version is immutable. To change the prompts, compile again, create a new ConfigMap and a new PromptPack with a higher version. See the PromptPack reference for the version format.

Terminal window
kubectl get promptpack customer-service

The Phase column reads Active when source and schema validation passed and this is the highest version of customer-service on its channel (stable or prerelease). A newer version on the same channel makes it Superseded. A failed validation gives Failed: run kubectl describe promptpack customer-service and read the SourceValid and SchemaValid conditions.