Skip to content

Allow a Lua filter to run after AIGW's ext proc? #1469

@owayss

Description

@owayss

Just like Wasm, it's sometimes desirable to have a simple Lua filter run after the ai gateway's own ext proc so it can leverage the metadata provided by aigw's ext_proc (i.e. the x-ai-eg-model header) to add some extra internal headers based on the model's name extracted by aigw.

The Envoy Gateway allows this filter ordering via https://gateway.envoyproxy.io/docs/tasks/operations/customize-envoyproxy/#customize-filter-order, however the AI Gateway's injection of ext proc only ensures it's placed before a limited set of filters:

var afterExtProcFilterPrefixes = []string{
egv1a1.EnvoyFilterExtProc.String(),
egv1a1.EnvoyFilterWasm.String(),
egv1a1.EnvoyFilterRBAC.String(),
egv1a1.EnvoyFilterLocalRateLimit.String(),
egv1a1.EnvoyFilterRateLimit.String(),
egv1a1.EnvoyFilterCustomResponse.String(),
egv1a1.EnvoyFilterCredentialInjector.String(),
egv1a1.EnvoyFilterCompressor.String(),
egv1a1.EnvoyFilterRouter.String(),

I think the same argument for allowing Wasm to run after ext_proc can also be made for Lua.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions