Skip to content
Open
Show file tree
Hide file tree
Changes from 177 commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
2689205
Add QwenSpeechSummarization
eric-mccann-pro Dec 12, 2025
f01498a
Runs main() in container... does not run main during build for testin…
eric-mccann-pro Dec 12, 2025
98bc842
Logger won't log. Deal with it later
eric-mccann-pro Dec 12, 2025
98bb794
Fix format strings
eric-mccann-pro Dec 12, 2025
e29c34a
Add primary_topic and other_topics to output
eric-mccann-pro Dec 12, 2025
0604c07
Make sure we download the tokenizer giblets during docker build
eric-mccann-pro Dec 12, 2025
97ae53f
Mock an LLM generator's events stream. Run pytest if RUN_TESTS is true
eric-mccann-pro Dec 15, 2025
f04d5b0
Use releasable descriptor
eric-mccann-pro Dec 16, 2025
86a7ab4
Readme
eric-mccann-pro Dec 16, 2025
50cb5f7
Change default RUN_TEST to false
eric-mccann-pro Dec 16, 2025
e006afd
Parameterize VLLM_MODEL and VLLM_URI at container scope, as they're e…
eric-mccann-pro Dec 16, 2025
b0b1c15
+x
eric-mccann-pro Dec 16, 2025
198f3ec
Include served-model-name param in the entrypoint, not the CMD
eric-mccann-pro Dec 16, 2025
0908932
Make sure tokenizer pull step has VLLM_MODEL defined in env if overriden
eric-mccann-pro Dec 16, 2025
c20c3d2
License blocks
eric-mccann-pro Dec 16, 2025
ebbecd7
Make exception text less useless when there are no FF tracks
eric-mccann-pro Dec 16, 2025
5aea1b7
Fix typo
eric-mccann-pro Dec 16, 2025
68c8456
Fix another typo
eric-mccann-pro Dec 16, 2025
ae4f6f0
Fix default in descriptor
eric-mccann-pro Dec 16, 2025
de6f2d3
Make speaker id optional
eric-mccann-pro Dec 16, 2025
cc151c6
input_cleanup: be cool
eric-mccann-pro Dec 16, 2025
16a367c
again
eric-mccann-pro Dec 16, 2025
7d231e5
Change summary and print the final summary after it comes back from t…
eric-mccann-pro Dec 16, 2025
3c04189
Print number of results from component video track func when called b…
eric-mccann-pro Dec 16, 2025
47ca541
Actually return results. duh
eric-mccann-pro Dec 16, 2025
dbed34c
Set an ImageLocation for video tracks
eric-mccann-pro Dec 17, 2025
bb5d333
Define CLASSIFIERS_FILE and ENABLED_CLASSIFIERS in the json, now that…
eric-mccann-pro Dec 17, 2025
6948569
Gate some of the output behind debug parameter
eric-mccann-pro Dec 17, 2025
82f37b6
Provide Items of Interest instruction
eric-mccann-pro Dec 17, 2025
9e47148
Remove businesses from entities list
eric-mccann-pro Dec 17, 2025
ed36524
Parameterization and documentation
eric-mccann-pro Dec 17, 2025
17e8c54
Switch propertiesKeys instead of defaultValues
eric-mccann-pro Dec 17, 2025
8f299b8
Remove partial word from README.md
eric-mccann-pro Dec 17, 2025
6fc5a37
PROMPT_TEMPLATE is a property
eric-mccann-pro Dec 17, 2025
f3500db
Fix a typo and mention VLLM_URI
eric-mccann-pro Dec 17, 2025
64d62bb
Don't mention VRAM
eric-mccann-pro Dec 17, 2025
247ca37
Make sample classifiers match readme AND put ticks around properties+…
eric-mccann-pro Dec 17, 2025
d18a7af
Switch to defaults for the properties that have a default
eric-mccann-pro Dec 17, 2025
c192dca
Output => tracks
eric-mccann-pro Dec 17, 2025
c32d4bb
justification => reasoning
eric-mccann-pro Dec 17, 2025
60e7fa3
Specific Items of Interest appendage is never empty if present
eric-mccann-pro Dec 17, 2025
9eb3a39
reasonining
eric-mccann-pro Dec 17, 2025
eb4fccc
Use classifier confidence for detection confidence
eric-mccann-pro Dec 18, 2025
fc5dc70
Use FakeClass for all of the manual openai-api client mock buildout
eric-mccann-pro Dec 18, 2025
d838d0b
Make sure the tracks are ordered in accordance with their index
eric-mccann-pro Dec 18, 2025
ceb6801
Validate schema, close clients between calls (prevents deadlock)
eric-mccann-pro Dec 18, 2025
67e680f
Fix path to vllm-entrypoint.sh.
jrobble Dec 24, 2025
3097d3f
Disable XET for hf download and fix deprecation warning
eric-mccann-pro Jan 2, 2026
7318613
Perform download in separate stage
eric-mccann-pro Jan 2, 2026
84e170c
Fix max-model-length parameter name
eric-mccann-pro Jan 15, 2026
8f5f61d
Merge branch 'develop' into feat/qwen-speech-summarization
jrobble Jan 15, 2026
177671b
Update versions to 10.0.
jrobble Jan 15, 2026
9202086
Fix JSONArgsRecommended warning.
jrobble Jan 22, 2026
04f7e1a
Fix how Whisper is returning duplicate tracks for videos.
jrobble Jan 22, 2026
541fac1
Wait up to two minutes for vllm to be healthy for each call to summarize
eric-mccann-pro Jan 22, 2026
e6506bd
Merge remote-tracking branch 'origin/feat/qwen-speech-summarization' …
eric-mccann-pro Jan 22, 2026
2a14fe1
Use algorithm prop.
jrobble Jan 22, 2026
e3d6327
Fix test.
jrobble Jan 23, 2026
08d5531
Fix test round 2.
jrobble Jan 23, 2026
f7fa93c
Fix bug.
jrobble Jan 23, 2026
e3e9c0d
Use local_files_only=True.
jrobble Jan 23, 2026
48acdaa
Download autotokenizer in Dockerfile.
jrobble Jan 23, 2026
f38fc8a
Fix syntax.
jrobble Jan 23, 2026
31f1b68
Proper quotes.
jrobble Jan 23, 2026
4710b35
Use import.
jrobble Jan 23, 2026
c5d9d52
Bug fix.
jrobble Jan 23, 2026
319d1a7
Use HF_HUB_OFFLINE.
jrobble Jan 23, 2026
073003b
Use HF_HUB_OFFLINE before import.
jrobble Jan 24, 2026
e0be4ec
Merge remote-tracking branch 'origin/jrobble/qwen-speech-summarizatio…
eric-mccann-pro Jan 26, 2026
15404ee
Filter out low confidence classifiers
eric-mccann-pro Jan 26, 2026
79ffed8
Add classifier_confidence_minimum to descriptor
eric-mccann-pro Jan 26, 2026
05e12ee
Add requests to setup.cfg
eric-mccann-pro Jan 26, 2026
b935b2e
descriptor: true ==> "TRUE"
eric-mccann-pro Jan 26, 2026
c11328e
Fix bug reading classifiers.json from $MPF_HOME.
jrobble Jan 30, 2026
03213f0
Add a todo about manually aglommerating lists instead of making the m…
eric-mccann-pro Jan 30, 2026
39810e4
Force minimum_chunk_size=2 by default to force json array chunking to…
eric-mccann-pro Jan 30, 2026
b381967
descriptor: prevent segmentation to avoid redundant summarization bet…
eric-mccann-pro Jan 30, 2026
b7f139c
Remove vestigial functions from non-component qwen summarization impl…
eric-mccann-pro Jan 30, 2026
a319bd0
Replace deprecated pkg_resources
eric-mccann-pro Jan 30, 2026
b0fd935
Merge remote-tracking branch 'origin/feat/qwen-speech-summarization' …
eric-mccann-pro Jan 30, 2026
1b257fa
Use PROMPT_TEMPLATE property default to handle both the overriden and…
eric-mccann-pro Jan 30, 2026
3d6e258
_underscore_private_class_methods
eric-mccann-pro Jan 30, 2026
5683ff9
Fix test_slapchop test expected to match minimum 2-object chunk size …
eric-mccann-pro Jan 30, 2026
f652c72
Assume HF_HUB_OFFLINE shouldn't be one for pytest, allowing downloadi…
eric-mccann-pro Jan 30, 2026
78f5999
Add a shortcut for the tail of summarize_summaries grouping. Don't su…
eric-mccann-pro Jan 30, 2026
5dccb08
Revert 39810e4 and 5683ff9: min_grouping is selected in summarize_sum…
eric-mccann-pro Jan 30, 2026
f22a61a
If chunk isn't a string, don't loads it
eric-mccann-pro Jan 30, 2026
ef29659
pydantic: fix deprecated call to .json()
eric-mccann-pro Jan 30, 2026
292b2bf
Fixup path handling for prompt_template AND its default value
eric-mccann-pro Jan 30, 2026
d584076
CORRECT the extension on the prompt template
eric-mccann-pro Jan 30, 2026
494cb9f
If you're a float, be a float
eric-mccann-pro Jan 30, 2026
0381f8b
Correct property name
eric-mccann-pro Jan 30, 2026
9a9c478
Copy topics+entities to main detection more defensively
eric-mccann-pro Feb 2, 2026
f61fa98
Update python/QwenSpeechSummarization/qwen_speech_summarization_compo…
eric-mccann-pro Feb 5, 2026
968684b
Raise proper exception abhout audio detection not being supported
eric-mccann-pro Feb 11, 2026
12d6f06
Freeze versions of some deps
eric-mccann-pro Feb 11, 2026
0fb3f55
Replace setup.cfg
eric-mccann-pro Feb 11, 2026
562d02a
Move env vars to config
eric-mccann-pro Feb 11, 2026
790c472
print => logger
eric-mccann-pro Feb 11, 2026
cb74610
Pin vllm version
eric-mccann-pro Feb 11, 2026
1878752
Update overview
eric-mccann-pro Feb 11, 2026
723ba20
Prompt grammar and clarity
eric-mccann-pro Feb 11, 2026
84411f0
Give more control over healthcheck
eric-mccann-pro Feb 11, 2026
83ed483
Skip healthcheck if vllm_health_uri is falsey
eric-mccann-pro Feb 11, 2026
1d2b204
Remove duplicate import
eric-mccann-pro Feb 11, 2026
5fd25e1
Merge remote-tracking branch 'origin/master' into feat/qwen-speech-su…
eric-mccann-pro Feb 11, 2026
40b48f9
Correct exported component path
eric-mccann-pro Feb 11, 2026
2f6199b
Update python/QwenSpeechSummarization/qwen_speech_summarization_compo…
eric-mccann-pro Feb 12, 2026
cdfaad4
Describe get_detections_from_all_video_tracks
eric-mccann-pro Feb 12, 2026
19c84aa
No parent package? no problem
eric-mccann-pro Feb 12, 2026
779845d
Rename file about public domain origin of test.txt to NOTICE
eric-mccann-pro Feb 12, 2026
4236821
Correct env var name in the readme
eric-mccann-pro Feb 16, 2026
e8a8a22
Make copyrights right
eric-mccann-pro Feb 16, 2026
bd0c557
Make more of the parameters live permanently on config rather than on…
eric-mccann-pro Feb 16, 2026
ba8204c
Fix deprecated logging method
eric-mccann-pro Feb 16, 2026
b84bf88
Lower the roof. Raise a real mpf DetectionError
eric-mccann-pro Feb 16, 2026
f9d0ace
Correct property name for CLASSIFIERS_LIST
eric-mccann-pro Feb 16, 2026
d8ad16e
Fix (and test) chunk overlap
eric-mccann-pro Feb 16, 2026
03d2374
Fix counting of overlaps AND fix tests after related logic was changed
eric-mccann-pro Feb 16, 2026
0a93995
Rename to LlmSpeechSummarization
eric-mccann-pro Feb 18, 2026
08336e1
Missed component rebranding instances
eric-mccann-pro Feb 18, 2026
46423d1
Use urljoin instead of path join for health uri default
eric-mccann-pro Feb 18, 2026
8ce36d6
Don't leak contexts
eric-mccann-pro Feb 18, 2026
f5ae9a8
Create a constant for BOUNDARY_TOKEN_FOR_COUNTING
eric-mccann-pro Feb 18, 2026
55a940e
Fix slapchop overlap and add a new test for overlap >1
eric-mccann-pro Feb 18, 2026
014076d
Add another test for longish overlaps
eric-mccann-pro Feb 18, 2026
56f5be9
Fix tests' expected output in light of slapchop corrections
eric-mccann-pro Feb 18, 2026
5918691
Remove prints
eric-mccann-pro Feb 23, 2026
6bf3b25
Don't rely on __dict__ to access entities
eric-mccann-pro Feb 23, 2026
7a62b5d
Prevent newlines within an utterance when mangling a book as test tra…
eric-mccann-pro Feb 23, 2026
9f6666f
Fix counting of tokens per each input line
eric-mccann-pro Feb 23, 2026
6d00138
Force spoken tracks to not contain newlines
eric-mccann-pro Feb 24, 2026
07015a9
run_component_test: now with logging configured, and env variable han…
eric-mccann-pro Feb 24, 2026
d10dd7f
Set slapchop logger level too
eric-mccann-pro Feb 24, 2026
04d20a8
Don't describe the output schema in the prompt. Just include the json…
eric-mccann-pro Feb 18, 2026
c36bcbd
Add COMBINATION_INSTRUCTIONs to the schema that are specifically for …
eric-mccann-pro Feb 18, 2026
4f659b0
Update test_llm_speech_summarization_component assertion to match upd…
eric-mccann-pro Feb 18, 2026
b9e92db
Move classifiers instructions into schema.py
eric-mccann-pro Feb 20, 2026
f59410e
Add more specific language about summary combination
eric-mccann-pro Feb 23, 2026
587e8de
Fix some wonk with when summarizing big chunks
eric-mccann-pro Feb 24, 2026
e79f7b4
Lower default chunk size now that tokens are counted correctly
eric-mccann-pro Feb 24, 2026
3c94b8f
Merge remote-tracking branch 'origin/feat/qwen-speech-summarization' …
eric-mccann-pro Feb 24, 2026
48ce688
Increase safety margin on max_completion_tokens
eric-mccann-pro Feb 24, 2026
5f4a1fe
Add properties ALLOW_REFUSAL_RESPONSE and ALLOW_PARTIAL_RESPONSE. Log…
eric-mccann-pro Feb 25, 2026
8731fe2
Merge remote-tracking branch 'origin/feat/qwen-speech-summarization' …
eric-mccann-pro Feb 25, 2026
be7c7fa
Restore global logger instance
eric-mccann-pro Feb 26, 2026
260a369
Create a utility fn and test for throwing errors with mpf types
eric-mccann-pro Feb 26, 2026
49a4045
Only use mpf exception types
eric-mccann-pro Feb 26, 2026
9064cca
Reduce streaming COMPLETION messages to de bug (only enabled when DEB…
eric-mccann-pro Feb 26, 2026
998bb2b
Remove redundant debug messages
eric-mccann-pro Feb 26, 2026
c4f2910
Fix tests with FakeLLM after adjustments to _get_output
eric-mccann-pro Feb 26, 2026
e24d3b6
Make last_error in connection loop more reliable
eric-mccann-pro Feb 27, 2026
0d43ed8
Fix default VLLM_URI in descriptor, post-rename
eric-mccann-pro Feb 27, 2026
9a6d47b
Allow an empty vllm_health_uri to skip the health check
eric-mccann-pro Mar 3, 2026
7edcd83
Add a separate TOKENIZER_MODEL in case the model name used for the op…
eric-mccann-pro Mar 3, 2026
6b63f85
Azure support
eric-mccann-pro Mar 3, 2026
d23b333
Make the schema compatible with azure's gpt
eric-mccann-pro Mar 3, 2026
0b4ace3
Sometimes ChatGPT will stream an event without choices. Continue when…
eric-mccann-pro Mar 4, 2026
a976278
Make confidence be a rating that's strictly about true positives
eric-mccann-pro Mar 4, 2026
8037c23
Export LlmSpeechSummaryComponent
eric-mccann-pro Mar 4, 2026
e9d45ce
classifiers: conditionally restore partial instructions to default pr…
eric-mccann-pro Mar 4, 2026
3ef168f
codify the length requirement for the classifiers list in the schema
eric-mccann-pro Mar 4, 2026
85a8192
Restore previous monolithic classifier... 50 is probably way too many
eric-mccann-pro Mar 4, 2026
4cb1ddc
Dynamically build pydantic model such that classifiers is an object N…
eric-mccann-pro Mar 4, 2026
6c7634f
Revert "classifiers: conditionally restore partial instructions to de…
eric-mccann-pro Mar 4, 2026
e1237fa
Restore TRUE NEGATIVE confidence specification
eric-mccann-pro Mar 4, 2026
a9eb818
Correct simulated test input for new LLM response_format AND correct …
eric-mccann-pro Mar 4, 2026
892ab9e
Fix handling of dynamic strict model fields for azure gpt
eric-mccann-pro Mar 4, 2026
3dd3e6c
Expose more util functions to callers when used as a module
eric-mccann-pro Mar 5, 2026
91987cf
Ensure text is always a string before trying to remove newlines
eric-mccann-pro Mar 5, 2026
6cbb8e6
Handle and report content_filter errors when encountered
eric-mccann-pro Mar 5, 2026
a68e118
SUCCESSFULLY make sure there are no newlines in the CSV's text field,…
eric-mccann-pro Mar 5, 2026
67c6256
Reword descriptions of properties that allow continuation after a pos…
eric-mccann-pro Mar 6, 2026
cf5e1e3
Make property names less variable specific
eric-mccann-pro Mar 6, 2026
d9dcd42
Use TEXT if no TRANSCRIPT and no TRANSLATION
eric-mccann-pro Mar 9, 2026
e0e24a6
llmspeechsummarization/Dockerfile: download both qwen and gpt-oss tok…
eric-mccann-pro Mar 12, 2026
c8a95d9
Merge branch 'develop' into feat/qwen-speech-summarization
jrobble Mar 20, 2026
b7d9350
Merge remote-tracking branch 'origin/develop' into feat/qwen-speech-s…
tstrass Mar 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions python/LlmSpeechSummarization/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# syntax=docker/dockerfile:1.2

#############################################################################
# NOTICE #
# #
# This software (or technical data) was produced for the U.S. Government #
# under contract, and is subject to the Rights in Data-General Clause #
# 52.227-14, Alt. IV (DEC 2007). #
# #
# Copyright 2025 The MITRE Corporation. All Rights Reserved. #
#############################################################################

#############################################################################
# Copyright 2025 The MITRE Corporation #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#############################################################################

ARG BUILD_REGISTRY
ARG BUILD_TAG=latest
FROM ${BUILD_REGISTRY}openmpf_python_executor_ssb:${BUILD_TAG}

ARG RUN_TESTS=false
RUN set -x; DEPS="transformers>=4.51.0 accelerate==1.12.0 pydantic==2.12.5 openai==2.16.0 jinja2"; \
if [ "${RUN_TESTS,,}" == true ]; then DEPS="$DEPS pytest"; fi; \
pip3 install --no-cache-dir $DEPS

ARG VLLM_MODEL="Qwen/Qwen3-30B-A3B-Instruct-2507-FP8"
ARG TOKENIZER_MODELS="${VLLM_MODEL} openai/gpt-oss-120b"

RUN --mount=target=.,readwrite \
install-component.sh; \
# make sure the tokenizers are available offline
for tokenizer_model in ${TOKENIZER_MODELS}; do /opt/mpf/plugin-venv/bin/python3 -c "from transformers import AutoTokenizer; AutoTokenizer.from_pretrained(\"${tokenizer_model}\")"; done; \
if [ "${RUN_TESTS,,}" == true ]; then pytest llm_speech_summarization_component; fi

LABEL org.label-schema.license="Apache 2.0" \
org.label-schema.name="OpenMPF LLM Speech Summarization" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://openmpf.github.io" \
org.label-schema.vcs-url="https://github.com/openmpf/openmpf-components" \
org.label-schema.vendor="MITRE"
58 changes: 58 additions & 0 deletions python/LlmSpeechSummarization/Dockerfile.vllm
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#############################################################################
# NOTICE #
# #
# This software (or technical data) was produced for the U.S. Government #
# under contract, and is subject to the Rights in Data-General Clause #
# 52.227-14, Alt. IV (DEC 2007). #
# #
# Copyright 2025 The MITRE Corporation. All Rights Reserved. #
#############################################################################

#############################################################################
# Copyright 2025 The MITRE Corporation #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#############################################################################

FROM ubuntu:20.04 AS download_model

RUN --mount=type=tmpfs,target=/var/cache/apt \
--mount=type=tmpfs,target=/var/lib/apt/lists \
--mount=type=tmpfs,target=/tmp \
apt-get update && apt-get install --no-install-recommends -y curl ca-certificates python3-venv python3-pip python3-certifi python3-urllib3 && \
pip install huggingface_hub[cli]

ARG VLLM_MODEL="Qwen/Qwen3-30B-A3B-Instruct-2507-FP8"
ENV VLLM_MODEL="${VLLM_MODEL}"
RUN HF_HUB_DISABLE_XET=1 hf download ${VLLM_MODEL}


FROM vllm/vllm-openai:v0.15.0
ARG VLLM_MODEL="Qwen/Qwen3-30B-A3B-Instruct-2507-FP8"
ENV VLLM_MODEL="${VLLM_MODEL}"

USER root
RUN mkdir -p /root/.cache
COPY --chown=root:root --from=download_model /root/.cache/huggingface /root/.cache/huggingface

# default value
ENV MAX_MODEL_LEN=45000

COPY --chown=root:root vllm-entrypoint.sh /usr/bin/

ENTRYPOINT ["/usr/bin/vllm-entrypoint.sh"]

CMD [ \
"--host", "0.0.0.0",\
"--port", "11434"\
]
58 changes: 58 additions & 0 deletions python/LlmSpeechSummarization/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Overview

LlmSpeechSummarization component uses a vllm-served LLM model (Qwen3 by default) to summarize FeedForward video tracks' speech detections.

# Details

This folder contains source code for the OpenMPF LLM Speech Summarization Component.

This component requires a base image python3.10+ and an mpf_component_api that supports mpf.AllVideoTracksJob.

We have tested Qwen/Qwen3-30B-A3B-Instruct-2507 on an 80GB card and Qwen/Qwen3-30B-A3B-Instruct-2507-FP8 on a 40GB card. Both seem quite viable.

If you are daring, any openai-compatible API could be substituted for VLLM and any model could replace Qwen3-30B BUT these scenarios are untested
and your mileage may vary.

In either case, the component assumes anonymous access to the openai-api-compatible endpoint that performs the summarization.

# Inputs

- classifiers.json: contains a definition of subjects of interest to score with a low 0-1 confidence if the input DOES NOT include the defined classifier OR high if it does

```json
[
{
"Classifier": "Major League Baseball",
"Definition": "discussions regarding major league baseball teams, professional baseball players, and baseball stadiums",
"Items of Interest": "Baseball fields, baseball teams, baseball players, baseballs, baseball bats, baseball hats"
}
]
```

# Properties

- `CLASSIFIERS_FILE`: when set to an absolute path (with a valid classifiers.json in a volume mounted such that the file is at the specified path), will replace the default classifiers.json
- `CLASSIFIERS_LIST`: Either "ALL", or a comma-separated list of specific names of the "Classifier" fields of defined classifiers
- `PROMPT_TEMPLATE`: if set, will replace the packaged `templates/prompt.jinja` with one read from this location. Must include self-recursive summarization instructions and the jinja templates `{{ classifiers }}` and `{{ input }}`.

# Docker build-args

- `VLLM_MODEL`: if building Dockerfile.vllm for vllm (which downloads the model during docker build), this is the ONLY model that your llm_speech_summarization_component will be able to use.

NOTE: if you have an internet connection at runtime, you may use the image `vllm/vllm-openai:latest` directly in lieu of building Dockerfile.vllm. We do not support this arrangement BUT it is possible with the right command on the docker service.

# Environment variables

- `VLLM_MODEL`: must MATCH the model name being served by vllm OR be available at whichver openai-api-compatible API you choose to talk to.
- `VLLM_URI`: the base_url of the openai-api-compatible API providing access to your model. If your vllm service is named vllm, then this would need to be `http://vllm:11434/v1`.
- `MAX_MODEL_LEN` should be defined on both the llm-speech-summarization container AND the llm-speech-summarization-server (VLLM) container. It is the maximum input+output token count you can use without erroring. We have tried 45000 for the -FP8 model and 120000 for the nonquantized model on a 40GB and 80GB card, respectively.
- `INPUT_TOKEN_CHUNK_SIZE` should be about 20%-30% of your `MAX_MODEL_LEN`, and is the token size that your input will be split into during chunking before making a series of calls to the LLM.
- `INPUT_CHUNK_TOKEN_OVERLAP` should be small and constant. If it is too small, there will be no overlap between chunks, which could negatively impact performance with huge input tracks.

# Outputs

A list of mpf.VideoTracks or mpf.AudioTracks (once supported).

Track[0] will always contain the overall summary of the input, including primary/other topics and entities.

Track[1-n] will be the confidences, reasoning, and name for each of the intersection of enabled classifiers AND classifiers defined in classifiers.json.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#############################################################################
# NOTICE #
# #
# This software (or technical data) was produced for the U.S. Government #
# under contract, and is subject to the Rights in Data-General Clause #
# 52.227-14, Alt. IV (DEC 2007). #
# #
# Copyright 2025 The MITRE Corporation. All Rights Reserved. #
#############################################################################

#############################################################################
# Copyright 2025 The MITRE Corporation #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#############################################################################

from .llm_speech_summarization_component import LlmSpeechSummaryComponent, JobConfig

from .schema import StructuredResponseClassFactory

from .llm_util.classifiers import get_classifier_lines, get_classifier_dict
from .llm_util.slapchop import split_csv_into_chunks, summarize_summaries, BOUNDARY_TOKEN_FOR_COUNTING
from .llm_util.input_cleanup import convert_speech_tracks_to_csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"Classifier": "Major League Baseball",
"Definition": "discussions regarding major league baseball teams, professional baseball players, and baseball stadiums",
"Items of Interest": "Baseball fields, baseball teams, baseball players, baseballs, baseball bats, baseball hats"
}
]
Loading