Skip to content

help request: about ai-multi-proxy, rewrite the endpoint #13213

@jiqq

Description

@jiqq

Description

I have rerank server,the request url is http://172.32.150.72:8008/v1/rerank and http://172.32.150.72:8008/score,I want to use ai-multi-proxy plugin ,because the endpoint must config like http://ip:port/path
how to proxy both http://172.32.150.72:8008/v1/rerank and http://172.32.150.72:8008/score
my route config is

{
    "modifiedIndex": 50332,
    "value": {
        "plugins": {
            "ai-proxy-multi": {
                "instances": [
                    {
                        "provider": "openai-compatible",
                        "auth": {
                            "header": {
                                "Authorization": "Bearer sk-21784d812fbc5d2ca3d3cbe02c9201b06cbad1372c237ecc"
                            }
                        },
                        "options": {
                            "model": "/models/Qwen3-Reranker-0.6B"
                        },
                        "weight": 100,
                        "name": "llm-instance-0",
                        "override": {
                            "endpoint": "http://172.32.150.72:8008"
                        }
                    }
                ],
                "fallback_strategy": [
                    "rate_limiting",
                    "http_429",
                    "http_5xx"
                ]
            },
           
            "limit-conn": {
                "key_type": "var",
                "rejected_code": 503,
                "rejected_msg": "Requests are too frequent, please try again later.",
                "default_conn_delay": 0.1,
                "conn": 11,
                "burst": 0,
                "key": "server_addr"
            },
            "proxy-rewrite": {
                "regexUri": [
                    "^/.*",
                    "$0"
                ],
                "empty": false
            }
        },
        "create_time": 1775733072,
        "timeout": {
            "connect": 3,
            "read": 180,
            "send": 10
        },
        "id": "4850-1",
        "plugin_config_id": "2",
        "update_time": 1776081582,
        "enable_websocket": false,
        "methods": [
            "POST"
        ],
        "uri": "/*",
        "priority": 3
    },
    "key": "/apisix/routes/4850-1",
    "createdIndex": 50314
}

when request(the modelrefank1has been transformed to /models/Qwen3-Reranker-0.6B)

curl http://172.32.153.143:49080/v1/rerank -X POST -H "Content-Type:application/json;charset=UTF-8" \
  -H "Authorization: d2zy6LfRgI" \
  -d '{
  "model": "rerank1",
  "query": "What is the capital of France?",
  "documents": [
    "The capital of Brazil is Brasilia.",
    "The capital of France is Paris.",
    "Horses and cows are both animals"
  ],
  "top_n":2
}'

response {"detail":"Not Found"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    pluginquestionlabel for questions asked by users

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions