Alpha support for attachments, allowing multi-modal models to accept images, audio, video and other formats. #578
Attachments in the CLI can be URLs:
llm "describe this image" \
-a https://static.simonwillison.net/static/2024/pelicans.jpgOr file paths:
llm "extract text" -a image1.jpg -a image2.jpgOr binary data, which may need to use --attachment-type to specify the MIME type:
cat image | llm "extract text" --attachment-type - image/jpegAttachments are also available in the Python API:
model = llm.get_model("gpt-4o-mini")
response = model.prompt(
"Describe these images",
attachments=[
llm.Attachment(path="pelican.jpg"),
llm.Attachment(url="https://static.simonwillison.net/static/2024/pelicans.jpg"),
]
)Plugins that provide alternative models can support attachments, see Attachments for multi-modal models for details.