MineContext icon indicating copy to clipboard operation
MineContext copied to clipboard

[BUG]: 自定义模型验证失败VLM validation failed Connection error.

Open youqugit opened this issue 1 month ago • 9 comments

🐛 Bug description [Please make everyone to understand it]

我使用了vllm部署的OpenAI风格的大模型,但是url地址没有v1标准格式,在选择一个模型开始时验证失败,具体错误如下

2025-11-11 15:45:33 | INFO | All components initialization completed successfully
2025-11-11 15:45:33 | INFO | Starting all modules
2025-11-11 15:45:33 | INFO | Starting all capture components...
2025-11-11 15:45:33 | INFO | All capture components started successfully
2025-11-11 15:45:33 | INFO | Starting web server on 127.0.0.1:1733
2025-11-11 15:48:33 | INFO | No activity records found in the time range %s to %s.
2025-11-11 15:48:53 | ERROR | Failed to generate smart tip: 'NoneType' object has no attribute 'generate_with_messages'
Traceback (most recent call last):

  File "threading.py", line 1032, in _bootstrap

  File "threading.py", line 1075, in _bootstrap_inner

  File "threading.py", line 1433, in run

  File "opencontext\managers\consumption_manager.py", line 305, in generate_tips

> File "opencontext\context_consumption\generation\smart_tip_generator.py", line 61, in generate_smart_tip

  File "opencontext\context_consumption\generation\smart_tip_generator.py", line 283, in _generate_intelligent_tip_with_patterns

  File "opencontext\llm\global_vlm_client.py", line 295, in generate_with_messages

  File "opencontext\llm\global_vlm_client.py", line 117, in generate_with_messages

AttributeError: 'NoneType' object has no attribute 'generate_with_messages'
2025-11-11 15:49:16 | ERROR | LLM validation failed with API error: Connection error.

但是我在本地可以使用openai包,调用我自己部署的模型

from openai import APIError, AsyncOpenAI, OpenAI

client = OpenAI( base_url="https://ai.yu.cn/ai/llm/online/vision", 
                api_key="f1adhLU5wQiVJj0HHJ-7fkX0vPggvhMlYTE" ) 
response = client.chat.completions.create( model="multimodal-large", messages= [{"role": "user", "content": "你好"}], max_tokens=1024, )
print(response.json)

🧑‍💻 Step to reproduce

下载win exe文件,安装,选择自定义模型,写上url和api_key,验证失败VLM validation failed Connection error.

👾 Expected result

解决这个问题

🚑 Any additional information

No response

🛠️ MineContext Version

0.1.4

💻 Platform Details

win11

youqugit avatar Nov 11 '25 08:11 youqugit

follow

xiaoan17 avatar Nov 11 '25 12:11 xiaoan17

你在 custom 里设置的 url 是什么

qin-ctx avatar Nov 11 '25 12:11 qin-ctx

设置的url和问题描述中Python代码里openai client用的base url一样

youqugit avatar Nov 11 '25 13:11 youqugit

有设置代理吗

qin-ctx avatar Nov 12 '25 03:11 qin-ctx

代理指的什么

youqugit avatar Nov 12 '25 05:11 youqugit

代理指的什么

vpn 之类的,服务的验证代码跟你是一样的,如果配置都没问题应该不会连接失败

qin-ctx avatar Nov 12 '25 07:11 qin-ctx

设置的url和问题描述中Python代码里openai client用的base url一样

可以贴一下这一块,我们排查一下

KashiwaByte101 avatar Nov 12 '25 12:11 KashiwaByte101

问题描述里已经贴出来代码了

youqugit avatar Nov 12 '25 13:11 youqugit