Skip to content

Support modifying model names based on model mapping when forwarding to target services #1901

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

Open
johnlanni opened this issue Mar 15, 2025 · 4 comments
Labels

Comments

@johnlanni
Copy link
Collaborator

johnlanni commented Mar 15, 2025

Now, when overriding the original model name by setting a target model name, only one fixed model can be configured; mapping configurations are not supported.
Image

But the actual underlying mechanism is supported. A rule that is essentially a global mapping has been configured, and the following is the actual effective configuration:

Image

It can support configuring more mapping strategies, for example:

apiVersion: extensions.higress.io/v1alpha1
kind: WasmPlugin
metadata:
  name: model-mapper.internal
  namespace: higress-system
spec:
  defaultConfigDisable: true
  failStrategy: FAIL_OPEN
  matchRules:
  - config:
      modelMapping:
        'gpt-4-*': "qwen-max"
        'gpt-4o': "qwen-vl-plus"
        '*': "qwen-turbo"
    configDisable: false
    # This configuration takes effect when the following ingress and service match simultaneously.
    ingress:
    - ai-route-dashscope.internal
    service:
    - llm-dashscope.internal.dns
  phase: AUTHN
  priority: 800
  url: oci://higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/model-mapper:1.0.0

For an introduction to the configuration of the model-mapper plugin, you can refer to this:

https://github.com/alibaba/higress/blob/main/plugins/wasm-cpp/extensions/model_mapper/README_EN.md

@CH3CHO
Copy link
Collaborator

CH3CHO commented Mar 16, 2025

Should this model mapping config be set in a provider level or route level?

@johnlanni
Copy link
Collaborator Author

Should this model mapping config be set in a provider level or route level?

provider&route level, like this match config:

ingress:
- ai-route-dashscope.internal
service:
- llm-dashscope.internal.dns

@CH3CHO
Copy link
Collaborator

CH3CHO commented Mar 16, 2025

Should this model mapping config be set in a provider level or route level?

provider&route level, like this match config:

ingress:
- ai-route-dashscope.internal
service:
- llm-dashscope.internal.dns

So we need to figure out a UI design of this kind of model mapping configuration with multiple entries.

@johnlanni
Copy link
Collaborator Author

Yes, can we change the current target model input box to a "Model Mapping" button? After clicking, the key-value pairs can be configured in a pop-up window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

2 participants