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
{{ message }}
Repository navigation
[Bugfix] Skip host_ip/host_port validation when a custom url is given - #614
model config validate failed. VLLMCustomAPIChat build failed with the following errors:
{'host_ip': 'host_ip must be a valid IPv4 or IPv6 address',
'host_port': 'host_port must be a valid port number in the range (0, 65536)'}
Hi @Libotry@SJTUyh, could you please take a look when you have time?
This PR fixes #609: when a custom url is provided, BaseAPIModel._get_base_url() already
ignores host_ip/host_port, but _validate_model_cfg() still rejected empty values and
made the config fail to build. The change only skips those two validators when url is
non-empty, plus one UT covering three combinations (with url / without url / whitespace-only url).
Hi @Libotry@SJTUyh, could you take a look when you have time?
This fixes #609. When a custom url is given, BaseAPIModel._get_base_url() already ignores host_ip/host_port, but _validate_model_cfg() still rejected empty values, so the config
failed to build. The change only skips those two validators when url is non-empty, plus a UT
covering with-url / without-url / whitespace-only-url.
Note: as an external contributor I can't request reviewers from the UI — could a maintainer
pick this up? The no_review gate should clear once a review (Approve / Request changes /
Comment) is submitted. Thanks!
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type / PR类型
Related Issue | 关联 Issue
Fixes #609
🔍 Motivation / 变更动机
配置里显式给出
url时,BaseAPIModel._get_base_url()会直接使用该 URL,并明确在日志中说明host_ip/host_port将被忽略:但
_validate_model_cfg()在此之前仍会校验这两个字段,导致用户按常规写法配置url="..."+host_ip=""+host_port=""时直接构建失败:用户必须随便填一个
host_ip="9.9.9.9"、host_port=12345才能跑通(见 issue #609)。📝 Modification / 修改内容
ais_bench/benchmark/utils/config/build.py::_validate_model_cfg()has_custom_url = isinstance(url, str) and bool(url.strip());url时跳过host_ip/host_port校验(二者运行时本就被忽略);url或url为纯空白时仍按原规则校验。不改动模型类,不改变
_get_base_url()的优先级语义。📐 Associated Test Results / 关联测试结果
新增
tests/UT/utils/config/test_build.py::test_build_model_from_cfg_with_url_skips_host_validation,覆盖:url非空 + 空host_ip/host_port→ 构建成功(修复前抛AISBenchConfigError);url+ 空 host 字段 → 仍报错;url=" "→ 仍报错(与_get_base_url()的 strip 行为一致)。无。仅放宽"已提供 url 时的无效 host 字段"这一条校验。
无。