Examples

Token Rate Limit Sentinel

Sentinel HA example for either official Redis or Red Hat Valkey

Praxis AI v0.11.0 (alpha) 2 min read

Switching projects opens that project’s default documentation release.

Versions marked “overview” do not contain this page. Selecting one opens that version’s documentation overview.

Category: Setup-dependent integration
Task: Sentinel HA example for either official Redis or Red Hat Valkey

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

Run it: Use ghcr.io/praxis-proxy/ai:0.11.0 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.

# Sentinel HA example for either official Redis or Red Hat Valkey.
# Add credentials through complete `${ENV_VAR}` references when the deployment
# requires ACLs; the example stays parseable in the repository test harness.
listeners:
  - name: default
    address: "127.0.0.1:8080"
    filter_chains: [main]

filter_chains:
  - name: main
    filters:
      - filter: router
        routes:
          - path: "/v1/chat/completions"
            cluster: backend

      - filter: token_rate_limit
        backend:
          kind: valkey # use `redis` for the Redis qualification lane
          sentinel:
            endpoints:
              - "redis://127.0.0.1:36379"
              - "redis://127.0.0.1:36380"
              - "redis://127.0.0.1:36381"
            service_name: mymaster
            # redis_password: "${TOKEN_RATE_LIMIT_REDIS_PASSWORD}"
            # sentinel_password: "${TOKEN_RATE_LIMIT_SENTINEL_PASSWORD}"
            discovery_timeout: 5s
          connect_timeout: 2s
          operation_timeout: 2s
        rules:
          - name: default
            algorithm: sliding_window
            window: 1h
            capacity: 100000
            reserved_tokens: 500
      - filter: token_count
        provider: openai
      - filter: load_balancer
        clusters:
          - name: backend
            endpoints:
              - "127.0.0.1:9000"

insecure_options:
  allow_private_endpoints: true