MiniCPM5-2B

MiniCPM5-2B

MiniCPM5-2B는 OpenBMB MiniCPM5 시리즈의 두 번째 모델로, MiniCPM5-1B에 이어 나온 밀집 2B급 Transformer예요. 온디바이스 어시스턴트, 로컬 배포, 코딩 에이전트, 도구 사용 워크플로우 — 즉 컴팩트한 모델과 작은 배포 풋프린트가 선호되는 시나리오를 위해 만들어졌어요. 131K 컨텍스트, thinking 모드, XML 도구 호출, DSpark 추측 디코딩을 지원해요.

출처: 문서

본문

Deployment

모든 방법과 하드웨어 플랫폼에 대해서는 [공식 SGLang 설치 가이드](../../../docs/get-started/install)를 참고하세요. 아래 두 경로는 명령 패널의 **Python / Docker** 토글과 일치해요. ```bash pip install --upgrade pip pip install uv uv pip install --prerelease=allow "sglang>=0.5.12" ```
  그런 다음 해당 환경에서 아래 명령 패널의 **Python** 출력을 실행하세요.
</Tab>

<Tab title="Docker">
  ```bash
  docker pull lmsysorg/sglang:dev
  ```

  이미지 실행 방법은 [Install → Method 3: Using Docker](../../../docs/get-started/install#method-3-using-docker)를 참고하세요. 안쪽의 `sglang serve ...`를 아래 명령 생성기가 만들어 내는 것으로 대체하세요.
</Tab>

카드를 선택해 실행 명령을 생성하세요. MiniCPM5-2B는 2.5B 밀집 모델로, 지원되는 모든 카드에서 TP=1 단일 GPU로 실행되므로 페이지는 카드당 하나의 동작 포인트와 선택적인 DSpark 추측 디코딩 행을 제공해요.

속도 수치는 RTX 5090과 DGX Spark 셀에만 존재해요 — 임의 1024/1024에서 단일 카드, Mean으로 기록됨. H200과 RTX PRO 6000 셀은 측정 대기 중이며, 어떤 플랫폼에서도 정확도 수치는 아직 측정되지 않았어요. DSpark 오버레이는 어떤 카드에서도 속도 수치를 담지 않아요.

Playground

Playground는 위 레시피를 넘어 SGLang 기능을 실험하는 곳이에요. Deploy 패널은 이 모델의 문서화된 실행 레시피를 생성하며, Playground는 Deploy 패널이 현재 표시 중인 셀 위에 추가 노브를 켤 수 있게 해 줘요.

1. Model Introduction

MiniCPM5-2B는 MiniCPM5-1B에 이어 OpenBMB MiniCPM5 시리즈의 두 번째 모델이에요. 온디바이스 어시스턴트, 로컬 배포, 코딩 에이전트, 도구 사용 워크플로우 — 컴팩트한 모델과 작은 배포 풋프린트가 선호되는 시나리오를 위해 만들어진 밀집 2B급 Transformer예요. OpenBMB는 비교 세트 내에서 2B급 오픈소스 SOTA(평균 53.9)를 보고하며, 코드 추론, 수학 추론, 긴 컨텍스트 이해, 도구 사용, 에이전틱 작업에서 가장 뚜렷한 장점을 보여요.

체크포인트는 표준 LlamaForCausalLM 아키텍처를 사용해요 — 커스텀 커널도 모델 코드 포크도 없으므로 SGLang이 일반 Llama 경로로 로드해요. GQA(16 query heads, 2 KV heads)를 갖춘 42개 레이어에 걸쳐 2,516,756,480 파라미터(비임베딩 1,981,982,720), 네이티브 컨텍스트 길이 131,072 토큰이에요. 포스트 트레이닝은 SFT → RL → On-Policy Distillation 순서로 실행되며, 16개의 RL 전문가 모델을 단일 릴리스 체크포인트로 병합해요. 가중치는 Apache-2.0 라이선스로 공개됩니다.

Checkpoint Precision Role on this page
openbmb/MiniCPM5-2B BF16 The served model in every cell above (final release, post-trained with RL + OPD).
openbmb/MiniCPM5-2B-DSpark BF16 draft Draft model loaded by the DSPARK row of the Deploy panel; not served on its own.

OpenBMB는 SFT 전용, 중간 트레이닝, base 체크포인트와 함께 llama.cpp / Ollama / LM Studio / Apple Silicon용 GGUF, MLX, GPTQ-Int4 내보내기도 공개해요. 그것들은 다른 런타임을 대상으로 하며 위 SGLang 매트릭스에 포함되지 않아요.

권장 생성 설정: temperature=1.0, top_p=0.95(정보 제공용 — SGLang은 체크포인트의 generation_config.json을 읽으므로 클라이언트 코드에서 하드코딩하지 마세요).

리소스: HuggingFace · ModelScope · GitHub · Tech report.

2. Advanced Usage

2.1 Thinking Mode

Thinking은 채팅 템플릿의 enable_thinking 플래그로 제어되며, 요청마다 chat_template_kwargs를 통해 전달돼요. 생성된 모든 명령에 들어 있고 위 PlaygroundParsers 카드에서 토글할 수 있는 qwen3 reasoning 파서는 thinking 세그먼트를 message.reasoning_content로 분리하고 최종 답은 message.content에 남겨요. 플래그를 빼면 thinking 텍스트가 closing tag까지 포함해 content에 인라인으로 유지돼요.

```python from openai import OpenAI

client = OpenAI(base_url="http://localhost:30000/v1", api_key="EMPTY")

Thinking on (chat-template default).

resp = client.chat.completions.create( model="openbmb/MiniCPM5-2B", messages=[{"role": "user", "content": "What is 15% of 240?"}], extra_body={"chat_template_kwargs": {"enable_thinking": True}}, ) msg = resp.choices[0].message print("Reasoning:", getattr(msg, "reasoning_content", None)) print("Answer:", msg.content)

Thinking off — a direct answer, no deliberation segment.

resp = client.chat.completions.create( model="openbmb/MiniCPM5-2B", messages=[{"role": "user", "content": "What is 15% of 240?"}], extra_body={"chat_template_kwargs": {"enable_thinking": False}}, ) print("Without thinking:", resp.choices[0].message.content)

</Accordion>

<Accordion title="Example Output">
```text
Reasoning: We are asked: "What is 15% of 240?" This is a simple percentage calculation. To find 15% of 240, we multiply 240 by 15% (which is 0.15). So: 240 × 0.15 = 36. Alternatively, we can think of it as (15/100) × 240 = (15 × 240)/100 = 3600/100 = 36. So the answer is 36.

We need to respond in a helpful way. The user might be testing or seeking quick answer. Let's provide a clear response with explanation if needed, but since it's straightforward, we can just give the answer directly or briefly explain.

Answer:

15% of 240 is **36**.

To calculate:
\( 240 \times 0.15 = 36 \)
Reasoning: None
Answer: To find 15% of 240, multiply 240 by 15% (which is 0.15):

\[
240 \times 0.15 = 36
\]

So, 15% of 240 is **36**.

2.2 Tool Calling

MiniCPM5-2B는 XML 스타일 도구 호출(<function name="..."><param name="...">...</param></function>)을 생성하고, SGLang의 내장 minicpm5 감지기가 이를 병렬 호출을 포함해 OpenAI 호환 tool_calls로 변환해요. 파서는 Deploy 패널이 생성하는 모든 명령에 이미 들어 있고, Playground의 Parsers 카드에 있는 Tool Call Parser 칩은 opt-in이 아니라 opt-out이에요.

```python from openai import OpenAI

client = OpenAI(base_url="http://localhost:30000/v1", api_key="EMPTY")

tools = [{ "type": "function", "function": { "name": "get_weather", "description": "Get the current weather for a city.", "parameters": { "type": "object", "properties": { "city": {"type": "string", "description": "City name"}, "date": {"type": "string", "description": "YYYY-MM-DD"}, }, "required": ["city"], }, }, }]

resp = client.chat.completions.create( model="openbmb/MiniCPM5-2B", messages=[{"role": "user", "content": "What is the weather in Beijing today?"}], tools=tools, )

msg = resp.choices[0].message

With the qwen3 reasoning parser on, the thinking segment lands in

reasoning_content and content may be empty on a tool-call turn.

print("Reasoning:", getattr(msg, "reasoning_content", None)) print("Content:", msg.content) for call in (msg.tool_calls or []): print("Tool:", call.function.name, call.function.arguments)

</Accordion>

<Accordion title="Example Output">
```text
Reasoning:
The user is asking about the weather in Beijing today. I have access to a get_weather function that can help with this. Let me call it to get the current weather for Beijing.

Content:


Tool: get_weather {"city": "Beijing"}

더 알아보기