Protokoll #7808

ID7808
Zeitstempel2025-12-23 08:40:30.906229
Clientroot
IP145.224.96.190
Modellclaude-sonnet-4-20250514
Statuscompleted
Tokens1,188 (Input: 720, Output: 468)
Dauer125515 ms
Request-Zeit2025-12-23 08:40:30.906229
Response-Zeit2025-12-23 08:42:36.420856

Request

{
    "event": "PreToolUse",
    "tool_name": "Bash",
    "tool_input": {
        "command": "cat > \/tmp\/vision_compare.py << 'EOF'\n#!\/usr\/bin\/env python3\n\"\"\"Compare vision models performance.\"\"\"\nimport time\nimport base64\nimport requests\n\nIMAGE_PATH = \"\/tmp\/pipeline_images\/Booklet_Abschluss_RELAUNCH2026_page_001.png\"\nOLLAMA_HOST = \"http:\/\/localhost:11434\"\nPROMPT = \"Describe this image. What visual elements do you see?\"\n\nMODELS = [\n    \"minicpm-v:latest\",\n    \"moondream:latest\", \n    \"llama3.2-vision:11b\"\n]\n\ndef test_model(model_name, image_path, prompt):\n    \"\"\"Test a single model.\"\"\"\n    with open(image_path, \"rb\") as f:\n        image_data = base64.b64encode(f.read()).decode()\n    \n    start = time.time()\n    try:\n        response = requests.post(\n            f\"{OLLAMA_HOST}\/api\/generate\",\n            json={\n                \"model\": model_name,\n                \"prompt\": prompt,\n                \"images\": [image_data],\n                \"stream\": False\n            },\n            timeout=120\n        )\n        response.raise_for_status()\n        elapsed = time.time() - start\n        result = response.json()\n        return {\n            \"success\": True,\n            \"time\": elapsed,\n            \"response\": result.get(\"response\", \"\")[:300],\n            \"tokens\": result.get(\"eval_count\", 0)\n        }\n    except Exception as e:\n        return {\"success\": False, \"error\": str(e), \"time\": time.time() - start}\n\nprint(\"=\" * 60)\nprint(\"Vision Model Comparison Test\")\nprint(\"=\" * 60)\nprint(f\"Image: {IMAGE_PATH}\")\nprint(f\"Prompt: {PROMPT}\")\nprint()\n\nresults = {}\nfor model in MODELS:\n    print(f\"\\n--- Testing: {model} ---\")\n    result = test_model(model, IMAGE_PATH, PROMPT)\n    results[model] = result\n    \n    if result[\"success\"]:\n        print(f\"Time: {result['time']:.2f}s\")\n        print(f\"Tokens: {result['tokens']}\")\n        print(f\"Response: {result['response']}...\")\n    else:\n        print(f\"FAILED: {result['error']}\")\n\nprint(\"\\n\" + \"=\" * 60)\nprint(\"SUMMARY\")\nprint(\"=\" * 60)\nprint(f\"{'Model':<25} {'Time':>10} {'Tokens':>10} {'Status':>10}\")\nprint(\"-\" * 60)\nfor model, result in results.items():\n    if result[\"success\"]:\n        print(f\"{model:<25} {result['time']:>9.2f}s {result['tokens']:>10} {'OK':>10}\")\n    else:\n        print(f\"{model:<25} {'N\/A':>10} {'N\/A':>10} {'FAILED':>10}\")\n\n# Calculate speedup\nif all(r[\"success\"] for r in results.values()):\n    base_time = results[\"minicpm-v:latest\"][\"time\"]\n    print(\"\\nSpeedup vs minicpm-v:\")\n    for model, result in results.items():\n        speedup = base_time \/ result[\"time\"]\n        print(f\"  {model}: {speedup:.2f}x\")\nEOF\npython3 \/tmp\/vision_compare.py",
        "timeout": 300000,
        "description": "Compare 3 vision models performance"
    }
}

Response

{
    "tool_response": {
        "stdout": "============================================================\nVision Model Comparison Test\n============================================================\nImage: \/tmp\/pipeline_images\/Booklet_Abschluss_RELAUNCH2026_page_001.png\nPrompt: Describe this image. What visual elements do you see?\n\n\n--- Testing: minicpm-v:latest ---\nTime: 78.80s\nTokens: 63\nResponse: 这个图片是一个信息图表,背景为浅灰色。在顶部中央有一个圆圈内有文本的标志。该标志显示“校园阿姆斯台德”。下面文字是用粗体大写字母书写的,并且内容如下:“模块直播教练和毕业典礼”,底部还有一个网址地址。...\n\n--- Testing: moondream:latest ---\nTime: 3.52s\nTokens: 82\nResponse: \nThe image features a white poster with black text and logos, which appears to be an advertisement for a live coaching session or workshop. The poster is displayed against a gray background, making it stand out prominently. The logo of the event is placed in the top right corner of the poster, while...\n\n--- Testing: llama3.2-vision:11b ---\nTime: 28.24s\nTokens: 306\nResponse: The image is a cover page for a brochure or flyer, featuring the logo of \"CAMPUS AM SEE\" at the top. The purpose of the image is to promote the services offered by \"CAMPUS AM SEE\", which include live coaching and online courses.\n\n* A logo for \"CAMPUS AM SEE\" is at the top:\n\t+ The logo is circular in...\n\n============================================================\nSUMMARY\n============================================================\nModel                           Time     Tokens     Status\n------------------------------------------------------------\nminicpm-v:latest              78.80s         63         OK\nmoondream:latest               3.52s         82         OK\nllama3.2-vision:11b           28.24s        306         OK\n\nSpeedup vs minicpm-v:\n  minicpm-v:latest: 1.00x\n  moondream:latest: 22.36x\n  llama3.2-vision:11b: 2.79x",
        "stderr": "",
        "interrupted": false,
        "isImage": false
    }
}
← Vorheriger Zur Liste Nächster →