[codex] Register Moondream2 inference-models adapter#2422
Closed
hansent wants to merge 3 commits into
Closed
Conversation
hansent
commented
Jun 9, 2026
| self.api_key = api_key if api_key else API_KEY | ||
|
|
||
| self.task_type = "llm" | ||
| self.task_type = "lmm" |
Collaborator
Author
There was a problem hiding this comment.
not sure about this one
Collaborator
There was a problem hiding this comment.
I believe this is not needed
hansent
commented
Jun 9, 2026
| InferenceModelsMoondream2Adapter, | ||
| ) | ||
|
|
||
| ROBOFLOW_MODEL_TYPES[("lmm", "moondream2")] = InferenceModelsMoondream2Adapter |
Collaborator
Author
There was a problem hiding this comment.
old registry and auth endpoint has it under lmm, new registry says vlm
PawelPeczek-Roboflow
left a comment
Collaborator
There was a problem hiding this comment.
how about inference/models/utils.py line 925
elif task == "lmm" and variant == "moondream2":
from inference.models.moondream2.moondream2_inference_models import (
InferenceModelsMoondream2Adapter,
)
ROBOFLOW_MODEL_TYPES[(task, variant)] = InferenceModelsMoondream2Adapter
ROBOFLOW_MODEL_TYPES[("vlm", "moondream2")] = (
InferenceModelsMoondream2Adapter
)
are you sure your change is different than that?
Collaborator
Author
|
fixed as part of new auth endpoint change |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Moondream2 registration when the server is running with
USE_INFERENCE_MODELS=True.The direct
/infer/lmmpath resolves Moondream2 generic IDs to("lmm", "moondream2"), while the newinference-modelsregistry exposes Moondream2 as a VLM model. Previously, the adapter swap only ran if an existing("lmm", "moondream2")entry survived legacy registration, so deployments using the inference-models stack could hitModelNotRecognisedErrorfor('lmm', 'moondream2').Changes
InferenceModelsMoondream2Adapterfor both("lmm", "moondream2")and("vlm", "moondream2")whenMOONDREAM2_ENABLEDandUSE_INFERENCE_MODELSare enabled.task_typetolmm, matching the other VLM-backed direct LMM adapters in core inference.Validation
python -m py_compile inference/models/utils.py inference/models/moondream2/moondream2_inference_models.py tests/inference/unit_tests/models/test_moondream2_registration.pyPYTHONPATH=.:inference_models uv run --no-project --with pytest --with requests --with python-dotenv --with pillow --with numpy --with pydantic --with fastapi --with opencv-python-headless --with pycocotools python -m pytest tests/inference/unit_tests/models/test_moondream2_registration.py -qPYTHONPATH=.:inference_models uv run --no-project --with black python -m black --check inference/models/utils.py inference/models/moondream2/moondream2_inference_models.py tests/inference/unit_tests/models/test_moondream2_registration.py