You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Praxis request-body filters using StreamBuffer run before normal on_request filters. Routing and load balancing happen later during on_request.
This supports routing based on information extracted from the body, but not the reverse: a filter cannot transform the request body based on the selected upstream.
For example, Praxis AI may receive an OpenAI Responses request and route it to either:
A backend that natively supports the Responses API.
A backend that only supports Chat Completions and requires translation.
We want to support both through one Responses pipeline. The response store, validation, rehydration, and agentic-loop state should not need to be duplicated based on the eventual backend protocol.
Today the translation filter must run before it knows which cluster was selected.
Proposal
Add a supported lifecycle point for transforming a buffered request after routing and load balancing, but before the upstream request is sent:
All endpoints in a cluster would use the same application protocol.
Praxis core would expose the selected value through HttpFilterContext. Core would treat it as an opaque identifier; application-specific filters would interpret supported values.
A Responses translation filter could then:
Pass the request through for openai_responses.
Translate it for openai_chat_completions.
Fail closed when the selected protocol is missing or unsupported.
iterative_request_router should execute the same phase for each internal exchange so agentic-loop inference requests behave like normal proxy requests.
The exact API is open for discussion. This could be a dedicated request-body callback or a more general post-upstream-selection hook with mutable access to the buffered body.
Alternatives
Two protocol-specific pipelines work when routing is static, but duplicate the Responses lifecycle and its stateful filters.
Moving all routing before body processing would make upstream metadata available earlier, but would interfere with routing decisions derived from request bodies.
Adding this behavior specifically to an AI routing filter would couple translation to that router and would not work with the standard router or other cluster selectors.
Example
OpenAI Responses request
↓
shared validation, store and agentic loop
↓
select cluster
├─ native Responses → pass through
└─ Chat Completions → translate
Does a generic post-routing transformation capability belong in Praxis core? If so, should it be modeled as a dedicated body phase or as a broader post-upstream-selection hook?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem
Praxis request-body filters using
StreamBufferrun before normalon_requestfilters. Routing and load balancing happen later duringon_request.This supports routing based on information extracted from the body, but not the reverse: a filter cannot transform the request body based on the selected upstream.
For example, Praxis AI may receive an OpenAI Responses request and route it to either:
We want to support both through one Responses pipeline. The response store, validation, rehydration, and agentic-loop state should not need to be duplicated based on the eventual backend protocol.
Today the translation filter must run before it knows which cluster was selected.
Proposal
Add a supported lifecycle point for transforming a buffered request after routing and load balancing, but before the upstream request is sent:
Clusters would also carry an optional application-level protocol identifier:
All endpoints in a cluster would use the same application protocol.
Praxis core would expose the selected value through
HttpFilterContext. Core would treat it as an opaque identifier; application-specific filters would interpret supported values.A Responses translation filter could then:
openai_responses.openai_chat_completions.iterative_request_routershould execute the same phase for each internal exchange so agentic-loop inference requests behave like normal proxy requests.The exact API is open for discussion. This could be a dedicated request-body callback or a more general post-upstream-selection hook with mutable access to the buffered body.
Alternatives
Two protocol-specific pipelines work when routing is static, but duplicate the Responses lifecycle and its stateful filters.
Moving all routing before body processing would make upstream metadata available earlier, but would interfere with routing decisions derived from request bodies.
Adding this behavior specifically to an AI routing filter would couple translation to that router and would not work with the standard
routeror other cluster selectors.Example
Does a generic post-routing transformation capability belong in Praxis core? If so, should it be modeled as a dedicated body phase or as a broader post-upstream-selection hook?
Related
All reactions