mirror of
https://github.com/alibaba/higress.git
synced 2026-05-27 06:07:27 +08:00
e2e: Enhance the e2e testing of the ai-proxy plugin based on the LLM mock server (#1713)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2022 Alibaba Group Holding Ltd.
|
||||
# Copyright (c) 2025 Alibaba Group Holding Ltd.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -14,42 +14,116 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
name: wasmplugin-ai-proxy-openai
|
||||
namespace: higress-conformance-infra
|
||||
name: wasmplugin-ai-proxy-baidu
|
||||
namespace: higress-conformance-ai-backend
|
||||
spec:
|
||||
ingressClassName: higress
|
||||
rules:
|
||||
- host: "openai.ai.com"
|
||||
- host: "qianfan.baidubce.com"
|
||||
http:
|
||||
paths:
|
||||
- pathType: Prefix
|
||||
path: "/"
|
||||
backend:
|
||||
service:
|
||||
name: infra-backend-v1
|
||||
name: llm-mock-service
|
||||
port:
|
||||
number: 8080
|
||||
number: 3000
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
name: wasmplugin-ai-proxy-qwen
|
||||
namespace: higress-conformance-infra
|
||||
name: wasmplugin-ai-proxy-doubao
|
||||
namespace: higress-conformance-ai-backend
|
||||
spec:
|
||||
ingressClassName: higress
|
||||
rules:
|
||||
- host: "qwen.ai.com"
|
||||
- host: "ark.cn-beijing.volces.com"
|
||||
http:
|
||||
paths:
|
||||
- pathType: Prefix
|
||||
path: "/"
|
||||
backend:
|
||||
service:
|
||||
name: infra-backend-v1
|
||||
name: llm-mock-service
|
||||
port:
|
||||
number: 8080
|
||||
number: 3000
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: wasmplugin-ai-proxy-minimax-v2-api
|
||||
namespace: higress-conformance-ai-backend
|
||||
spec:
|
||||
ingressClassName: higress
|
||||
rules:
|
||||
- host: "api.minimax.chat-v2-api"
|
||||
http:
|
||||
paths:
|
||||
- pathType: Prefix
|
||||
path: "/"
|
||||
backend:
|
||||
service:
|
||||
name: llm-mock-service
|
||||
port:
|
||||
number: 3000
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: wasmplugin-ai-proxy-minimax-pro-api
|
||||
namespace: higress-conformance-ai-backend
|
||||
spec:
|
||||
ingressClassName: higress
|
||||
rules:
|
||||
- host: "api.minimax.chat-pro-api"
|
||||
http:
|
||||
paths:
|
||||
- pathType: Prefix
|
||||
path: "/"
|
||||
backend:
|
||||
service:
|
||||
name: llm-mock-service
|
||||
port:
|
||||
number: 3000
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: wasmplugin-ai-proxy-qwen-compatible-mode
|
||||
namespace: higress-conformance-ai-backend
|
||||
spec:
|
||||
ingressClassName: higress
|
||||
rules:
|
||||
- host: "dashscope.aliyuncs.com-compatible-mode"
|
||||
http:
|
||||
paths:
|
||||
- pathType: Prefix
|
||||
path: "/"
|
||||
backend:
|
||||
service:
|
||||
name: llm-mock-service
|
||||
port:
|
||||
number: 3000
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: wasmplugin-ai-proxy-qwen
|
||||
namespace: higress-conformance-ai-backend
|
||||
spec:
|
||||
ingressClassName: higress
|
||||
rules:
|
||||
- host: "dashscope.aliyuncs.com"
|
||||
http:
|
||||
paths:
|
||||
- pathType: Prefix
|
||||
path: "/"
|
||||
backend:
|
||||
service:
|
||||
name: llm-mock-service
|
||||
port:
|
||||
number: 3000
|
||||
---
|
||||
apiVersion: extensions.higress.io/v1alpha1
|
||||
kind: WasmPlugin
|
||||
@@ -57,31 +131,76 @@ metadata:
|
||||
name: ai-proxy
|
||||
namespace: higress-system
|
||||
spec:
|
||||
priority: 200
|
||||
defaultConfigDisable: true
|
||||
phase: UNSPECIFIED_PHASE
|
||||
priority: 100
|
||||
matchRules:
|
||||
- config:
|
||||
provider:
|
||||
type: "openai"
|
||||
customSettings:
|
||||
- name: "max_tokens"
|
||||
value: 123
|
||||
overwrite: false
|
||||
- name: "temperature"
|
||||
value: 0.66
|
||||
overwrite: true
|
||||
apiTokens:
|
||||
- fake_token
|
||||
modelMapping:
|
||||
'gpt-3': ernie-3.5-8k
|
||||
'*': ernie-3.5-8k
|
||||
type: baidu
|
||||
ingress:
|
||||
- higress-conformance-infra/wasmplugin-ai-proxy-openai
|
||||
- higress-conformance-ai-backend/wasmplugin-ai-proxy-baidu
|
||||
- config:
|
||||
provider:
|
||||
type: "qwen"
|
||||
apiTokens: "fake-token"
|
||||
customSettings:
|
||||
- name: "max_tokens"
|
||||
value: 123
|
||||
overwrite: false
|
||||
- name: "temperature"
|
||||
value: 0.66
|
||||
overwrite: true
|
||||
apiTokens:
|
||||
- fake_token
|
||||
modelMapping:
|
||||
'*': fake_doubao_endpoint
|
||||
type: doubao
|
||||
ingress:
|
||||
- higress-conformance-infra/wasmplugin-ai-proxy-qwen
|
||||
url: oci://higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/ai-proxy:1.0.0
|
||||
- higress-conformance-ai-backend/wasmplugin-ai-proxy-doubao
|
||||
- config:
|
||||
provider:
|
||||
apiTokens:
|
||||
- fake_token
|
||||
modelMapping:
|
||||
'gpt-3': abab6.5s-chat
|
||||
'gpt-4': abab6.5g-chat
|
||||
'*': abab6.5t-chat
|
||||
type: minimax
|
||||
ingress:
|
||||
- higress-conformance-ai-backend/wasmplugin-ai-proxy-minimax-v2-api
|
||||
- config:
|
||||
provider:
|
||||
apiTokens:
|
||||
- fake_token
|
||||
modelMapping:
|
||||
'gpt-3': abab6.5s-chat
|
||||
'gpt-4': abab6.5g-chat
|
||||
'*': abab6.5t-chat
|
||||
type: minimax
|
||||
minimaxApiType: pro
|
||||
minimaxGroupId: 1
|
||||
ingress:
|
||||
- higress-conformance-ai-backend/wasmplugin-ai-proxy-minimax-pro-api
|
||||
- config:
|
||||
provider:
|
||||
apiTokens:
|
||||
- fake_token
|
||||
modelMapping:
|
||||
'gpt-3': qwen-turbo
|
||||
'gpt-35-turbo': qwen-plus
|
||||
'gpt-4-*': qwen-max
|
||||
'*': qwen-turbo
|
||||
type: qwen
|
||||
qwenEnableCompatible: true
|
||||
ingress:
|
||||
- higress-conformance-ai-backend/wasmplugin-ai-proxy-qwen-compatible-mode
|
||||
- config:
|
||||
provider:
|
||||
apiTokens:
|
||||
- fake_token
|
||||
modelMapping:
|
||||
'gpt-3': qwen-turbo
|
||||
'gpt-35-turbo': qwen-plus
|
||||
'gpt-4-*': qwen-max
|
||||
'*': qwen-turbo
|
||||
type: qwen
|
||||
ingress:
|
||||
- higress-conformance-ai-backend/wasmplugin-ai-proxy-qwen
|
||||
url: oci://higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/ai-proxy:1.0.0
|
||||
Reference in New Issue
Block a user