@@ -19,6 +19,7 @@ package framework
19
19
import (
20
20
"context"
21
21
22
+ "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/plugins"
22
23
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/types"
23
24
)
24
25
@@ -30,41 +31,34 @@ const (
30
31
PostCyclePluginType = "PostCycle"
31
32
)
32
33
33
- // Plugin defines the interface for scheduler plugins, combining scoring, filtering,
34
- // and event handling capabilities.
35
- type Plugin interface {
36
- // Name returns the name of the plugin.
37
- Name () string
38
- }
39
-
40
34
// ProfilePicker selects the SchedulingProfiles to run from a list of candidate profiles, while taking into consideration the request properties
41
35
// and the previously executed SchedluderProfile cycles along with their results.
42
36
type ProfilePicker interface {
43
- Plugin
37
+ plugins. Plugin
44
38
Pick (request * types.LLMRequest , profiles map [string ]* SchedulerProfile , executionResults map [string ]* types.Result ) map [string ]* SchedulerProfile
45
39
}
46
40
47
41
// Filter defines the interface for filtering a list of pods based on context.
48
42
type Filter interface {
49
- Plugin
43
+ plugins. Plugin
50
44
Filter (ctx context.Context , request * types.LLMRequest , cycleState * types.CycleState , pods []types.Pod ) []types.Pod
51
45
}
52
46
53
47
// Scorer defines the interface for scoring a list of pods based on context.
54
48
// Scorers must score pods with a value within the range of [0,1] where 1 is the highest score.
55
49
type Scorer interface {
56
- Plugin
50
+ plugins. Plugin
57
51
Score (ctx context.Context , request * types.LLMRequest , cycleState * types.CycleState , pods []types.Pod ) map [types.Pod ]float64
58
52
}
59
53
60
54
// Picker picks the final pod(s) to send the request to.
61
55
type Picker interface {
62
- Plugin
56
+ plugins. Plugin
63
57
Pick (ctx context.Context , cycleState * types.CycleState , scoredPods []* types.ScoredPod ) * types.Result
64
58
}
65
59
66
60
// PostCycle is called by the scheduler after it selects a targetPod for the request in the SchedulerProfile cycle.
67
61
type PostCycle interface {
68
- Plugin
62
+ plugins. Plugin
69
63
PostCycle (ctx context.Context , cycleState * types.CycleState , res * types.Result )
70
64
}
0 commit comments