Image-Text-to-Text
Transformers
Safetensors
English
minicpmo
feature-extraction
minicpm
omni
multimodal
audio
vision
tts
quantized
int4
INT4
w4a16
4-bit precision
compressed-tensors
vllm
text-generation
conversational
ptq
AutoRound (blocked — see KNOWN-FAILURES)
llmcompressor
sglang
88plug
post-training-quantization
vlm
image
custom_code
Instructions to use 88plug/MiniCPM-o-4.5-W4A16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 88plug/MiniCPM-o-4.5-W4A16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="88plug/MiniCPM-o-4.5-W4A16", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("88plug/MiniCPM-o-4.5-W4A16", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use 88plug/MiniCPM-o-4.5-W4A16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "88plug/MiniCPM-o-4.5-W4A16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "88plug/MiniCPM-o-4.5-W4A16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/88plug/MiniCPM-o-4.5-W4A16
- SGLang
How to use 88plug/MiniCPM-o-4.5-W4A16 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "88plug/MiniCPM-o-4.5-W4A16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "88plug/MiniCPM-o-4.5-W4A16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "88plug/MiniCPM-o-4.5-W4A16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "88plug/MiniCPM-o-4.5-W4A16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use 88plug/MiniCPM-o-4.5-W4A16 with Docker Model Runner:
docker model run hf.co/88plug/MiniCPM-o-4.5-W4A16
| { | |
| "architectures": [ | |
| "MiniCPMO" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "audio_chunk_length": 1.0, | |
| "audio_config": { | |
| "_attn_implementation_autoset": true, | |
| "_name_or_path": "openai/whisper-medium", | |
| "activation_dropout": 0.0, | |
| "activation_function": "gelu", | |
| "apply_spec_augment": false, | |
| "architectures": [ | |
| "MiniCPMWhisperEncoder" | |
| ], | |
| "attention_dropout": 0.0, | |
| "begin_suppress_tokens": [ | |
| 220, | |
| 50257 | |
| ], | |
| "bos_token_id": 50257, | |
| "classifier_proj_size": 256, | |
| "d_model": 1024, | |
| "decoder_attention_heads": 16, | |
| "decoder_ffn_dim": 4096, | |
| "decoder_layerdrop": 0.0, | |
| "decoder_layers": 24, | |
| "decoder_start_token_id": 50258, | |
| "dropout": 0.0, | |
| "dtype": "float32", | |
| "encoder_attention_heads": 16, | |
| "encoder_ffn_dim": 4096, | |
| "encoder_layerdrop": 0.0, | |
| "encoder_layers": 24, | |
| "eos_token_id": 50257, | |
| "forced_decoder_ids": [ | |
| [ | |
| 1, | |
| 50259 | |
| ], | |
| [ | |
| 2, | |
| 50359 | |
| ], | |
| [ | |
| 3, | |
| 50363 | |
| ] | |
| ], | |
| "init_std": 0.02, | |
| "mask_feature_length": 10, | |
| "mask_feature_min_masks": 0, | |
| "mask_feature_prob": 0.0, | |
| "mask_time_length": 10, | |
| "mask_time_min_masks": 2, | |
| "mask_time_prob": 0.05, | |
| "max_source_positions": 1500, | |
| "max_target_positions": 448, | |
| "median_filter_width": 7, | |
| "model_type": "whisper", | |
| "num_mel_bins": 80, | |
| "pad_token_id": 50257, | |
| "scale_embedding": false, | |
| "suppress_tokens": [ | |
| 1, | |
| 2, | |
| 7, | |
| 8, | |
| 9, | |
| 10, | |
| 14, | |
| 25, | |
| 26, | |
| 27, | |
| 28, | |
| 29, | |
| 31, | |
| 58, | |
| 59, | |
| 60, | |
| 61, | |
| 62, | |
| 63, | |
| 90, | |
| 91, | |
| 92, | |
| 93, | |
| 359, | |
| 503, | |
| 522, | |
| 542, | |
| 873, | |
| 893, | |
| 902, | |
| 918, | |
| 922, | |
| 931, | |
| 1350, | |
| 1853, | |
| 1982, | |
| 2460, | |
| 2627, | |
| 3246, | |
| 3253, | |
| 3268, | |
| 3536, | |
| 3846, | |
| 3961, | |
| 4183, | |
| 4667, | |
| 6585, | |
| 6647, | |
| 7273, | |
| 9061, | |
| 9383, | |
| 10428, | |
| 10929, | |
| 11938, | |
| 12033, | |
| 12331, | |
| 12562, | |
| 13793, | |
| 14157, | |
| 14635, | |
| 15265, | |
| 15618, | |
| 16553, | |
| 16604, | |
| 18362, | |
| 18956, | |
| 20075, | |
| 21675, | |
| 22520, | |
| 26130, | |
| 26161, | |
| 26435, | |
| 28279, | |
| 29464, | |
| 31650, | |
| 32302, | |
| 32470, | |
| 36865, | |
| 42863, | |
| 47425, | |
| 49870, | |
| 50254, | |
| 50258, | |
| 50358, | |
| 50359, | |
| 50360, | |
| 50361, | |
| 50362 | |
| ], | |
| "tie_word_embeddings": true, | |
| "use_cache": true, | |
| "use_weighted_layer_sum": false, | |
| "vocab_size": 51865 | |
| }, | |
| "audio_pool_step": 5, | |
| "auto_map": { | |
| "AutoConfig": "configuration_minicpmo.MiniCPMOConfig", | |
| "AutoModel": "modeling_minicpmo.MiniCPMO", | |
| "AutoModelForCausalLM": "modeling_minicpmo.MiniCPMO" | |
| }, | |
| "batch_vision_input": true, | |
| "bos_token_id": 151643, | |
| "drop_vision_last_layer": false, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 151645, | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "hidden_size": 4096, | |
| "image_size": 448, | |
| "init_audio": true, | |
| "init_tts": true, | |
| "init_vision": true, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 12288, | |
| "layer_types": [ | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention" | |
| ], | |
| "listen_speak_type": "asr", | |
| "max_position_embeddings": 40960, | |
| "max_window_layers": 36, | |
| "model_type": "minicpmo", | |
| "num_attention_heads": 32, | |
| "num_hidden_layers": 36, | |
| "num_key_value_heads": 8, | |
| "pad_token_id": null, | |
| "patch_size": 14, | |
| "query_num": 64, | |
| "rms_norm_eps": 1e-06, | |
| "rope_parameters": { | |
| "rope_theta": 1000000, | |
| "rope_type": "default" | |
| }, | |
| "slice_config": { | |
| "max_slice_nums": 1, | |
| "model_type": "minicpmv", | |
| "patch_size": 14, | |
| "scale_resolution": 448 | |
| }, | |
| "slice_mode": true, | |
| "sliding_window": null, | |
| "stream_input": true, | |
| "tie_word_embeddings": false, | |
| "transformers_version": "5.12.1", | |
| "tts_config": { | |
| "_attn_implementation_autoset": true, | |
| "attention_type": "full_attention", | |
| "attn_implementation": "eager", | |
| "audio_bos_token_id": 151687, | |
| "audio_tokenizer_sample_rate": 16000, | |
| "audio_tokenizer_type": "s3tokenizer", | |
| "aug_layer_loss_weight": false, | |
| "aug_loss_weight": false, | |
| "backbone_model": "llama", | |
| "condition_type": "hidden_text_merge", | |
| "cosyvoice_config_path": null, | |
| "cosyvoice_model_dir": null, | |
| "filter_tts_loss": false, | |
| "hidden_act": "silu", | |
| "hidden_size": 768, | |
| "interleaved": false, | |
| "intermediate_size": 3072, | |
| "llm_dim": 4096, | |
| "llm_dim_model_base": 256, | |
| "llm_down_scale": false, | |
| "llm_hidden_size": 4096, | |
| "llm_intermediate_size": 768, | |
| "long_weight": 0.1, | |
| "max_position_embeddings": 4096, | |
| "model_type": "minicpmtts", | |
| "normalize_projected_hidden": true, | |
| "num_attention_heads": 12, | |
| "num_audio_tokens": 6562, | |
| "num_hidden_layers": 20, | |
| "num_key_value_heads": 12, | |
| "num_mel_bins": 100, | |
| "num_text_tokens": 152064, | |
| "num_vq": 1, | |
| "projector_type": "mlp", | |
| "recomputed_chunks": 1, | |
| "s3_stream_chunk_size": 25, | |
| "s3_stream_generate": false, | |
| "s3_stream_n_timesteps": 10, | |
| "s3_stream_prelook_size": 3, | |
| "short_weight": 0.1, | |
| "streaming": false, | |
| "streaming_audio_chunk_size": 50, | |
| "streaming_sliding_window": false, | |
| "streaming_sliding_window_audio_frame_rate": 50, | |
| "streaming_sliding_window_audio_init_text_length": 10, | |
| "streaming_sliding_window_audio_window_size": 300, | |
| "streaming_sliding_window_average_speed": 5, | |
| "streaming_sliding_window_fast_speed": 7, | |
| "streaming_sliding_window_max_text_len": 500, | |
| "streaming_sliding_window_slow_speed": 3, | |
| "streaming_sliding_window_text_window_size": 50, | |
| "streaming_text_chunk_max": 7, | |
| "streaming_text_chunk_min": 3, | |
| "streaming_text_reserved_len": 300, | |
| "text_eos_token_id": 151692, | |
| "tts_filter_loss_fix": false, | |
| "use_llm_hidden_state": false, | |
| "use_text": true, | |
| "window_size": 2 | |
| }, | |
| "use_cache": true, | |
| "use_image_id": true, | |
| "use_sliding_window": false, | |
| "version": "4.5", | |
| "vision_batch_size": 16, | |
| "vision_config": { | |
| "_attn_implementation_autoset": true, | |
| "attention_dropout": 0.0, | |
| "hidden_act": "gelu_pytorch_tanh", | |
| "hidden_size": 1152, | |
| "image_size": 980, | |
| "intermediate_size": 4304, | |
| "layer_norm_eps": 1e-06, | |
| "model_type": "siglip_vision_model", | |
| "num_attention_heads": 16, | |
| "num_channels": 3, | |
| "num_hidden_layers": 27, | |
| "patch_size": 14 | |
| }, | |
| "vocab_size": 151748, | |
| "quantization_config": { | |
| "config_groups": { | |
| "group_0": { | |
| "format": "pack-quantized", | |
| "input_activations": null, | |
| "output_activations": null, | |
| "targets": [ | |
| "Linear" | |
| ], | |
| "weights": { | |
| "actorder": null, | |
| "block_structure": null, | |
| "dynamic": false, | |
| "group_size": 128, | |
| "num_bits": 4, | |
| "observer": "memoryless_minmax", | |
| "observer_kwargs": {}, | |
| "scale_dtype": null, | |
| "strategy": "group", | |
| "symmetric": true, | |
| "type": "int", | |
| "zp_dtype": null | |
| } | |
| } | |
| }, | |
| "format": "pack-quantized", | |
| "global_compression_ratio": null, | |
| "ignore": [ | |
| "lm_head" | |
| ], | |
| "kv_cache_scheme": null, | |
| "quant_method": "compressed-tensors", | |
| "quantization_status": "compressed", | |
| "sparsity_config": {}, | |
| "transform_config": {}, | |
| "version": "0.17.2.a20260626" | |
| } | |
| } | |