kani-multimodal-core
This package contains core extensions for using Kani with multimodal language models.
Installation
kani-multimodal-core should be installed alongside the core kani install using an extra:
$ pip install "kani[multimodal]"
However, you can also explicitly specify a version and install the core package itself:
$ pip install kani-multimodal-core
Features
This package provides the core multimodal extensions that engine implementations can use -- it does not provide any engine implementations on its own.
The package adds support for:
- Images (
kani.ext.multimodal_core.ImagePart) - Audio (
kani.ext.multimodal_core.AudioPart) - Video (
kani.ext.multimodal_core.VideoPart) - Other binary files, such as PDFs (
kani.ext.multimodal_core.BinaryFilePart)
When installed, these core kani engines will automatically use the multimodal parts:
- OpenAIEngine
- AnthropicEngine
- GoogleAIEngine
Additionally, the core kani chat_in_terminal method will support attaching multimodal data from a local drive or
from the internet using @/path/to/media or @https://example.com/media.
Message Parts
The main feature you need to be familiar with is the MessagePart, the core way of sending messages to the engine.
To do this, when you call the kani round methods (i.e. Kani.chat_round or Kani.full_round or their str variants),
pass a list of multimodal parts rather than a string:
from kani import Kani
from kani.engines.openai import OpenAIEngine
from kani.ext.multimodal_core import ImagePart
engine = OpenAIEngine(model="gpt-4.1-nano")
ai = Kani(engine)
# notice how the arg is a list of parts rather than a single str!
msg = await ai.chat_round_str([
"Please describe this image:",
ImagePart.from_file("path/to/image.png")
])
print(msg)
See the docs (https://kani-multimodal-core.readthedocs.io) for more information about the provided message parts.
Terminal Utility
When installed, kani-multimodal-core augments the chat_in_terminal utility provided by kani.
This utility allows you to provide multimodal media on your disk or on the internet inline by prepending it with an @ symbol:
>>> from kani import chat_in_terminal
>>> chat_in_terminal(ai)
USER: Please describe this image: @path/to/image.png and also this one: @https://example.com/image.png
Metadata
Release files for kani-multimodal-core 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kani_multimodal_core-0.0.4.tar.gz | 47.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kani_multimodal_core-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.0 MB
Release files / kani_multimodal_core-0.0.4.tar.gz
| Download URL | kani_multimodal_core-0.0.4.tar.gz |
|---|---|
| Size | 47.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d2965d6689a33ee6dd0a0cc117cc1339bd625bdbb541a39aef25466ca93db7b
|
|
BLAKE2b-256 checksum How to use checksums |
adb0e2d3c047a46129fef7c1af361216878ded32c51d8dc60d61cf9819072709
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2025.
Transparency logRelease files / kani_multimodal_core-0.0.4-py3-none-any.whl
| Download URL | kani_multimodal_core-0.0.4-py3-none-any.whl |
|---|---|
| Size | 19.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
73cb73ad5278b216b23173b3e687b767f016447eb5a46d7d0499ceaa0ae89fdf
|
|
BLAKE2b-256 checksum How to use checksums |
819641acafec347676c2daf7366e4acadf8a961cfe52e052337a113578ca9a65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2025.
Transparency log