microsoft / microsoft/winml-cli
internlm2 + phi4mm / visual-question-answering: all models pass wmk perf
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40
- Forks
- 11
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 50
Description
Summary
internlm/internlm-xcomposer2d5-7b and microsoft/Phi-4-multimodal-instruct fail because they contain custom model code that requires trust_remote_code=True. ModelKit does not currently pass this flag when loading these models.
Eval Results (2026-03-11)
| Status | Model | model_type | Task | Error |
|---|---|---|---|---|
| FAIL | internlm/internlm-xcomposer2d5-7b | internlm2 | visual-question-answering | The repository contains custom code which must be executed to correctly load the model. You can inspect the repository content at https://hf.co/internlm/internlm-xcomposer2d5-7b. Please pass the argument trust_remote_code=True to allow custom code to be executed. |
| FAIL | microsoft/Phi-4-multimodal-instruct | phi4mm | visual-question-answering | same |
2/2 models fail — both require trust_remote_code=True.
Root Cause
Both models define custom Python code in their HuggingFace repository (custom modeling files, processors, etc.) that must be executed to load the model. HuggingFace requires trust_remote_code=True as an explicit opt-in for security reasons. ModelKit currently does not expose or pass this flag.
Current State
modelkit/loader/config.py:21-109—WinMLLoaderConfighas atrust_remote_codefield but it may default toFalseor not be passed through to the HF loadermodelkit/loader/hf.py— HF model loading; check iftrust_remote_codeis forwardedwmk perfCLI — no--trust-remote-codeflag exposed
Desired State
Both models pass wmk perf when run with trust_remote_code=True.
Acceptance Criteria
-
wmk perf -m internlm/internlm-xcomposer2d5-7b --trust-remote-codepasses -
wmk perf -m microsoft/Phi-4-multimodal-instruct --trust-remote-codepasses -
--trust-remote-codeflag exposed inwmk perfandwmk buildCLI commands -
trust_remote_codeproperly propagated throughWinMLLoaderConfig→ HF loader - Fix is universal — applies to any model requiring trust_remote_code (CLAUDE.md Cardinal Rule #1)
-
uv run pytest tests/passes (CLAUDE.md Cardinal Rule #3)
Technical Notes
WinMLLoaderConfig.trust_remote_codeexists (modelkit/loader/config.py) — verify it is forwarded toAutoModel.from_pretrained(trust_remote_code=...)inmodelkit/loader/hf.py- Add
--trust-remote-code/-Tflag towmk perfandwmk buildCLI commands - Security note: this flag should never be set by default — always explicit opt-in
- Note: even with
trust_remote_code=True, these are large multimodal LLMs (7B params) — may also hit ONNX size limits or timeout. Address trust_remote_code first, then size/timeout separately if needed.
Related Files
modelkit/loader/config.py:21-109—WinMLLoaderConfigwithtrust_remote_codefieldmodelkit/loader/hf.py— HF model loading;AutoModel.from_pretrained()callmodelkit/commands/perf.py— CLI command (needs--trust-remote-codeoption)modelkit/commands/build.py— CLI command (needs--trust-remote-codeoption)eval_results/2026-03-11/models/microsoft__Phi-4-multimodal-instruct__visual-question-answering/result.json
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review modelkit/loader/config.py, modelkit/loader/hf.py, and the CLI entry points in modelkit/commands/perf.py and build.py. Trace how WinMLLoaderConfig reaches the HuggingFace loading call, then run the stated model commands and relevant tests; done means explicit --trust-remote-code support works for both commands without enabling it by default and the test suite passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100