Instructions to use nm-testing/Inkling-Dense-54M-MTP with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nm-testing/Inkling-Dense-54M-MTP with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="nm-testing/Inkling-Dense-54M-MTP") 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("nm-testing/Inkling-Dense-54M-MTP") model = AutoModelForMultimodalLM.from_pretrained("nm-testing/Inkling-Dense-54M-MTP", 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 nm-testing/Inkling-Dense-54M-MTP with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nm-testing/Inkling-Dense-54M-MTP" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nm-testing/Inkling-Dense-54M-MTP", "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/nm-testing/Inkling-Dense-54M-MTP
- SGLang
How to use nm-testing/Inkling-Dense-54M-MTP 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 "nm-testing/Inkling-Dense-54M-MTP" \ --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": "nm-testing/Inkling-Dense-54M-MTP", "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 "nm-testing/Inkling-Dense-54M-MTP" \ --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": "nm-testing/Inkling-Dense-54M-MTP", "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 nm-testing/Inkling-Dense-54M-MTP with Docker Model Runner:
docker model run hf.co/nm-testing/Inkling-Dense-54M-MTP
File size: 4,117 Bytes
1e837c7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | {
"source_commits": {
"llm-compressor": "c892a93dad085a3a6aee7f7c72a8ac301c1e5ee9",
"compressed-tensors": "e0b43ebab47e4ef0ecb530a499589ba9b55de16f"
},
"runtime": {
"torch": {
"distribution": "2.13.0+cu130",
"runtime": "2.13.0+cu130",
"path": "/usr/local/lib/python3.12/dist-packages/torch/__init__.py"
},
"transformers": {
"distribution": "5.17.0",
"runtime": "5.17.0",
"path": "/usr/local/lib/python3.12/dist-packages/transformers/__init__.py"
},
"vllm": {
"distribution": "0.30.0",
"runtime": "0.26.0",
"path": "/usr/local/lib/python3.12/dist-packages/vllm/__init__.py"
},
"accelerate": {
"distribution": "1.15.0",
"runtime": "1.15.0",
"path": "/usr/local/lib/python3.12/dist-packages/accelerate/__init__.py"
}
},
"runtime_note": "vLLM distribution metadata is 0.30.0 but runtime version is 0.26.0; results are specific to installed WDC build.",
"training": {
"eval_loss": 0.02748331055045128,
"eval_runtime": 0.0257,
"eval_samples_per_second": 311.39,
"eval_steps_per_second": 77.847,
"epoch": 100.0,
"perplexity": 1.0278644604720464,
"global_step": 200,
"dataset": "create-tiny-model COPYPASTAS",
"mtp_trained": false
},
"limitations": [
"MTP layer untrained",
"Toy perplexity evaluated on training texts",
"Text-only, single GPU, TP=1, eager, one speculative token",
"Does not resolve sparse Inkling MoE export issue",
"Fully quantized MTP E2E remains failing"
],
"fixture": {
"base_model": "thinkingmachines/Inkling",
"base_revision": "828496eeae4c243ff1a22f7f28ff83694f2f7bc9",
"tokenizer_model": "inference-optimization/Inkling-0.92B-MTP",
"tokenizer_revision": "22b31818016a1560cfeb47caaa3296cafa2f43df",
"seed": 0,
"parameters": 54136067,
"weight_bytes": 108279142,
"mtp_tensors": 20,
"all_keys_in_original_checkpoint": true,
"mtp_keys": [
"model.mtp.layers.0.embed_norm.weight",
"model.mtp.layers.0.hidden_norm.weight",
"model.mtp.layers.0.input_proj.weight",
"model.mtp.layers.0.transformer_block.attn.k_norm.weight",
"model.mtp.layers.0.transformer_block.attn.k_sconv.weight",
"model.mtp.layers.0.transformer_block.attn.q_norm.weight",
"model.mtp.layers.0.transformer_block.attn.rel_logits_proj.proj",
"model.mtp.layers.0.transformer_block.attn.v_sconv.weight",
"model.mtp.layers.0.transformer_block.attn.wk_dv.weight",
"model.mtp.layers.0.transformer_block.attn.wo_ud.weight",
"model.mtp.layers.0.transformer_block.attn.wq_du.weight",
"model.mtp.layers.0.transformer_block.attn.wr_du.weight",
"model.mtp.layers.0.transformer_block.attn.wv_dv.weight",
"model.mtp.layers.0.transformer_block.attn_norm.weight",
"model.mtp.layers.0.transformer_block.attn_sconv.weight",
"model.mtp.layers.0.transformer_block.mlp.global_scale",
"model.mtp.layers.0.transformer_block.mlp.w13_dn.weight",
"model.mtp.layers.0.transformer_block.mlp.w2_md.weight",
"model.mtp.layers.0.transformer_block.mlp_norm.weight",
"model.mtp.layers.0.transformer_block.mlp_sconv.weight"
],
"backbone": "toy-trained using create-tiny-model skill",
"mtp": "deterministically initialized, not trained"
},
"tested_weight_sha256": "3f37052495cee65d0c424f9dad0679b4e32f2daca26d8ae7431d3db827029ac1",
"purpose": "Test detection, loading, quantization, and export of explicit model.mtp checkpoint layers. Separate BF16 MTP serving controls pass; fully quantized MTP serving is blocked by the tested vLLM loader.",
"validation": {
"bf16_mtp_serving": "passed",
"fp8_backbone_bf16_mtp_serving": "passed",
"fp8_mtp_export": "passed",
"fp8_mtp_serving": "failed: vLLM Inkling MTP quant_config=None",
"copied_mtp_serving": "passed: oneshot saved FP8 backbone, all 20 MTP tensors exactly equal to source, both prompts generated tokens, positive MTP draft counter",
"toy_prompt": "The capital of France is -> Paris. Paris is the largest city in France..."
}
}
|