Skip to content

feat: add MiniCPM5-1B model support#5010

Merged
qinxuye merged 1 commit into
xorbitsai:mainfrom
xiaoyesoso:feat/minicpm5-1b
Jun 11, 2026
Merged

feat: add MiniCPM5-1B model support#5010
qinxuye merged 1 commit into
xorbitsai:mainfrom
xiaoyesoso:feat/minicpm5-1b

Conversation

@xiaoyesoso

Copy link
Copy Markdown
Contributor

Register MiniCPM5-1B model in llm_family.json with pytorch, ggufv2 and mlx formats. Add reasoning/hybrid/tool-call abilities, chat template, and virtualenv dependencies for Transformers/MLX/llama.cpp/vLLM/SGLang engines. Fix xoscar compatibility (wait_for, start_python, daemon process), Gradio UI reasoning content display, and MLX tokenizer loading. Add model documentation.

@XprobeBot XprobeBot added this to the v2.x milestone Jun 9, 2026
@qinxuye

qinxuye commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Thanks, there is conflict, could you resolve it?

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for the MiniCPM5-1B model, adds compatibility shims for older xoscar versions (<= 0.9.6), updates MLX tokenizer handling, and refactors the Gradio chat interface to support hybrid reasoning and prevent state desync. The feedback suggests logging a warning when dropping the 'start_python' parameter on older xoscar versions, safely handling cases where '_eos_token_ids' is a list in MLX tokenizers, and safely accessing response choices in the Gradio interface. Additionally, it is recommended to update the documented abilities of MiniCPM5-1B to include 'reasoning' and 'hybrid' to ensure consistency with its hybrid thinking features.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread xinference/core/worker.py Outdated
Comment thread xinference/model/llm/mlx/core.py Outdated
Comment thread xinference/ui/gradio/chat_interface.py
Comment thread doc/source/models/builtin/llm/minicpm5-1b.rst Outdated
Comment thread doc/source/models/builtin/llm/index.rst Outdated
@qinxuye

qinxuye commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Actually, you only need to modify llm_family.json, doc file changes will be made by bot automatically.

@xiaoyesoso xiaoyesoso force-pushed the feat/minicpm5-1b branch 2 times, most recently from bcdb6b4 to 6e4750e Compare June 9, 2026 09:24
@xiaoyesoso

Copy link
Copy Markdown
Contributor Author

Actually, you only need to modify llm_family.json, doc file changes will be made by bot automatically.

Hi @qinxuye, thanks for the quick review!

I have rebased onto the latest main to resolve the conflict in xinference/core/worker.py , and reverted my manual changes to doc/source/models/builtin/llm/* so that the doc bot can regenerate them automatically.

@qinxuye

qinxuye commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

pre-commit failed, could you fix it accordingly? thanks.

@xiaoyesoso

xiaoyesoso commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

pre-commit failed, could you fix it accordingly? thanks.

Thanks for the patience @qinxuye! I missed running pre-commit run --all-files last time and only ran it on the changed files, so mypy errors slipped through. Just fixed them in chat_interface.py (renamed the reused choices variable and properly narrowed the message type for mypy) and verified pre-commit run --all-files passes locally — all hooks (black / flake8 / isort / mypy / codespell) are green now. PTAL 🙏

Comment thread xinference/__init__.py Outdated
Comment thread xinference/__init__.py Outdated
Register MiniCPM5-1B model in llm_family.json with pytorch, ggufv2 and
mlx formats. Add reasoning/hybrid/tool-call abilities, chat template,
and virtualenv dependencies for Transformers/MLX/llama.cpp/vLLM/SGLang
engines. Also add Gradio UI changes to surface reasoning_content in
the chat bubble and MLX tokenizer eos_token_ids type guard for
transformers 5.x compatibility.

@qinxuye qinxuye left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qinxuye qinxuye merged commit 25ffc8c into xorbitsai:main Jun 11, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants