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
|`modelKey`| string | Optional | model | Location of the model parameter in the request body|
9
+
|`addProviderHeader`| string | Optional | - | Which request header to add the provider name parsed from the model parameter |
10
+
|`modelToHeader`| string | Optional | - | Which request header to directly add the model parameter to|
11
+
|`enableOnPathSuffix`| array of string | Optional |["/v1/chat/completions"]| Only effective for requests with these specific path suffixes, can be configured as "*" to match all paths|
12
12
13
-
## Runtime Attributes
13
+
## Runtime Properties
14
14
15
15
Plugin execution phase: Authentication phase
16
16
Plugin execution priority: 900
17
17
18
18
## Effect Description
19
19
20
-
### Routing Based on the model Parameter
20
+
### Routing Based on Model Parameter
21
21
22
-
The following configuration is required:
22
+
The following configuration is needed:
23
23
24
24
```yaml
25
25
modelToHeader: x-higress-llm-model
26
26
```
27
27
28
-
The plugin will extract the model parameter from the request and set it in the x-higress-llm-model request header, which can be used for subsequent routing. For example, the original LLM request body:
28
+
The plugin extracts the model parameter from the request and sets it to the x-higress-llm-model request headerfor subsequent routing. For example, the original LLM request body is:
29
29
30
30
```json
31
31
{
@@ -35,29 +35,29 @@ The plugin will extract the model parameter from the request and set it in the x
35
35
"stream": false,
36
36
"messages": [{
37
37
"role": "user",
38
-
"content": "What is the GitHub address of the main repository for the higress project"
38
+
"content": "What is the GitHub address of the Higress project's main repository?"
39
39
}],
40
40
"presence_penalty": 0,
41
41
"temperature": 0.7,
42
42
"top_p": 0.95
43
43
}
44
44
```
45
45
46
-
After processing by this plugin, the following request header (which can be used for route matching) will be added:
46
+
After processing by this plugin, the following request header will be added (can be used for route matching):
47
47
48
48
x-higress-llm-model: qwen-long
49
49
50
-
### Extracting the provider Field from the model Parameter for Routing
50
+
### Extracting Provider Field from Model Parameter for Routing
51
51
52
-
> Note that this mode requires the client to specify the provider using a `/` separator in the model parameter.
52
+
> Note that this mode requires the client to specify the provider in the model parameter using the `/` delimiter
53
53
54
-
The following configuration is required:
54
+
The following configuration is needed:
55
55
56
56
```yaml
57
57
addProviderHeader: x-higress-llm-provider
58
58
```
59
59
60
-
The plugin will extract the provider part (if present) from the model parameter in the request and set it in the x-higress-llm-provider request header, which can be used for subsequent routing, and rewrite the model parameter to the model name part. For example, the original LLM request body:
60
+
The plugin extracts the provider part (if any) from the model parameter in the request, sets it to the x-higress-llm-provider request headerfor subsequent routing, and rewrites the model parameter to only contain the model name part. For example, the original LLM request body is:
61
61
62
62
```json
63
63
{
@@ -67,15 +67,15 @@ The plugin will extract the provider part (if present) from the model parameter
67
67
"stream": false,
68
68
"messages": [{
69
69
"role": "user",
70
-
"content": "What is the GitHub address of the main repository for the higress project"
70
+
"content": "What is the GitHub address of the Higress project's main repository?"
71
71
}],
72
72
"presence_penalty": 0,
73
73
"temperature": 0.7,
74
74
"top_p": 0.95
75
75
}
76
76
```
77
77
78
-
After processing by this plugin, the following request header (which can be used for route matching) will be added:
78
+
After processing by this plugin, the following request header will be added (can be used for route matching):
79
79
80
80
x-higress-llm-provider: dashscope
81
81
@@ -89,7 +89,7 @@ The original LLM request body will be changed to:
89
89
"stream": false,
90
90
"messages": [{
91
91
"role": "user",
92
-
"content": "What is the GitHub address of the main repository for the higress project"
92
+
"content": "What is the GitHub address of the Higress project's main repository?"
0 commit comments