pi-glm-image-summary

Pi extension that intercepts image reads when using glm-4.7 and sends them to glm-4.6v for detailed analysis

Package details

extension

Install pi-glm-image-summary from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-glm-image-summary
Package
pi-glm-image-summary
Version
0.1.4
Published
Feb 2, 2026
Downloads
34/mo · 12/wk
Author
kaofelix
License
MIT
Types
extension
Size
10.3 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-glm-image-summary

A pi extension that intercepts image reads when using non-vision GLM models and sends them to glm-4.6v for detailed analysis.

Why?

GLM text models (glm-4.6, glm-4.7, glm-4.7-flash) have no vision capabilities. GLM-4.6v does. This extension automatically detects when you're using a non-vision GLM model and intercepts image reads, sending them to glm-4.6v for comprehensive analysis.

Features

  • Automatic image interception: When using glm-4.7/glm-4.7-long, image file reads are automatically redirected to glm-4.6v for analysis
  • Comprehensive analysis: Extracts text content, visual elements, technical details, and more
  • Manual analysis command: /analyze-image <path> to manually analyze any image

Installation

Install globally:

pi install npm:pi-glm-image-summary

Or install for a specific project (writes to .pi/settings.json):

pi install -l npm:pi-glm-image-summary

To try it without installing:

pi -e npm:pi-glm-image-summary

Usage

Once installed, the extension loads automatically when you start pi:

pi --provider zai --model glm-4.7

Automatic Mode

When the extension detects:

  1. Current model is glm-4.7 or glm-4.7-long
  2. A file being read is an image (jpg, jpeg, png, gif, webp)

It will automatically spawn a subprocess with glm-4.6v to analyze the image and return a detailed summary.

Manual Analysis

Use the /analyze-image command to analyze any image:

/analyze-image ./screenshot.png

Supported Image Formats

  • JPEG (.jpg, .jpeg)
  • PNG (.png)
  • GIF (.gif)
  • WebP (.webp)

Configuration

The extension uses the ZAI provider for the vision model. Make sure you have proper API credentials configured.