Prompt Enrichment
Injects system messages into OpenAI-compatible chat completion requests before forwarding to the upstream provider
Category: Setup-dependent integration
Task: Injects system messages into OpenAI-compatible chat completion requests before forwarding to the upstream provider
Prerequisites: The external service, credentials, or certificates referenced by this configuration.
Run it: Use ghcr.io/praxis-proxy/ai:0.4.1 and follow the container quickstart to mount and start the configuration.
This configuration comes from the selected release. The example has not been run here; external services are not bundled.
Download the source file.
# Prompt Enrichment
#
# Build:
#
# Injects system messages into OpenAI-compatible chat completion
# requests before forwarding to the upstream provider. The system
# prompt is defined at the proxy layer and cannot be overridden
# by clients.
#
# Only static configured messages are supported. Prepend accepts
# only system role; append accepts system or user roles.
#
# JSON is reserialized, so byte-for-byte body identity and key
# order are not preserved.
#
# Example request:
#
# curl -X POST http://localhost:8080/v1/chat/completions \
# -H "Content-Type: application/json" \
# -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello"}]}'
#
# The upstream receives the request with the system message
# prepended and the citation reminder appended.
listeners:
- name: gateway
address: "0.0.0.0:8080" # dev value; binds all interfaces
filter_chains:
- enrich-and-route
filter_chains:
- name: enrich-and-route
filters:
- filter: prompt_enrich
prepend:
- role: system
content: >-
You are a helpful assistant for Acme Corp.
Always be concise and professional.
append:
- role: user
content: "Remember to cite your sources."
- filter: router
routes:
- path_prefix: "/"
cluster: provider
- filter: load_balancer
clusters:
- name: provider
endpoints:
- "127.0.0.1:3000"
insecure_options:
allow_private_endpoints: true # example proxies to local backends