Skip to content
This repository was archived by the owner on Jul 14, 2026. It is now read-only.

ssdiwu/pi-dvision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-dvision

A pi extension that gives text-only models vision: when the active model doesn't support image input, pi-dvision uses a vision model you pick to describe images, then feeds the text description to the non-vision model.

What it does

When the active model lacks image input, pi-dvision intercepts image blocks at two points:

  1. tool_result (read) — Primary injection: when the agent reads an image file, the image block is sent to the configured vision model for a text description. The description replaces the image block before the agent's next turn.
  2. context — Fallback injection: any remaining image blocks (user-attached, pasted) are swapped for their cached text description on the LLM-bound payload.

Each image gets one independent completeSimple() call (parallel). Descriptions are cached per image hash so the same image isn't described twice.

Install

From local path

pi install /absolute/path/to/pi-dvision

Or add to ~/.pi/agent/settings.json packages array.

不要把 index.ts 拷贝到 ~/.pi/agent/extensions/ 下作为加载方式。 通过 pi installsettings.jsonpackages 注册加载。

Configure

Set the vision model

/dvision model minimax-cn/MiniMax-M3

Check status

/dvision status

Commands

/dvision                    Show status
/dvision model <provider/id>  Set the vision model
/dvision status              Show current config
/dvision enable              Enable handoff
/dvision disable             Disable handoff
/dvision auto <on|off>       Toggle auto handoff for non-vision models
/dvision clear               Clear the configured vision model
/dvision help                Show usage

Config file

Config lives at ~/.pi/agent/pi-dvision.json:

{
  "enabled": true,
  "visionModel": "minimax-cn/MiniMax-M3",
  "autoHandoff": true
}

How it works

agent reads image file
  │
  ▼
tool_result (read)  ── image block → vision model → text description
  │                    description lands in tool result before agent's next turn
  ▼
context             ── any remaining image blocks → cached text description
  │                    (only on cloned LLM-bound payload)
  ▼
text-only model receives text, not image

Development

npm run typecheck

Changelog

See CHANGELOG.md.

License

MIT

About

Pi extension that gives text-only models vision — describes images with a vision model you pick, then feeds the text description to non-vision models

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages