Skip to content

discussion: add "standard routing header" that gets prioritized  #73

@mathetake

Description

@mathetake

per #71 (comment)

Currently, users have to specify all routing conditions in LLMRoute.Rules. For example, if an AI Gateway user wants to allow clients to select backend by themselves, they need to define something like

apiVersion: aigateway.envoyproxy.io/v1alpha1
kind: LLMRoute
metadata:
  name: some-route
  namespace: default
spec:
  inputSchema:
    schema: OpenAI
  rules:
    - matches:
      - headers:
        - type: Exact
          name: some-random-header-that-can-be-sent-directly-by-clients
          value: foo
      backendRefs:
        - name: somebackend
 ....

and tells the clients that use -H some-random-header-that-can-be-sent-directly-by-clients: somebackend to select the backend. This is not that inconvenient because at the end of the day there won't be hundreds of backends but at most tens.

On the other hand, we can provide the "standard routing header", say x-ai-gateway-backend, that effectively ignores the LLMRoute.Rules and routes the requests to the backend specified in the value of the standard header. To do so, we need to know which backends can be routed via that headers at the HTTPRoute construction phase. One way is to allow routing to any backend in the same namespace as LLMRoute, or only route to backends that appear in LLMRoute.Rules.

Personally, i feel this "implicit routing" might makes things more confusing, but agree this will provide better experience, in fact this is how the PoC works which is because it didn't have the Rules and routing inside extproc.

i am opening this issue as I feel at least this is worth the discussion.

cc @envoyproxy/assignable

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionTo be discussed in community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions