Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Higress ai console #366

Merged
merged 21 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions frontend/src/interfaces/service-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ export const ServiceProtocols = {
grpc: { key: 'grpc', name: 'gRPC', tlsEnabled: false },
grpcs: { key: 'grpcs', name: 'gRPCS', tlsEnabled: true },
};

interface ListEntry {
provider: string;
width: number;
}

export interface CustomComponentHandles {
addItem: (any) => void;
getList: () => ListEntry[];
}
125 changes: 124 additions & 1 deletion frontend/src/locales/en-US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,52 @@
"passwordPlaceholder": "Password",
"passwordRequired": "Please input password"
},
"aiRoute": {
"columns": {
"name": "name",
"domains": "domains",
"upstreams": "upstreams",
"auth": "request auth",
"action": "action"
},
"create": "Create an AI route",
"edit": "Edit AI route",
"deleteConfirmation": "Are you sure you want to delete < 1 > {{currentConsumerName}} </1 >?",
"authNotEnabled": "Authentication not enabled",
"authEnabledWithoutConsumer": "No one is authorized to access"
},
"consumer": {
"columns": {
"name": "consumer name",
"credentialTypes": "authentication method",
"action": "action"
},
"create": "create",
"edit": "edit",
"deleteConfirmation": "Are you sure you want to delete < 1 > {{currentConsumerName}} </1 >?",
"consumerForm": {
"name": "name",
"namePlaceholder": "Please enter a consumer name",
"nameRequired": "Please enter a consumer name",
"pleaseEnter":"please enter",
"pleaseSelect":"please select"
},
"selectBEARER": "Authorization: Bearer ${value}",
"selectHEADER": "Custom HTTP Header",
"selectQUERY": "query parameters",
"tokenSource":"Token source",
"authenticationToken":"Auth token",
"underDevelopment":"Under development, stay tuned.",
"randomGeneration":"random generation",
"headerName":"Header name",
"paramsName":"parameter name",
"deleteSuccess": "delete success",
"deleteFailed": "delete failed",
"creaetSuccess": "creaet success",
"creatFailed": "creat failed",
"editSuccess": "edit successfully",
"editFailed": "edit failed"
},
"domain": {
"columns": {
"name": "Domain",
Expand Down Expand Up @@ -101,6 +147,83 @@
"item4": "Input the HTTPS URL of Grafana is highly recommended to ensure the dashboard can be shown with in this page correctly."
}
},
"llmProvider": {
"columns": {
"type": "Type",
"name": "Name",
"tokens": "authentication token",
"action": "action"
},
"providerTypes": {
"openai": "OpenAI",
"qwen": "Tongyi Qianwen",
"moonshot": "Dark Side of the Moon"
},
"providerForm": {
"label": {
"type": "LLM vendor",
"name": "Name",
"serviceName": "Service Name",
"domain": "Domain name",
"agreement": "Agreement",
"modelPredicate": "Whether to enable model-based route matching rules",
"extra": "When enabled, if the request to the target service fails, the gateway will instead request a downgraded service.",
"modelPredicatePrefix": "model name matching rule",
"aiName": "Target AI Service",
"aiNameExtra": "Create AI services",
"fallbackConfig": "Downgrade service",
"fallbackConfigExtra": "When enabled, if the request to the target service fails, the gateway will instead request a downgraded service.",
"fallbackConfigList": "Downgrade service list",
"routeStrategy": "Routing downgrade strategy",
"routeStrategy1": "Randomly select a service provider in the list to downgrade, only downgrade once (default) ",
"routeStrategy2": "Attempt downgrades one by one in the order of the list of service providers until the request succeeds or all providers have tried",
"authConfig": "Whether to enable request authentication",
"authConfigExtra": "When enabled, only requests containing the specified consumer authentication information can request this route.",
"authConfigList": "List of consumer names allowed to request this route",
"weight": "weight"
},
"placeholder": {
"type": "Please select LLM vendor",
"name": "Please enter a name",
"serviceName": "Please enter a service name",
"tokens": "Please enter authentication token",
"domain": "Please enter domain name",
"aiName": "Please select and add target AI service",
"weight": "The target AI service request ratio should add up to 100.",
"modelPredicatePrefix": "Use Glob syntax to match models, for example: model- *",
"fallbackConfigList": "Please select a list of downgrade services",
"routeStrategy": "Please select a route degradation strategy",
"authConfigList": "Please select a list of consumer names that are allowed to request this route."
},
"rules": {
"modelPredicatePrefix": "Please enter the model name prefix required to match this route",
"Name": "Supports uppercase and lowercase letters, numbers, and dashes, and starts with a letter or number and does not end with a dash (-). Length should not exceed 63 characters."
},
"creatDomain": "Create a domain name",
"howtouse": "How to use",
"AirouterUse": "How to use AI routing"
},
"create": "Provide AI service providers",
"edit": "Edit AI service provider",
"deleteConfirmation": "Are you sure you want to delete < 1 > {{currentLlmProviderName}} </1 >?",
"deleteRoute": "Are you sure you want to delete < 1 > {{currentRouteName}} </1 >?",
"selectModelName": "Select Model Service",
"modelProportion": "Proportionally",
"modelName": "By model name",
"addTargetAIservice": "Add target AI service",
"addTargetServer": "Add",
"operation": "Operation",
"modelMatchingType": "Model matching type",
"pleaseSelect": "Please select",
"pleaseEnter": "Please enter",
"exactMatch": "exact match",
"prefixMatch": "Prefix Match",
"modelNames": "Model names",
"serviceName": "service name",
"requestPercentage": "Request Percentage",
"targetModel": "TargetModel",
"modelNameTips": "Model parameters in the request body"
},
"plugins": {
"title": "Strategy Configuration",
"subTitle": {
Expand Down Expand Up @@ -243,7 +366,7 @@
"namePlaceholder": "Please input a valid name.",
"domain": "Registry Domain",
"domainTooltip": "It can be either an IP address or a domain name.",
"domainRequired": "Please input the registry address.",
"domainRequired": "Please select a domain name",
"domainPlaceholder": "Only following inputs are allowed: upper-and lower-case letters, numbers, dash (-) and asterisk (*). No longer than 256 characters.",
"port": "Registry Port",
"portRequired": "Please input the port.",
Expand Down
92 changes: 88 additions & 4 deletions frontend/src/locales/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,29 @@
},
"create": "创建消费者",
"edit": "编辑消费者",
"deleteConfirmation": "确定删除 <1>{{currentConsumerName}}</1> 吗?"
"deleteConfirmation": "确定删除 <1>{{currentConsumerName}}</1> 吗?",
"consumerForm": {
"name": "消费者名称",
"namePlaceholder": "请输入消费者名称",
"nameRequired": "请输入消费者名称",
"pleaseEnter":"请输入",
"pleaseSelect":"请输入"
},
"selectBEARER": "Authorization: Bearer ${value}",
"selectHEADER": "自定义 HTTP Header",
"selectQUERY": "查询参数",
"tokenSource":"令牌来源",
"authenticationToken":"认证令牌",
"underDevelopment":"开发中,敬请期待",
"randomGeneration":"随机生成",
"headerName":"Header 名称",
"paramsName":"参数名称",
"deleteSuccess": "删除成功",
"deleteFailed": "删除失败",
"creaetSuccess": "创建成功",
"creatFailed": "创建失败",
"editSuccess": "编辑成功",
"editFailed": "编辑失败"
},
"domain": {
"columns": {
Expand Down Expand Up @@ -133,17 +155,79 @@
"columns": {
"type": "类型",
"name": "名称",
"tokens": "认证令牌",
"tokens": "凭证",
"action": "操作"
},
"providerTypes": {
"openai": "OpenAI",
"qwen": "通义千问",
"moonshot": "月之暗面"
},
"providerForm": {
"label": {
"type": "大模型供应商",
"name": "名称",
"serviceName": "服务名称",
"agreement": "协议",
"domain": "域名",
"modelPredicate": "是否启用基于模型的路由匹配规则",
"extra": "启用后,若请求目标服务失败,网关会改为请求降级服务。",
"modelPredicatePrefix": "模型名称匹配规则",
"aiName": "目标AI服务",
"aiNameExtra": "创建AI服务",
"fallbackConfig": "降级服务",
"fallbackConfigExtra": "启用后,若请求目标服务失败,网关会改为请求降级服务。",
"fallbackConfigList": "降级服务列表",
"routeStrategy": "路由降级策略",
"routeStrategy1": "随机选择列表中的一个服务提供商进行降级,只降级一次(默认)",
"routeStrategy2": "按服务提供商列表顺序逐个尝试降级,直至请求成功或所有提供商均尝试过为止",
"authConfig": "是否启用请求认证",
"authConfigExtra": "启用后,只有包含指定消费者认证信息的请求可以请求本路由。",
"authConfigList": "允许请求本路由的消费者名称列表",
"weight": "请求比例"
},
"placeholder": {
"type": "请选择大模型供应商",
"name": "请输入名称",
"agreement": "请选择协议",
"serviceName": "请输入服务名称",
"tokens": "请输入凭证",
"domain": "请输入域名",
"aiName": "请选择并添加目标AI服务",
"weight": "目标AI服务请求比例相加应等于 100",
"modelPredicatePrefix": "使用 Glob 语法匹配模型,例如:model-*",
"fallbackConfigList": "请选择降级服务列表",
"routeStrategy": "请选择路由降级策略",
"authConfigList": "请选择允许请求本路由的消费者名称列表"
},
"rules": {
"modelPredicatePrefix": "请输入匹配本路由所需的模型名称前缀",
"name": "支持大小写字母、数字和短划线,并以字母或数字开头,且不以短划线(-)结尾。长度不超过63个字符。"
},
"creatDomain": "创建域名",
"howtouse": "使用方法",
"AirouterUse": "AI路由使用方法"
},
"create": "提供AI服务提供者",
"edit": "编辑AI服务提供者",
"deleteConfirmation": "确定删除 <1>{{currentConsumerName}}</1> 吗?"
"deleteConfirmation": "确定删除 <1>{{currentLlmProviderName}}</1> 吗?",
"deleteRoute": "确定删除 <1>{{currentRouteName}}</1> 吗?",
"selectModelName": "选择模型服务",
"modelProportion": "按比例",
"modelName": "按模型名称",
"addTargetAIservice": "添加目标AI服务",
"addTargetServer": "添加",
"operation": "操作",
"modelMatchingType":"模型匹配方式",
"pleaseSelect":"请选择",
"pleaseEnter":"请输入",
"exactMatch":"精确匹配",
"prefixMatch":"前缀匹配",
"modelNames":"模型名称",
"serviceName":"服务名称",
"requestPercentage":"请求比例",
"targetModel":"目标模型",
"modelNameTips":"请求 body 中的 model 参数"
},
"plugins": {
"title": "策略配置",
Expand Down Expand Up @@ -287,7 +371,7 @@
"namePlaceholder": "支持大小写字母、数字和短划线,并以字母或数字开头,且不以短划线结尾。长度不超过63个字符。",
"domain": "注册中心地址",
"domainTooltip": "注册中心地址,可以是IP或域名",
"domainRequired": "请输入注册中心地址",
"domainRequired": "请选择域名",
"domainPlaceholder": "支持大小写字母、数字、短划线(-)和星号(*),不超过256个字符。",
"port": "注册中心访问端口",
"portRequired": "请输入访问端口",
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/pages/_defaultProps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export default {
name: 'menu.aiRouteManagement',
path: '/ai/route',
},
{
path: '/ai/config',
},
],
},
{
Expand Down
Loading
Loading