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.
Prerequisites
Section titled “Prerequisites”packc, PromptKit’s compilerkubectlaccess 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.yamlproviders/openai-gpt4o-mini.provider.yamlprompts/support.yamlconfig.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/v1alpha1kind: Arenametadata: name: customer-servicespec: prompt_configs: - id: support file: prompts/support.yaml providers: - file: providers/openai-gpt4o-mini.provider.yaml defaults: temperature: 0.7prompts/support.yaml holds the prompt:
apiVersion: promptkit.altairalabs.ai/v1alpha1kind: PromptConfigmetadata: name: supportspec: 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: 1024The 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.
Step 2: compile to pack.json
Section titled “Step 2: compile to pack.json”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.
Step 3: load it into a ConfigMap
Section titled “Step 3: load it into a ConfigMap”kubectl create configmap my-prompts --from-file=pack.jsonThe ConfigMap must hold a pack.json key and live in the namespace of the
PromptPack.
Step 4: create the PromptPack resource
Section titled “Step 4: create the PromptPack resource”Save this as promptpack.yaml:
apiVersion: omnia.altairalabs.ai/v1alpha1kind: PromptPackmetadata: name: customer-servicespec: packName: customer-service version: "1.0.0" source: type: configmap configMapRef: name: my-promptskubectl apply -f promptpack.yamlA 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.
Verify
Section titled “Verify”kubectl get promptpack customer-serviceThe 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.
Related
Section titled “Related”- PromptPack CRD reference: spec, status and conditions
- PromptPack validation: how the controller validates a pack
- Use skills: attach skill content to a pack