diff --git a/README.md b/README.md index 8f67481..ccd7f1d 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,8 @@ Volcengine supports both model names and endpoint IDs. Using model names is reco "vlm": { "provider": "volcengine", "model": "doubao-seed-1-6-240615", - "api_key": "your-api-key" + "api_key": "your-api-key", + "api_base" : "https://ark.cn-beijing.volces.com/api/v3", } } ``` @@ -133,7 +134,8 @@ You can also use endpoint IDs (found in [Volcengine ARK Console](https://console "vlm": { "provider": "volcengine", "model": "ep-20241220174930-xxxxx", - "api_key": "your-api-key" + "api_key": "your-api-key", + "api_base" : "https://ark.cn-beijing.volces.com/api/v3", } } ``` diff --git a/openviking/models/vlm/backends/litellm_vlm.py b/openviking/models/vlm/backends/litellm_vlm.py index f1efa56..0c9a7ab 100644 --- a/openviking/models/vlm/backends/litellm_vlm.py +++ b/openviking/models/vlm/backends/litellm_vlm.py @@ -72,6 +72,13 @@ def _resolve_model(self, model: str) -> str: model = f"{prefix}/{model}" return model + if self._provider_name == "openai" and self.api_base: + from openviking.models.vlm.registry import find_by_name + openai_spec = find_by_name("openai") + is_openai_official = "api.openai.com" in self.api_base + if openai_spec and not is_openai_official and not model.startswith("openai/"): + return f"openai/{model}" + spec = find_by_model(model) if spec and spec.litellm_prefix: if not any(model.startswith(s) for s in spec.skip_prefixes):