@@ -71,23 +71,23 @@ func (s *Server) HandleRequestBody(reqCtx *RequestContext, req *extProcPb.Proces
71
71
klog .V (logutil .VERBOSE ).Infof ("Updated body: %v" , string (requestBody ))
72
72
}
73
73
74
- targetEndpoint , err := s .scheduler .Schedule (llmReq )
74
+ targetPod , err := s .scheduler .Schedule (llmReq )
75
75
if err != nil {
76
76
return nil , fmt .Errorf ("failed to find target pod: %w" , err )
77
77
}
78
- klog .V (logutil .VERBOSE ).Infof ("Selected target model %v in target pod: %v\n " , llmReq .ResolvedTargetModel , targetEndpoint )
78
+ klog .V (logutil .VERBOSE ).Infof ("Selected target model %v in target pod: %v\n " , llmReq .ResolvedTargetModel , targetPod )
79
79
80
80
reqCtx .Model = llmReq .Model
81
81
reqCtx .ResolvedTargetModel = llmReq .ResolvedTargetModel
82
82
reqCtx .RequestSize = len (v .RequestBody .Body )
83
- reqCtx .TargetPod = targetEndpoint
83
+ reqCtx .TargetPod = targetPod
84
84
85
- // Insert " target-pod" to instruct Envoy to route requests to the specified target pod.
85
+ // Insert target endpoint to instruct Envoy to route requests to the specified target pod.
86
86
headers := []* configPb.HeaderValueOption {
87
87
{
88
88
Header : & configPb.HeaderValue {
89
89
Key : s .targetEndpointKey ,
90
- RawValue : []byte (targetEndpoint .Address ),
90
+ RawValue : []byte (targetPod .Address ),
91
91
},
92
92
},
93
93
// We need to update the content length header if the body is mutated, see Envoy doc:
@@ -105,6 +105,9 @@ func (s *Server) HandleRequestBody(reqCtx *RequestContext, req *extProcPb.Proces
105
105
}
106
106
107
107
resp := & extProcPb.ProcessingResponse {
108
+ // The Endpoint Picker supports two approaches to communicating the target endpoint, as a request header
109
+ // and as an unstructure ext-proc response metadata key/value pair. This enables different integration
110
+ // options for gateway providers.
108
111
Response : & extProcPb.ProcessingResponse_RequestBody {
109
112
RequestBody : & extProcPb.BodyResponse {
110
113
Response : & extProcPb.CommonResponse {
@@ -123,7 +126,7 @@ func (s *Server) HandleRequestBody(reqCtx *RequestContext, req *extProcPb.Proces
123
126
Fields : map [string ]* structpb.Value {
124
127
s .targetEndpointKey : {
125
128
Kind : & structpb.Value_StringValue {
126
- StringValue : targetEndpoint .Address ,
129
+ StringValue : targetPod .Address ,
127
130
},
128
131
},
129
132
},
0 commit comments