Image-Text-to-Text
Transformers
Safetensors
inkling_mm_model
auto-round
mxfp4
conversational
Eval Results
8-bit precision
compressed-tensors
Instructions to use intel-ai/Inkling-Small-MXFP4-AutoRound with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use intel-ai/Inkling-Small-MXFP4-AutoRound with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="intel-ai/Inkling-Small-MXFP4-AutoRound") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("intel-ai/Inkling-Small-MXFP4-AutoRound") model = AutoModelForMultimodalLM.from_pretrained("intel-ai/Inkling-Small-MXFP4-AutoRound", device_map="auto") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use intel-ai/Inkling-Small-MXFP4-AutoRound with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "intel-ai/Inkling-Small-MXFP4-AutoRound" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "intel-ai/Inkling-Small-MXFP4-AutoRound", "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/intel-ai/Inkling-Small-MXFP4-AutoRound
- SGLang
How to use intel-ai/Inkling-Small-MXFP4-AutoRound 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 "intel-ai/Inkling-Small-MXFP4-AutoRound" \ --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": "intel-ai/Inkling-Small-MXFP4-AutoRound", "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 "intel-ai/Inkling-Small-MXFP4-AutoRound" \ --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": "intel-ai/Inkling-Small-MXFP4-AutoRound", "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 intel-ai/Inkling-Small-MXFP4-AutoRound with Docker Model Runner:
docker model run hf.co/intel-ai/Inkling-Small-MXFP4-AutoRound
|
Download README.md from intel-ai/Inkling-Small-MXFP4-AutoRound: direct link, hf CLI and curl.
- Browser
- Download file 2.97 kB
-
https://huggingface.co/intel-ai/Inkling-Small-MXFP4-AutoRound/resolve/main/README.md
- Command line
-
hf download hf://intel-ai/Inkling-Small-MXFP4-AutoRound/README.md
-
curl -L -o README.md https://huggingface.co/intel-ai/Inkling-Small-MXFP4-AutoRound/resolve/main/README.md
2.97 kB
| base_model: | |
| - thinkingmachines/Inkling-Small | |
| license: apache-2.0 | |
| pipeline_tag: image-text-to-text | |
| library_name: transformers | |
| tags: | |
| - auto-round | |
| - mxfp4 | |
| ## Model Details | |
| This model is an MXFP4 (W4A16, group_size 32) model of [thinkingmachines/Inkling-Small](https://huggingface.co/thinkingmachines/Inkling-Small) generated by [intel/auto-round](https://github.com/intel/auto-round) using RTN. Please follow the license of the original model. | |
| - **Quantized (MXFP4)**: MoE routed experts (`mlp.experts`) | |
| - **Kept in BF16**: vision tower, embeddings, lm_head, norms | |
| ## How to Use | |
| ### Environment | |
| ```bash | |
| pip install vllm==0.29.0 | |
| ``` | |
| ### vLLM Usage | |
| ```bash | |
| vllm serve intel-ai/Inkling-Small-MXFP4-AutoRound \ | |
| --tokenizer-mode inkling \ | |
| --reasoning-parser inkling \ | |
| --tool-call-parser inkling \ | |
| --enable-auto-tool-choice \ | |
| --trust-remote-code | |
| ``` | |
| ## Evaluation | |
| | Benchmark | Base Model | MXFP4 | Recovery | | |
| |---|---:|---:|---:| | |
| | aime25 | 90.00 | 91.11 | 101.23% | | |
| | gpqa_diamond | 87.37 | 88.55 | 101.35% | | |
| | GSM8K | 97.27 | 96.99 | 99.71% | | |
| | PIQA | 94.47 | 94.52 | 100.05% | | |
| | **Average** | **92.28** | **92.79** | **100.55%** | | |
| *Note: Baseline corresponds to NVFP4 reference evaluated under identical settings.* | |
| ## Generate the Model | |
| ```bash | |
| auto-round \ | |
| --model_name thinkingmachines/Inkling-Small \ | |
| --scheme BF16 \ | |
| --layer_config '{mlp.experts:{scheme:mxfp4}}' \ | |
| --model_free \ | |
| --format llm_compressor \ | |
| --output_dir Inkling-Small-MXFP4-AutoRound | |
| ``` | |
| ## Ethical Considerations and Limitations | |
| The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs. | |
| Therefore, before deploying any applications of the model, developers should perform safety testing. | |
| ## Caveats and Recommendations | |
| Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. | |
| Here are a couple of useful links to learn more about Intel's AI software: | |
| - [Intel Neural Compressor](https://github.com/intel/neural-compressor) | |
| - [AutoRound](https://github.com/intel/auto-round) | |
| ## Disclaimer | |
| The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes. | |
| ## Cite | |
| ``` | |
| @article{cheng2023optimize, | |
| title={Optimize weight rounding via signed gradient descent for the quantization of llms}, | |
| author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi}, | |
| journal={arXiv preprint arXiv:2309.05516}, | |
| year={2023} | |
| } | |
| ``` | |
| [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round) | |
| Signed-off-by: He, Xin <xin3.he@intel.com> | |