MiniCPM-o-4_5 · FP8 (dynamic)
8-bit quantization of openbmb/MiniCPM-o-4_5 for vLLM serving. Quantized by axteam.
Revision 2026-11-01 (FP8 rebuild): the first upload also quantized the LM head (
llm.lm_head) and the audio projector (audio_projection_layer) to FP8, and vLLM 0.32 could not load it (no parameteraudio_projection_layer.linear1.weight_scale). This rebuild keeps both in BF16; on 2026-11-01 it was checked with vLLM 0.32.0 on text input — it loads and answers short prompts the same way as the BF16 original (image input was checked later, on 2026-11-02; see Requirements). If you downloaded this repo before 2026-11-01 10:43:00 UTC (revision8efe6eb), download it again.
| Base model | openbmb/MiniCPM-o-4_5 |
| Method | FP8 (dynamic) |
| Format | compressed-tensors float-quantized (scheme FP8_DYNAMIC) |
| Weights / activations | W8A8 — FP8 E4M3 weights (per-channel), dynamic per-token FP8 activations |
| Architecture | Omni (vision + audio + TTS) · multimodal |
| Size on disk | ~11.8 GB |
| Calibration | None (data-free) |
| License | Apache-2.0 |
Quantization details
- Scheme — W8A8 — FP8 E4M3 weights (per-channel), dynamic per-token FP8 activations, stored as compressed-tensors
float-quantized(schemeFP8_DYNAMIC). - Kept in BF16 — the vision encoder, the audio (whisper) encoder, the audio projector (
audio_projection_layer), the TTS modules, token embeddings, the LM head (llm.lm_head) and all RMSNorms (about 26% of all parameters in this build). FP8: the language-model attention & MLP projections. - Post-training quantization (no retraining). Tokenizer /
chat_templateidentical to the original.
Benchmarks (measured)
Every column was measured with the same harness and settings — lm-evaluation-harness on vLLM, greedy, completion-style prompts without a chat template (0- or 5-shot, as listed in each row). MMLU here is lm-eval's generative variant (mmlu_generative: the model writes the answer letter and only an exact match on the first line counts), so it is not directly comparable with MMLU scores measured another way (e.g. log-likelihood scoring). Percentages are recovery vs. the BF16 original.
| Benchmark | BF16 (original) | FP8-dynamic (this repo) |
|---|---|---|
| MMLU (5-shot, generative) | 74.06 | 74.06 (100.0%) |
| GSM8K (5-shot, strict) | 81.73 | 82.49 (100.9%) |
| ARC-Challenge (0-shot) | 56.74 | 56.83 (100.2%) |
| Winogrande (5-shot) | 76.80 | 75.14 (97.8%) |
| KMMLU (5-shot, direct) | 30.25 | 30.57 (101.1%) |
| HAE-RAE (0-shot) | 22.18 | 22.82 (102.9%) |
| Average | 56.96 | 56.98 (100.0%) |
Requirements
| Runtime | vLLM — the architecture is in vLLM; tested here with vLLM 0.32.0 (text input: short-prompt generation check on 2026-11-01; image input: image-description check on 2026-11-02; audio input not run). |
| vLLM install | vLLM 0.32 itself needs Python 3.11–3.14, torch 2.13 (CUDA 13.0 build, so an NVIDIA driver with CUDA 13 support), transformers ≥5.16.1,<5.20 and compressed-tensors 0.17.0 (both pinned by vLLM; 0.17.0 reads this checkpoint, which was saved with 0.19.0 — do not upgrade it separately). |
| GPU | NVIDIA Turing (sm75, e.g. T4) or newer. FP8 math runs on Ada / Hopper / Blackwell (sm89+); on Turing and Ampere vLLM switches to weight-only FP8 automatically. V100 (sm70) is not supported. (Kernel choice per GPU from vLLM 0.32's selection code; only B200 was run here.) |
| Memory | Weights: 11.8 GB. Add KV cache (grows with context length × concurrent requests) and a few GB for activations / CUDA graphs; use --tensor-parallel-size N when the weights do not fit one GPU. |
| Transformers (without vLLM) | No verified Transformers setup: the upstream code pins transformers==4.51.0, which cannot read compressed-tensors checkpoints (that needs ≥4.56). |
| trust_remote_code | required (the repo ships its own code) |
Usage (vLLM)
Start an OpenAI-compatible server:
vllm serve axteam/MiniCPM-o-4_5-FP8-dynamic --max-model-len 32768 --trust-remote-code
Query it:
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "axteam/MiniCPM-o-4_5-FP8-dynamic",
"messages": [{"role": "user", "content": "대한민국의 수도는 어디인가요?"}],
"temperature": 0.6, "top_p": 0.95, "top_k": 20, "max_tokens": 512
}'
Offline inference in Python:
from vllm import LLM, SamplingParams
llm = LLM(model="axteam/MiniCPM-o-4_5-FP8-dynamic", max_model_len=32768, trust_remote_code=True)
params = SamplingParams(temperature=0.6, top_p=0.95, top_k=20, max_tokens=1024)
out = llm.chat([{"role": "user", "content": "Explain model quantization in two sentences."}], params)
print(out[0].outputs[0].text)
# image input (URL or data: URI)
messages = [{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": "https://example.com/your-image.png"}},
{"type": "text", "text": "Describe this image."},
]}]
out = llm.chat(messages, params)
print(out[0].outputs[0].text)
Recommended sampling (from the original
generation_config.json):temperature=0.6,top_p=0.95,top_k=20. Thinking mode is on by default in the chat template; to turn it off passchat_template_kwargs={"enable_thinking": False}(Pythonllm.chat(..., chat_template_kwargs=...), or"chat_template_kwargs": {"enable_thinking": false}in the request body). Text-only serving: add--limit-mm-per-prompt '{"image": 0, "video": 0}'to skip loading the vision encoder's memory budget.
Reducing KV-cache memory (optional, serve-time)
The KV cache is kept in BF16 by default. KV-cache precision is a runtime choice, independent of the weight quantization above; for long contexts or large batches FP8 roughly halves KV-cache memory:
vllm serve axteam/MiniCPM-o-4_5-FP8-dynamic --kv-cache-dtype fp8 --trust-remote-code
License
Quantized derivative of openbmb/MiniCPM-o-4_5 (Apache-2.0). Original weights & tokenizer belong to OpenBMB.
한국어 요약
openbmb/MiniCPM-o-4_5의 FP8 (W8A8) 양자화 빌드 · 제작 axteam
개요
| 항목 | 내용 |
|---|---|
| 원본 모델 | openbmb/MiniCPM-o-4_5 |
| 양자화 방식 | FP8 동적 양자화 (W8A8) |
| 저장 형식 | compressed-tensors float-quantized (scheme FP8_DYNAMIC) |
| 모델 구조 | 옴니 모델 (비전 + 오디오 + TTS) · 멀티모달 |
| 용량 | 약 11.8 GB |
| 보정 데이터 | 없음 (가중치 스케일은 가중치만으로 계산, 활성화 스케일은 실행 시 계산) |
양자화 상세
- 가중치: FP8(E4M3), 출력 채널별 스케일
- 활성화: 실행 시 토큰별 동적 FP8
- 양자화 절차: PTQ(학습 후 양자화, 재학습 없음), 가중치 스케일은 미리 계산하고 활성화 스케일은 실행 시 토큰마다 계산
- BF16 유지: 비전 타워, 오디오 인코더(whisper), 오디오 투영층(
audio_projection_layer), TTS 모듈, 토큰 임베딩, LM 헤드(llm.lm_head), 모든 RMSNorm — 전체 파라미터의 약 26% - 양자화 대상: 언어모델 어텐션·MLP 선형층(projection)
- 원본 파일: 토크나이저·chat template은 원본과 동일
품질 (실측)
- 벤치마크 평균: 56.98 (원본 56.96, 100.0%) — MMLU(생성형)·GSM8K·ARC-Challenge·Winogrande·KMMLU·HAE-RAE 6종 평균, lm-evaluation-harness + vLLM, chat template 없는 완성형 프롬프트(과제별 0·5-shot, 표 참고)·greedy, 모든 빌드를 같은 설정으로 측정
- 한국어 벤치마크: KMMLU 30.57 (원본 30.25, 101.1%) · HAE-RAE 22.82 (원본 22.18, 102.9%)
- MMLU 방식: lm-eval 생성형 변형(
mmlu_generative) — 모델이 답 글자를 생성하고 첫 줄이 정확히 일치해야 정답으로 채점하므로, 다른 방식(예: log-likelihood 채점)으로 잰 MMLU 점수와 직접 비교 불가
요구사항
- 실행 엔진: vLLM, 이 빌드는 vLLM 0.32.0에서 실행 확인 (텍스트 입력 — 2026-11-01 짧은 질문 생성 점검, 이미지 입력 — 2026-11-02 그림 설명 점검, 오디오 입력은 실행 미확인)
- vLLM 0.32 설치 조건: Python 3.11~3.14, torch 2.13(CUDA 13.0 빌드, CUDA 13 지원 드라이버 필요), transformers 5.16.1 이상 5.20 미만, compressed-tensors 0.17.0 — transformers·compressed-tensors는 vLLM이 버전을 고정하므로 compressed-tensors를 따로 업그레이드하지 말 것 (이 체크포인트는 0.19.0으로 저장됐지만 0.17.0에서도 로드됨)
- GPU: NVIDIA Turing(sm75, 예: T4) 이상, V100(sm70) 미지원 — FP8 연산은 Ada·Hopper·Blackwell(sm89 이상)에서 수행, Turing·Ampere는 vLLM이 가중치 전용 FP8로 자동 전환 (GPU별 지원 여부는 vLLM 0.32 커널 선택 코드 기준, 실제 실행은 B200에서만 확인)
- 메모리: 가중치 11.8 GB + KV 캐시(컨텍스트 길이 × 동시 요청 수에 비례) + 활성화·CUDA graph용 수 GB — GPU 한 장에 다 들어가지 않으면
--tensor-parallel-size N으로 분산 - Transformers로 직접 사용: 검증된 조합 없음 — 원본 코드는 transformers 4.51.0 고정인데, compressed-tensors 체크포인트는 4.56 이상이 필요
- trust_remote_code: 필요 (리포에 자체 코드 포함)
사용법
- 서버 실행:
vllm serve axteam/MiniCPM-o-4_5-FP8-dynamic --max-model-len 32768 --trust-remote-code— OpenAI 호환 API - Python:
LLM(model="axteam/MiniCPM-o-4_5-FP8-dynamic", max_model_len=32768, trust_remote_code=True).chat(...)— 전체 예시는 위 영어 본문 'Usage (vLLM)' 절 참고 - 권장 샘플링:
temperature=0.6,top_p=0.95,top_k=20(원본generation_config.json기준) - thinking 모드: 기본 켜짐 — 끄려면
chat_template_kwargs={"enable_thinking": False}전달(Python은llm.chat()인자, HTTP는 요청 본문의"chat_template_kwargs": {"enable_thinking": false}) - 이미지 입력: 메시지에
image_url항목 사용 - 텍스트만 사용할 때:
--limit-mm-per-prompt '{"image": 0, "video": 0}'— 비전 타워용 메모리 예약을 생략해 메모리 절약 - KV 캐시 절감(선택):
vllm serve에--kv-cache-dtype fp8추가 — 기본 BF16인 KV 캐시를 FP8로 저장해 KV 캐시 메모리를 약 절반으로 줄임 (긴 컨텍스트·동시 요청이 많을 때 유리, 가중치 양자화와 별개인 실행 옵션)
참고
- 수정 이력 (2026-11-01, 재양자화): 처음 올린 빌드는 LM 헤드(
llm.lm_head)와 오디오 투영층(audio_projection_layer)까지 FP8로 바꿔 vLLM 0.32에서 로드되지 않았음(audio_projection_layer.linear1.weight_scale를 모름) — 두 층을 BF16으로 두고 다시 양자화, 2026-11-01 vLLM 0.32.0에서 텍스트 입력으로 로드와 짧은 질문 생성을 확인(원본 BF16과 같은 답), 이미지 입력은 2026-11-02에 따로 확인 — 2026-11-01 10:43:00 UTC(리비전8efe6eb) 이전에 받았다면 다시 받을 것
라이선스
- 라이선스: Apache-2.0 — 원본 모델의 라이선스를 그대로 따름
- 권리: 원본 가중치·토크나이저는 OpenBMB 소유, 이 리포는 양자화 파생물