Instructions to use AXERA-TECH/MiniCPM-V-4.6-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AXERA-TECH/MiniCPM-V-4.6-GPTQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="AXERA-TECH/MiniCPM-V-4.6-GPTQ", device_map="auto")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AXERA-TECH/MiniCPM-V-4.6-GPTQ", dtype="auto", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AXERA-TECH/MiniCPM-V-4.6-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AXERA-TECH/MiniCPM-V-4.6-GPTQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AXERA-TECH/MiniCPM-V-4.6-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AXERA-TECH/MiniCPM-V-4.6-GPTQ
- SGLang
How to use AXERA-TECH/MiniCPM-V-4.6-GPTQ 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 "AXERA-TECH/MiniCPM-V-4.6-GPTQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AXERA-TECH/MiniCPM-V-4.6-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "AXERA-TECH/MiniCPM-V-4.6-GPTQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AXERA-TECH/MiniCPM-V-4.6-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AXERA-TECH/MiniCPM-V-4.6-GPTQ with Docker Model Runner:
docker model run hf.co/AXERA-TECH/MiniCPM-V-4.6-GPTQ
yongqiang commited on
Commit ·
3fc0acb
1
Parent(s): 9074c52
Update README performance metrics
Browse files
README.md
CHANGED
|
@@ -37,15 +37,15 @@ This package has been validated on the following AX650-based device:
|
|
| 37 |
|
| 38 |
## Performance
|
| 39 |
|
| 40 |
-
All measurements below were taken on AX650 / NPU3. `TTFT` stands for time to first token.
|
| 41 |
|
| 42 |
-
The text-only smoke prompt was kept within one `128`-token prefill chunk. The image row was measured with the packaged fixed-shape `448x448` vision encoder and `assets/sample.png`. The video row used the packaged sample video with `video:assets/red-panda-openai.mp4:2`.
|
| 43 |
|
| 44 |
| Scenario | Input tokens | Prefill chunks | TTFT | Decode |
|
| 45 |
|---|---:|---:|---:|---:|
|
| 46 |
-
| Text-only smoke prompt | `25` | `1 x 128` | `
|
| 47 |
-
| Image prompt | `88` | `1 x 128` | `
|
| 48 |
-
| Video prompt | `
|
| 49 |
|
| 50 |
The packaged runtime uses the following context layout:
|
| 51 |
|
|
@@ -53,7 +53,7 @@ The packaged runtime uses the following context layout:
|
|
| 53 |
- `kv_cache_len=2047`
|
| 54 |
- `prefill_max_token_num=1280`
|
| 55 |
|
| 56 |
-
`Input tokens` in the table above refers to the full request length after chat templating, not just the visual soft tokens. For the shipped `448x448` vision encoder, each selected image block contributes `64` visual soft tokens. Under the current packaged runtime settings, the sample video request in this README uses `
|
| 57 |
|
| 58 |
### Startup Runtime Footprint
|
| 59 |
|
|
|
|
| 37 |
|
| 38 |
## Performance
|
| 39 |
|
| 40 |
+
All measurements below were taken on AX650 / NPU3. `TTFT` stands for time to first token. In this table, `TTFT` is measured end-to-end from request arrival at `axllm serve` to the first generated token, so the multimodal rows include media preprocessing and vision encoding time.
|
| 41 |
|
| 42 |
+
The text-only smoke prompt was kept within one `128`-token prefill chunk. To avoid one-time startup effects, the text row below excludes the first request after service startup. Its `Decode` figure was measured with longer text-only generations (`max_tokens=256`) to better reflect sustained decode throughput; the short smoke reply used for the `TTFT` row is effectively a single-token answer and would otherwise under-report decode speed. The image row was measured with the packaged fixed-shape `448x448` vision encoder and `assets/sample.png`. The video row used the packaged sample video with `video:assets/red-panda-openai.mp4:2`.
|
| 43 |
|
| 44 |
| Scenario | Input tokens | Prefill chunks | TTFT | Decode |
|
| 45 |
|---|---:|---:|---:|---:|
|
| 46 |
+
| Text-only smoke prompt | `25` | `1 x 128` | `260.81 ms avg` (`259.01-262.61 ms`) | `24.07 token/s avg` |
|
| 47 |
+
| Image prompt | `88` | `1 x 128` | `719.79 ms avg` (`708.57-732.47 ms`) | `24.49 token/s avg` |
|
| 48 |
+
| Video prompt | `1271` | `10 x 128` | `9555.33 ms avg` (`9484.00-9647.62 ms`) | `23.87 token/s avg` |
|
| 49 |
|
| 50 |
The packaged runtime uses the following context layout:
|
| 51 |
|
|
|
|
| 53 |
- `kv_cache_len=2047`
|
| 54 |
- `prefill_max_token_num=1280`
|
| 55 |
|
| 56 |
+
`Input tokens` in the table above refers to the full request length after chat templating, not just the visual soft tokens. For the shipped `448x448` vision encoder, each selected image block contributes `64` visual soft tokens. Under the current packaged runtime settings, the sample video request in this README uses `1271` total input tokens and spans `10` prefill chunks.
|
| 57 |
|
| 58 |
### Startup Runtime Footprint
|
| 59 |
|