New:Socket for Asana Is Now Available.Learn more
Get Started

vision-bridge

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vision-bridge

Use GLM-4.6V-Flash to convert images to text for non-vision AI models

latest
npmnpm
Version
0.2.0
Version published
Weekly downloads
750
16.82%
Maintainers
1
Weekly downloads
 
Created
Source

Vision Bridge

Use GLM-4.6V-Flash to convert images to text for non-vision AI models.

Problem

Many LLMs don't support image input. Vision Bridge solves this by using GLM-4.6V-Flash (free) as a vision intermediary.

How It Works

Image → GLM-4.6V-Flash → Text Description → Your Non-Vision Model

Installation

npm install -g vision-bridge

Setup

Set your ZhipuAI API key:

export ZHIPUAI_API_KEY="your-api-key"

Get API key: https://open.bigmodel.cn

Usage

Analyze Image

# From local file
vision-bridge analyze photo.jpg

# From URL
vision-bridge analyze https://example.com/image.png

# Custom prompt
vision-bridge analyze screenshot.png -p "What UI components are in this screenshot?"

# Stream output
vision-bridge analyze doc.jpg --stream

# Enable thinking mode for complex images
vision-bridge analyze chart.png --thinking

# Save to file
vision-bridge analyze receipt.jpg -o output.txt

OCR Mode

# Extract text from image
vision-bridge ocr document.jpg

# Save OCR result
vision-bridge ocr table.jpg -o table.md

Image2Prompt

# Generate AI art prompt from image
vision-bridge prompt artwork.jpg

Pipe to Other Models

# Use with any CLI model tool
vision-bridge analyze image.jpg | some-text-model --stdin

# Example workflow
vision-bridge analyze screenshot.png -o desc.txt
cat desc.txt | your-favorite-llm "Based on this UI description, generate the HTML/CSS code"

Options

OptionDescription
-p, --promptCustom analysis prompt
-k, --api-keyAPI key (or use env var)
-t, --thinkingEnable deep reasoning
-s, --streamStream output
-o, --outputSave to file

Library Usage

import { VisionBridge } from "vision-bridge";

const bridge = new VisionBridge({ apiKey: "your-api-key" });

// Analyze image
const description = await bridge.analyze("https://example.com/image.png");

// Stream analysis
for await (const chunk of bridge.analyzeStream("photo.jpg")) {
  process.stdout.write(chunk);
}

// OCR
const text = await bridge.ocr("document.jpg");

// Image to prompt
const prompt = await bridge.image2prompt("artwork.jpg");

License

MIT

Keywords

vision

FAQs

Package last updated on 31 Mar 2026

Related posts