← Catalog

@8monkey/pi-media

Pi extension that attaches local images, audio, video and PDF files when you write their paths in your message, and lets the read tool read audio, video and PDF files.

Package

Install

Install with PiG

pig install npm:@8monkey/pi-media

Install with Pi

pi install npm:@8monkey/pi-media
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.3.1 (README.md). PiG does not review it.

pi-media

Attach local images, audio, video and PDFs to your pi conversations by including their paths in your messages.

Install

pi install npm:@8monkey/pi-media

You need pi and Node 22.19 or later.

Examples

what is in this screenshot? @screen.png
summarize this recording: ~/Downloads/standup.mp3
compare @"Q3 report.pdf" with ./q4-report.pdf

Type @ to pick a file, or enter a path starting with /, ~/, ./ or ../.

Send files to your chat model

By default, pi-media sends the original file to your chat model.

  • Images use pi's own image support.
  • Audio, video and PDF files work only when the chat model uses the openai-completions API in pi, and the provider and model accept the format.

pi-media can send these formats. Your model may accept only some of them.

TypeFormats
ImagePNG (not animated), JPEG, GIF, WebP, BMP
AudioWAV, MP3, AIFF, AAC, Ogg, FLAC, M4A
VideoMP4, MPEG, WebM
DocumentPDF

Use a media model

Configure a media model to convert files to text when a chat model that cannot read them natively:

  • Image: a description and the visible text
  • Audio: a transcript
  • PDF: the text, with descriptions of images and charts

Run /media-models, choose Image, Audio or Document (PDF), and pick a model that supports that type. Its provider must offer an OpenAI-compatible API.

For the API, choose openai-completions for chat models or openai-transcriptions for speech-to-text models. If the model is not in the list, choose Type a model… and enter provider/model-id.

When set, the media model handles every file of its type, and your chat model gets only the text conversion.

Size limit

Files can be up to 20 MiB. To change the limit, add or update maxAttachmentBytes in ~/.pi/agent/pi-media.json, then run /reload. For example, set 50 MiB:

{ "maxAttachmentBytes": 52428800 }

License

MIT