The AI Request Transformer Policy uses a configured LLM service to transform a client request body before proxying the request upstream.
This Policy supports llm/v1/chat requests and can be tuned by setting the parameters in the config.llm block.
The AI Request Transformer Policy runs before all of the AI prompt Policies, allowing it to also transform requests before sending them to a different LLM.
Known failure mode: Chaining AI Request Transformer with the AI Gateway
Chaining AI Request Transformer with other AI Gateway operations may fail for some upstream providers, even though the same setup works correctly with other providers.
The reason is that the AI Request Transformer Policy forwards raw model output, and if the LLM service model does not produce strict JSON, the proxy chain cannot function correctly. This is not a bug in AI Gateway but a limitation of LLM behavior.