- AI Gateway sends the user prompt and response to the configured LLM as a judge.
- The LLM evaluates the response and returns a numeric score between
1 (wrong or irrelevant) and 100 (ideal).
- This score can be used in downstream workflows, such as automated grading, feedback systems, or learning pipelines.
The following sequence diagram illustrates this simplified flow:
sequenceDiagram
actor Client
participant AIGW as AI Gateway
participant LLM as LLM Model (A or B)
participant Judge as AI LLM as Judge
participant JudgeLLM as Judge LLM
Client->>AIGW: Send prompt
AIGW->>LLM: Forward prompt (balancer selects model)
LLM-->>AIGW: Response
AIGW ->>Judge: Prompt + response
Judge->>JudgeLLM: Evaluate response
JudgeLLM-->>Judge: Score (1–100)
Judge-->>AIGW: Evaluation result
AIGW-->>Client: Response