mllm-annotator
A small, resumable tool for sending folders of audio or image files to a multimodal LLM for automatic annotation, plus an embedding + UMAP visualization workflow. Gemini is the current backend; the design keeps the provider behind a thin seam so others can be added later.
It ships both a command-line tool and a desktop GUI.
Install
# CLI only
pip install mllm-annotator
# with the desktop GUI and the embed/visualize feature
pip install "mllm-annotator[ui,viz]"
Or, for development from a clone:
uv sync --extra ui --extra viz
The embed/visualize feature also needs ffmpeg on your PATH to handle
audio formats Gemini can't embed directly (e.g. .aac, .opus). It is an
optional system dependency, not a pip package; without it those files are
skipped.
API key
Provide a Gemini API key in any one of these ways (checked in this order):
-
environment variable
GEMINI_API_KEY(orGOOGLE_API_KEY):$env:GEMINI_API_KEY="your_api_key"
-
a
.envfile in the current working directory:GEMINI_API_KEY=your_api_key
-
saved from inside the GUI — click Set API Key in the top-left corner (it also opens automatically on first launch if no key is found), paste the key, and it is stored securely in your OS keyring (Windows Credential Manager / macOS Keychain / Linux Secret Service). No plaintext file is written.
.env is ignored by git, and keys are never written into the built package.
Command line
mllm-annotator --help
Examples
Horse cough annotation:
mllm-annotator `
--input-folder "C:\data\horse_audio" `
--media-type audio `
--instruction "Annotate if the audio contains a horse cough or another sound such as the horse smacking the microphone." `
--daily-limit 500
Swiss German transcription validation:
mllm-annotator `
--input-folder "C:\data\swiss_german_audio" `
--media-type audio `
--labels-csv "C:\data\transcriptions.csv" `
--instruction "Confirm whether the attached Swiss German audio matches the associated transcription. If it is wrong, rewrite the correct transcription." `
--daily-limit 500
Image captioning:
mllm-annotator `
--input-folder "C:\data\images" `
--media-type image `
--instruction "Caption the attached image." `
--daily-limit 500
Desktop GUI
mllm-annotator-ui
The GUI lets you browse for the data folder, choose audio or image mode, optionally select a CSV, write the instruction, and preview the file table.
The Annotation Spec panel drives the run in two steps:
- Propose with Gemini — Gemini designs a rewritten instruction, the CSV columns to use, and the output fields (with any enum labels). They appear in an editable form: a rewritten-instruction box and one row per output field (name, type, allowed values, description). With "Rewrite prompt" unchecked, a default spec is proposed without an API call.
- Approve & Build Table — once you are happy with the (optionally edited) spec, this builds the Results table around your output fields.
Then Start / Resume processes the files using the approved spec, updating
each row as Gemini responses arrive and writing the same JSONL result/state
files as the CLI. Resuming a previous run loads and re-uses its stored spec
automatically. A second tab embeds the media and shows an interactive 2-D
UMAP projection (zoom/pan toolbar, hover a point for its file name). If you
provide a CSV, a "Color by" dropdown lets you color the points by any of its
columns; switching columns re-colors instantly using cached coordinates.
Embeddings are written next to the data as {folder}_embeddings.jsonl.
CSV format
The optional labels CSV may have any number of columns; only filename is
required, and every media file must have exactly one matching row. Empty
cells are allowed. Other columns are passed to Gemini, which decides which
to use and how based on your instruction.
filename,manual_label,model_label
audio_001.wav,cough,cough
audio_002.wav,,not_cough
audio_003.wav,snort,cough
For --recursive, filename must be the relative path with forward slashes,
for example speaker_a/audio_001.wav.
Resume behavior
On the CLI, results default to runs/results.jsonl and progress to
runs/state.json (override with --output-file / --state-file). The GUI
instead defaults both next to the data folder ({folder}_results.jsonl /
{folder}_state.json). Either way, if the daily limit is reached or the API
returns a quota/rate limit, run the same command again later or the next day —
already processed files are skipped.
On the first run, gemini-3.5-flash designs an annotation spec from your
instruction and any CSV columns: a rewritten instruction, the columns to pass
per sample, and the output fields (with enum labels when your instruction
implies them). The spec is stored in the state file and reused on resume; you
can edit state.json (or the GUI Spec panel) to adjust it. Media files are
processed with gemini-3.1-flash-lite. Use --no-rewrite to skip the design
call and use a default schema (annotation, confidence, notes) with the
instruction as-is.
Example: closed-set audio labeling
Instruction:
Review these audio clips. Each clip is part of a recording of a horse. The labels CSV has a
manual_labelcolumn (the sound a human annotated, may be empty) and amodel_labelcolumn (a neural network's prediction of whether the clip contains a cough). Output anannotator_labelchosen fromcough,snort, orgrunt, and aconfidencebetween 0 and 1.
Gemini will design a spec whose output_fields includes
annotator_label (string with enum_values: [cough, snort, grunt]) and
confidence (number), and pass manual_label and model_label to each
per-sample call.
Before spending API calls, you can validate the folder and optional CSV:
mllm-annotator `
--input-folder "C:\data\images" `
--media-type image `
--instruction "Caption the attached image." `
--dry-run
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mllm_annotator-0.1.3.tar.gz.
File metadata
- Download URL: mllm_annotator-0.1.3.tar.gz
- Upload date:
- Size: 45.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cca75590e0fbca3d4fc18f154bb9d1e8f479c8da7eb0d0049b5ef63f1d50ae0
|
|
| MD5 |
558398ba50012513ca4273baab82179a
|
|
| BLAKE2b-256 |
cd0c18d20595a86f4df74dddfc842d33b6ea8c601cbf8834b9b69f6c783e47f8
|
Provenance
The following attestation bundles were made for mllm_annotator-0.1.3.tar.gz:
Publisher:
publish.yml on BoiMat/mllm-annotator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mllm_annotator-0.1.3.tar.gz -
Subject digest:
6cca75590e0fbca3d4fc18f154bb9d1e8f479c8da7eb0d0049b5ef63f1d50ae0 - Sigstore transparency entry: 1841250179
- Sigstore integration time:
-
Permalink:
BoiMat/mllm-annotator@f0636a150c0f91addb8ad4d731a7aa2c7cea7c79 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/BoiMat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f0636a150c0f91addb8ad4d731a7aa2c7cea7c79 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mllm_annotator-0.1.3-py3-none-any.whl.
File metadata
- Download URL: mllm_annotator-0.1.3-py3-none-any.whl
- Upload date:
- Size: 45.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd0d0d870665901ec7cb6febfd2009411165df43ee2cfda859738089b1d25985
|
|
| MD5 |
620370ccf04fd9dad416c338d27f52f6
|
|
| BLAKE2b-256 |
3157aa9d0c05e1817d1137c957f4d4c05fffa83423119ecdcfdd0376093e4e22
|
Provenance
The following attestation bundles were made for mllm_annotator-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on BoiMat/mllm-annotator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mllm_annotator-0.1.3-py3-none-any.whl -
Subject digest:
cd0d0d870665901ec7cb6febfd2009411165df43ee2cfda859738089b1d25985 - Sigstore transparency entry: 1841250269
- Sigstore integration time:
-
Permalink:
BoiMat/mllm-annotator@f0636a150c0f91addb8ad4d731a7aa2c7cea7c79 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/BoiMat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f0636a150c0f91addb8ad4d731a7aa2c7cea7c79 -
Trigger Event:
push
-
Statement type: