Examples

Policy Llm

Authorizes body-addressed inference requests against llm: policy routes

Praxis v0.8.0 2 min read

Category: Setup-dependent integration
Task: Authorizes body-addressed inference requests against llm: policy routes

Prerequisites: The external service, credentials, or certificates referenced by this configuration.

Run it: Use ghcr.io/praxis-proxy/praxis:0.8.0 and follow the first reverse-proxy tutorial 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.

Companion resources from the same snapshot:

# Inference Authorization
#
# Authorizes body-addressed inference requests against `llm:` policy routes.
# The proxy reads the top-level `model`; missing, unlisted, and ambiguous
# models fail closed by default. No protocol classifier is required.
#
# Bodyless requests such as `GET /v1/models` carry no model. They run the
# policy's HTTP authorization, delegation and request assertions: an `http:`
# route when one matches, the `global` rules otherwise. Keep rules that read
# the inference request in `llm:` routes or `global.defaults.llm`.
# If `llm.require_model` is disabled, accepted unclassified bodies without a
# model still run this HTTP admission; the flag only relaxes the model gate.
#
# Point `config_path` at an operator-supplied policy. The integration fixture
# at `tests/integration/fixtures/llm-policy.yaml` provides a local example.
# `tests/integration/fixtures/llm-request-policy.yaml` adds OPA and CEL
# rules that read the parsed request body, such as its `tools`, as
# `llm.request`. It also demonstrates a prompt rule over Responses tool history.
#
# The standard build includes the Policy builtins. For a build with defaults
# disabled, select the builtins referenced by the operator-supplied policy.
#
filter_chains:
  - name: main
    filters:
      - filter: policy
        config_path: /etc/praxis/llm-policy.yaml
        llm:
          require_model: true
          provider: openai

      # URL-addressed providers do not expose the model this filter evaluates.
      - filter: router
        routes:
          - path_prefix: "/v1/"
            cluster: inference

      - filter: load_balancer
        clusters:
          - name: inference
            endpoints:
              - "127.0.0.1:3000"

insecure_options:
  allow_private_endpoints: true