-
Couldn't load subscription status.
- Fork 1.1k
Description
I've been attempting to integrate Alibaba Cloud's Qwen series models (specifically dashscope/qwen-vl-max and dashscope/qvq-max) into Bytebot using the recommended LiteLLM proxy setup (local Docker Compose). While basic connectivity was established after significant debugging (related to agent authentication and build caching), severe compatibility issues remain with these specific models, preventing their effective use.
1. Qwen-VL Models (e.g., qwen-vl-max) - Non-Standard Tool Calling:
- Problem: When
bytebot-agentsends a request withtoolsdefined andtool_choice: "auto",qwen-vl-max(via LiteLLM) does not populate the standardtool_callsfield in the response. Instead, it returnstool_calls: nulland embeds the intended tool calls as JSON code blocks (e.g.,```json { "name": "...", "input": {...} } ```) directly within themessage.contentfield, often mixed with natural language "thinking" text. - Impact:
bytebot-agent's current response parser (formatChatCompletionResponseinproxy.service.ts) only checks themessage.tool_callsfield. Since it's null, the agent fails to recognize or execute the tool calls, treating the entirecontent(including the JSON blocks) as plain text output to the user. - Debugging Done:
- Confirmed via direct
curl/Pythonrequeststolitellm-proxythat the issue persists even whenbytebot-agentis bypassed, proving it's an incompatibility between Qwen-VL's output format and the standard expected by the agent. - Ensured
reasoning_effortparameter was removed frombytebot-agentsource code (proxy.service.ts) via--no-cachebuilds, ruling it out as the cause. - Configured
tool_choice: "auto"via LiteLLM UI ("Default Parameters") for the model, which did not resolve the issue.
- Confirmed via direct
2. QVQ/QVQ-max Models - HTTPS Connection Error:
- Problem: Attempts to use
dashscope/qvq-maxconsistently fail with the errorlitellm.BadRequestError: DashscopeException - current user api does not support http call. - Debugging Done:
- Verified multiple times that the
api_baseconfigured in the LiteLLM UI for this model is correctly set to HTTPS:https://dashscope.aliyuncs.com/compatible-mode/v1. - This error occurs even when the Docker Desktop global proxy and any system-level proxies (like Clash) are completely disabled, ruling out proxy HTTPS-stripping.
- Other Dashscope models (like
qwen-vl-max) connect successfully over HTTPS using the same LiteLLM proxy setup.
- Verified multiple times that the
- Conclusion: This suggests a specific issue either with the Dashscope endpoint for
qvq-maxwhen accessed via the OpenAI compatibility layer, or with how the LiteLLM adapter handles HTTPS requests only for this specific model variant.
Environment:
- Bytebot: Built locally from source (recent
edgeequivalent). - LiteLLM: Running via Docker using
ghcr.io/berriai/litellm:main-stableimage. - Models Tested:
dashscope/qwen-vl-max,dashscope/qvq-max. - Setup: Local Docker Compose on Windows, using the project's provided
postgrescontainer for bothbytebot-agentandlitellm-proxydatabases (bytebotdbandlitellm_logs_dbrespectively). LiteLLM configured withmaster_keyandencryption_key.
Workarounds Attempted:
- Qwen-VL: Manually modified
bytebot-agent'sformatChatCompletionResponsefunction inproxy.service.tsto parse```json ... ```blocks frommessage.contentwhenmessage.tool_callsis null. (Code based on our discussion can be provided if needed). This works but requires modifying agent source. - QVQ-max: No workaround found. Model remains unusable due to the persistent HTTPS error.
Suggestions:
- Enhance
bytebot-agentParser: UpdateformatChatCompletionResponseto include fallback logic that parses JSON code blocks frommessage.contentifmessage.tool_callsis null/empty. This would provide out-of-the-box compatibility with models like Qwen-VL. - Investigate QVQ HTTPS Issue: This seems like a deeper issue, potentially within LiteLLM's Dashscope adapter or the Dashscope endpoint itself. Collaboration with the LiteLLM team might be needed.
- Document Compatibility: Update Bytebot documentation regarding known compatibility issues with specific Qwen models and potential workarounds (like the agent code modification).
- Agent Authentication: Address the underlying issue where
bytebot-agentignores standard proxy keys and requires hardcoding or theOPENAI_API_KEYworkaround.
Thanks for looking into this. Qwen models are important in certain regions, and improving compatibility would be very beneficial.